/* Auth pages (TASK-60.3). Design: "Phiant Identity — Artboards", page "Sign up & log in". Fonts are self-hosted
   (no Google Fonts: a sign-in page must not send every visitor's IP to a US CDN). */
@font-face { font-family: "Fraunces"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/assets/fonts/fraunces.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/assets/fonts/hanken-grotesk.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400;
  src: url(/assets/fonts/plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/assets/fonts/plex-mono-500.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0B0D10; --card: #0D1016; --border: #242B37; --field: #161B24; --field-border: #5F6774;
  --ink: #EEF1F6; --body: #C3CAD6; --muted: #8C95A4; --primary: #EEF1F6; --primary-ink: #0B0D10;
  --secondary: #171C25; --secondary-border: #2A3140; --link: #97A3FF; --error: #E06C6C; --ok: #5DC98A;
  --tile-bg: #EDEFF3; --tile-border: none; --accent: #4E5DF6;
  --display: "Fraunces", Georgia, serif; --sans: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #EDEFF3; --card: #FFFFFF; --border: #D7DCE4; --field: #FFFFFF; --field-border: #8C95A4;
    --ink: #16181D; --body: #3E4552; --muted: #5F6774; --primary: #16181D; --primary-ink: #FFFFFF;
    --secondary: #F4F6F9; --secondary-border: #D7DCE4; --link: #3D4CE0; --error: #C94F4F; --ok: #2E9E63;
    --tile-bg: #FFFFFF; --tile-border: 1px solid #D7DCE4;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--body); }
::selection { background: var(--accent); color: #FFFFFF; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px clamp(20px, 4vw, 48px); }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-tile { display: inline-flex; transform: translateY(4px); padding: 2px; background: var(--tile-bg); border: var(--tile-border); border-radius: 4px; }
.brand-tile svg { display: block; color: #12151B; }
.wordmark { font-family: var(--display); font-weight: 460; font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0; font-size: 32px; line-height: 0.9; letter-spacing: -0.015em; color: var(--ink); }
.top-note { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.top-note a, .top-link { color: var(--link); font-weight: 600; font-family: var(--sans); font-size: 14px; }
.top-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 20px 56px; }
.card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 40px 36px 32px; display: flex; flex-direction: column; gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.head { display: flex; flex-direction: column; gap: 10px; }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0; font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
h1.sm { font-size: 30px; line-height: 1.15; }
.lead { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--body); }
.lead strong { font-weight: 600; color: var(--ink); }
.fine { margin: 0; font-family: var(--sans); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.icon-box { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--secondary); border: 1px solid var(--secondary-border); border-radius: 10px; color: var(--ink); }

.group { display: flex; flex-direction: column; gap: 14px; }
.group.tight { gap: 10px; }
.label { display: flex; flex-direction: column; gap: 8px; }
.label > span, legend { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--body); }
.field { height: 46px; padding: 0 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 8px; font-family: var(--mono); font-size: 14px; color: var(--ink); width: 100%; }
.field::placeholder { color: #7A8290; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78, 93, 246, 0.28); }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 8px; font-family: var(--sans); font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border: none; }
.btn-primary:hover { opacity: 0.9; color: var(--primary-ink); }
.btn-secondary { background: var(--secondary); color: var(--ink); border: 1px solid var(--secondary-border); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--secondary-border); }
.btn-secondary:hover, .btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.text-btn { background: none; border: none; padding: 0; cursor: pointer; font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--link); }

.or { display: flex; align-items: center; gap: 12px; }
.or span:not(.or-text) { flex: 1; height: 1px; background: var(--border); }
.or-text { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--muted); }

fieldset { margin: 0; padding: 0; border: none; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0; margin: 0 0 8px 0; }
.digits { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.digit { width: 100%; height: 56px; padding: 0; text-align: center; background: var(--field); border: 1px solid var(--field-border); border-radius: 8px; font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--ink); }
.digit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78, 93, 246, 0.28); }
.digits.bad .digit { border-color: var(--error); }
.alert { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 13px; line-height: 1.4; color: var(--error); }
.alert svg { flex: none; }

.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--border); }
.foot-row > * { padding-top: 16px; }
.hint { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.countdown { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-family: var(--sans); font-size: 14px; line-height: 1.45; color: var(--body); }
.checks svg, .ok { flex: none; margin-top: 2px; color: var(--ok); }

.waiting { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 24px 0 8px; }
.strata { width: 96px; height: 96px; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding-left: 12px; }
.strata div { width: 52px; height: 16px; border-radius: 2px; background: var(--ink); }
.strata div:first-child { animation: ph-shift 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes ph-shift { 0%, 12% { transform: translateX(0); } 34%, 62% { transform: translateX(20px); } 86%, 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .strata div:first-child { animation: none; transform: translateX(20px); } }

.foot { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; padding: 0 20px 28px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.foot a { color: var(--muted); }

@media (max-width: 520px) {
  .card { padding: 28px 22px 24px; }
  .digit { height: 48px; font-size: 20px; }
}
