/* "Vault" theme — the brand name is BillVault, and these are the first
   pages a shop owner sees, so the login/signup/admin surface is where the
   "this is a secure, serious product" impression gets made. Teal/cyan
   reads as "verified/secure" rather than generic corporate blue; a soft
   glow on the card, the brand mark, and the primary button reinforces it
   without turning the page into a nightclub — it's still a form someone
   has to read and fill in carefully, so contrast and calm dominate; the
   glow is the accent. */
:root {
  --bg: #eef6f7;
  --bg-accent-glow: radial-gradient(circle at 50% -10%, rgba(8, 145, 178, 0.10), transparent 55%);
  --card: #ffffff;
  --text: #0f1b22;
  --muted: #5c7680;
  --border: #d7e6ea;
  --brand: #0891b2;
  --brand-dark: #0e7490;
  --brand-soft: #e0f4f7;
  --neon-cyan: #0891b2;
  --neon-green: #059669;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --radius: 14px;
  --shadow: 0 10px 34px -14px rgba(8, 145, 178, 0.28);
  --glow: 0 0 0 1px rgba(8, 145, 178, 0.35), 0 0 22px rgba(8, 145, 178, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070c14;
    --bg-accent-glow: radial-gradient(circle at 50% -10%, rgba(34, 211, 238, 0.14), transparent 55%);
    --card: #0e1622;
    --text: #e6f4f7;
    --muted: #7fa0aa;
    --border: rgba(34, 211, 238, 0.16);
    --brand: #22d3ee;
    --brand-dark: #67e8f9;
    --brand-soft: rgba(34, 211, 238, 0.12);
    --neon-cyan: #22d3ee;
    --neon-green: #34d399;
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --success: #34d399;
    --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.7);
    --glow: 0 0 0 1px rgba(34, 211, 238, 0.5), 0 0 30px rgba(34, 211, 238, 0.35);
  }
  /* The card itself goes light even in dark mode — reported: the shield
     logo (dark navy) read as barely visible on the near-black card even
     with the glow filter on .brand img. A light card is the reliable fix
     (real contrast, not just a glow trick); the page around it stays dark
     for the "Vault" feel. Re-declaring the tokens here (not just
     `background`) means every child that reads var(--text)/var(--muted)/
     var(--border) — labels, hints, the "Sign in" heading, the switch link's
     surrounding text — repaints correctly for a light surface too, with no
     separate light/dark rule needed per element. */
  .card {
    --card: #f7fbfc;
    --text: #0f1b22;
    --muted: #5c7680;
    --border: #d7e6ea;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg) var(--bg-accent-glow);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.brand img {
  /* Used exactly as supplied — transparent PNG, no square/circle behind it,
     no rounded-corner clipping. Sized up so the mark is unmistakable at a
     glance rather than a small detail next to the wordmark. The card is
     light in both themes now (see the dark-mode .card override above), so
     the dark shield always has real contrast — the glow below is just a
     brand-colour accent on top of that, not load-bearing for legibility. */
  height: 84px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.35));
}
.brand span { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }

/* A quiet "secured" chip — appears under the brand mark on login/signup to
   set the tone without a paragraph of marketing copy. Purely decorative;
   no functional claim beyond what SAAS_EDITION.md documents (TLS via your
   reverse proxy, hashed passwords, tamper-evident invoice ledger). */
.security-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -10px 0 22px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--neon-green);
}
.security-chip svg { width: 13px; height: 13px; filter: drop-shadow(0 0 4px currentColor); }

h1 {
  font-size: 1.35rem;
  margin: 0 0 4px;
  text-align: center;
}
.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  margin: 0 0 24px;
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--text);
}
label.first { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus {
  border-color: var(--brand);
  box-shadow: var(--glow);
}

button.primary {
  width: 100%;
  margin-top: 22px;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #04222a;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
button.primary:hover { background: var(--brand-dark); box-shadow: var(--glow); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

@media (prefers-color-scheme: light) {
  button.primary { color: #ffffff; }
}

.error {
  display: none;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.85rem;
  line-height: 1.4;
}
.error.show { display: block; }

.hint {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.switch {
  text-align: center;
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--muted);
}
.switch a { color: var(--brand); font-weight: 600; text-decoration: none; }
.switch a:hover { text-decoration: underline; }

.footer-note {
  text-align: center;
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 420px) {
  .card { padding: 26px 20px 22px; border-radius: 12px; }
}
