/* =====================================================================
   auth-shared.css — chrome + tokens used by signup.html, login.html,
   verify.html. Each page also embeds this inline; the file is kept for
   reference and easier editing.
   ===================================================================== */
:root {
  --bg:        #0a0a0b;
  --surface:   #111114;
  --elevated:  #16161a;
  --raised:    #1c1c22;
  --hairline:  #23232a;
  --hairline2: #2d2d35;
  --ink:       #e8e8ea;
  --muted:     #8a8a93;
  --dim:       #5a5a63;
  --accent:    #5eead4;
  --amber:     #fbbf24;
  --rose:      #f87171;
  --green:     #10b981;
  --pill-bg:   rgba(17,17,20,0.6);
  --starfield-rgb: 232,232,234;
  --starfield-link-rgb: 94,234,212;
}
:root[data-theme="light"] {
  --bg:        #f7f6f3;
  --surface:   #fbfaf7;
  --elevated:  #ffffff;
  --raised:    #ffffff;
  --hairline:  #e6e3dc;
  --hairline2: #d8d4c9;
  --ink:       #121215;
  --muted:     #5c6470;
  --dim:       #8a8f99;
  --accent:    #0d9488;
  --amber:     #b45309;
  --rose:      #b91c1c;
  --green:     #047857;
  --pill-bg:   rgba(251,250,247,0.7);
  --starfield-rgb: 20,20,30;
  --starfield-link-rgb: 13,148,136;
}
html, body, *[class] {
  transition: background-color 220ms ease, color 220ms ease,
              border-color 220ms ease, box-shadow 220ms ease;
}
@media (prefers-reduced-motion: reduce) {
  html, body, *[class] { transition: none !important; }
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; }
#starfield { position: fixed; inset: 0; z-index: 0; transition: opacity 320ms ease; }
:root[data-theme="light"] #starfield { opacity: 0.4; }

/* ============ Top chrome ============ */
.brand-corner {
  position: fixed; top: 18px; left: 20px; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--muted); text-transform: uppercase;
}
.brand-corner .favicon {
  width: 14px; height: 14px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--accent); font-size: 9px;
}
.engine-status {
  position: fixed; top: 18px; right: 20px; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--pill-bg);
  backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--muted);
}
.engine-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.engine-status .clock { color: var(--ink); }
.theme-toggle {
  appearance: none; position: fixed; top: 18px; right: 200px; z-index: 10;
  background: var(--pill-bg); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline); color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 180ms, color 180ms;
}
.theme-toggle:hover { border-color: var(--hairline2); color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .t-sun  { display: none; }
.theme-toggle .t-moon { display: block; }
:root[data-theme="light"] .theme-toggle .t-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .t-moon { display: none; }
@media (max-width: 560px) {
  .theme-toggle { right: 132px; }
  .engine-status .label { display: none; }
}

/* ============ Auth card ============ */
main.auth-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 16px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.5);
}
.wordmark {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 6px;
}
.wordmark .dot { color: var(--amber); }
.tagline {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 22px;
}
.auth-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--ink);
}
.auth-card .sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 22px;
}

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.field label .req  { color: var(--amber); margin-left: 4px; }
.field label .opt  { color: var(--dim); margin-left: 4px; letter-spacing: 0; text-transform: none; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  outline: none;
  transition: border-color 120ms;
}
.field input:focus { border-color: var(--accent); }

/* Password strength dots */
.pw-row {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
}
.pw-row .dot {
  width: 16px; height: 4px;
  border-radius: 2px;
  background: var(--hairline2);
  transition: background 120ms;
}
.pw-row .dot.on { background: var(--amber); }
.pw-row .pw-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.08em;
  margin-left: 8px;
}

/* Chip selector */
.chips-row {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.chip {
  padding: 6px 11px;
  border: 1px solid var(--hairline2);
  border-radius: 999px;
  background: var(--elevated);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
  min-height: 32px;
}
.chip:hover { color: var(--ink); }
.chip.active {
  color: var(--bg);
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 600;
}

/* Primary CTA */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 8px; border: 0;
  background: var(--amber);
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 120ms, opacity 120ms;
  min-height: 48px;
  margin-top: 4px;
}
.cta:hover { filter: brightness(1.06); }
.cta[disabled] { opacity: 0.5; cursor: wait; filter: none; }
.cta .arrow { font-family: 'JetBrains Mono', monospace; font-size: 15px; }

/* Below-CTA links */
.below-cta {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.below-cta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.below-cta a:hover { text-decoration: underline; }
.tiny-link {
  display: inline-block;
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
  text-decoration: none;
  align-self: flex-end;
}
.tiny-link:hover { color: var(--muted); }

.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--hairline);
  width: 100%;
  justify-content: center;
}
.back-link:hover { color: var(--muted); }

/* Message states */
.msg {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.msg .g {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  flex: 0 0 14px;
  line-height: 1.4;
}
.msg .body { flex: 1; min-width: 0; }
.msg.success {
  border: 1px solid var(--green);
  background: rgba(16,185,129,0.08);
  color: var(--green);
}
.msg.info {
  border: 1px solid var(--amber);
  background: rgba(251,191,36,0.08);
  color: var(--amber);
}
.msg.error {
  border: 1px solid var(--rose);
  background: rgba(248,113,113,0.08);
  color: var(--rose);
}
.msg .mono {
  display: block;
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink);
  word-break: break-all;
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--hairline2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Verify big glyph */
.big-glyph {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  border: 1.5px solid var(--hairline2);
  color: var(--muted);
}
.big-glyph.success { color: var(--green); border-color: var(--green); background: rgba(16,185,129,0.08); }
.big-glyph.error   { color: var(--rose);  border-color: var(--rose);  background: rgba(248,113,113,0.08); }

/* Loading state shows spinner inside the card */
.loading-block {
  display: none;
  align-items: center; gap: 10px;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--elevated);
  color: var(--muted);
  font-size: 13px;
}
.loading-block.show { display: flex; }

@media (max-width: 480px) {
  main.auth-wrap { padding: 76px 8px; }
  .auth-card { padding: 24px 20px; border-radius: 12px; }
  .auth-card h1 { font-size: 20px; }
}
