:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #16232e;
  --muted: #5f6b76;
  --border: #dfe5ea;
  --blue: #1f6feb;
  --green: #16a34a;
  --gradient: linear-gradient(135deg, var(--blue), var(--green));
  --gradient-hover: linear-gradient(135deg, #1a5fd0, #138a3f);
  --error: #c62828;
  --yes-bg: #e6f6ec;
  --no-bg: #fdecea;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Header with logo square ---------- */
.site-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: var(--gradient);
}

.logo {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo.has-image { border: none; }
.logo.has-image span { display: none; }

/* ---------- Page content ---------- */
.page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 28px 32px;
  box-shadow: 0 8px 30px rgba(22, 35, 46, 0.08);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient);
}
.card.wide { max-width: 720px; }

h1 { margin: 0 0 4px; font-size: 1.5rem; }
.subtitle { margin: 0 0 24px; color: var(--muted); font-size: 0.95rem; }

label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }

input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.18);
}

button, .button {
  display: block;
  width: 100%;
  padding: 11px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--gradient);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--gradient-hover); }
button:disabled { opacity: 0.6; cursor: default; }

.message { min-height: 1.4em; margin: 14px 0 0; font-size: 0.92rem; }
.message.error { color: var(--error); }

a { color: var(--blue); }

/* ---------- Authenticated page ---------- */
.success { text-align: center; }
.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
}
.success-icon svg { width: 36px; height: 36px; }
.success .subtitle { margin-bottom: 28px; }

/* ---------- Stored logins table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 0.82rem; }
.pill.yes { background: var(--yes-bg); color: var(--green); }
.pill.no { background: var(--no-bg); color: var(--error); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
.footer-link { display: block; margin-top: 20px; text-align: center; font-size: 0.85rem; }
