/* Tokens below carry app.css values (the gate is a separate page without app.css). Spacing and sizes are the locked gate's own (mock-fable/gate/login.html); the build moves them to app.css tokens.
   K3o mock: Alurin's own sign-in pages (the locked gate look: paper + ink, mock-fable/gate/login.html) and the two emails.
   Same tokens as app.css; Plex Sans like the app. */
@font-face { font-family: "Plex Sans"; src: url(/static/fonts/plex-sans.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Wordmark"; src: url(/static/fonts/serif-500.woff2); font-display: swap; }
@font-face { font-family: "DocMono"; src: url(/static/fonts/plex-mono-400.woff2); font-display: swap; }
:root { --ink: #111111; --muted: #6d6d6a; --soft: #75756f; --note-ink: #4a4741; --stop-tint: #fdecea; --r: 8px; --fs-xs: 12px; --fs-s: 13px; --fs: 14px; --fs-m: 15px; --fs-xl: 22px; --line: #e6e6e2; --line-strong: #d9d9d4; --brand: #111111; --stop: #c62b1c; --warn: #b86a0c; --ok: #1a7f4f; --paper: #efe9df; --canvas: #f6f6f4; --tint: #f3f1ec; }
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body { font-family: "Plex Sans", system-ui, sans-serif; font-size: var(--fs); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 2px; }

/* gate */
.gate { min-height: 100vh; background: var(--paper); position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 32px 56px; }
.gate::before { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); opacity: .32; mix-blend-mode: multiply; pointer-events: none; }
.flow { position: absolute; inset: -5%; width: 110%; height: 110%; pointer-events: none; }
.brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 9px; }
.lg { width: 26px; height: 26px; fill: currentColor; }
.alw { font-family: "Wordmark", Georgia, serif; font-weight: 500; font-size: 25px; letter-spacing: -.025em; line-height: 1; }
.card { position: relative; z-index: 2; width: 100%; max-width: 420px; margin: auto auto auto max(0px, calc(8vw - 56px)); padding: 36px; display: grid; gap: 18px; background: rgba(255,255,255,.95); border: 1px solid rgba(29,28,26,.06); border-radius: 16px; box-shadow: 0 1px 2px rgba(29,28,26,.05), 0 30px 70px -28px rgba(29,28,26,.35); }
.card h1 { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.card .sub { color: var(--muted); margin-top: 6px; line-height: 1.5; }
.stepno { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); letter-spacing: .02em; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.stepno i { width: 22px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.stepno i.on { background: var(--ink); }
label { display: grid; gap: 6px; font-size: var(--fs-s); font-weight: 500; }
.lrow { display: flex; justify-content: space-between; align-items: baseline; }
.lrow a { font-weight: 400; color: var(--muted); font-size: var(--fs-s); }
input { font: inherit; font-size: var(--fs-m); height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; color: var(--ink); width: 100%; }
input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(17,17,17,.08); }
input[readonly] { background: var(--canvas); color: var(--muted); }
[hidden] { display: none !important; }
.btn { font: inherit; font-size: var(--fs-m); font-weight: 500; height: 44px; border: 0; border-radius: var(--r); background: var(--brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 1px 2px rgba(17,17,17,.12), 0 4px 14px -6px rgba(17,17,17,.45); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; gap: 10px; }
.btn.ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-xs); }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.note { padding: 10px 12px; border-radius: var(--r); background: var(--tint); color: var(--note-ink); font-size: var(--fs-s); line-height: 1.45; }
.small { font-size: var(--fs-s); color: var(--muted); line-height: 1.5; }
.center { text-align: center; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.meter i { height: 4px; border-radius: 2px; background: var(--line); }
.meter.m3 i:nth-child(-n+3) { background: var(--ink); }
.rules { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); list-style: none; padding: 0; }
.rules li { display: flex; gap: 6px; align-items: center; }
.rules li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.rules li.ok { color: var(--ink); }
.rules li.ok::before { background: var(--ink); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp span { height: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.otp span.cur { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17,17,17,.08); }
.setup { display: grid; gap: 14px; counter-reset: s; }
.setup > li { list-style: none; display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.setup > li::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: var(--fs-xs); font-weight: 600; display: grid; place-items: center; }
.setup b { font-weight: 500; }
.setup .small { margin-top: 2px; }
.qr { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.qr svg { width: 120px; height: 120px; flex: none; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.key { font-family: "DocMono", monospace; font-size: var(--fs-s); letter-spacing: .04em; color: var(--ink); word-break: break-all; }
.gfoot { position: relative; z-index: 2; display: flex; gap: 24px; color: var(--note-ink); font-size: var(--fs-xs); }
.ok-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; }
.ok-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.who .av { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: var(--fs-s); }
.who b { font-weight: 500; display: block; }
.who span { color: var(--muted); font-size: var(--fs-s); }
@media (max-width: 860px) {
  .gate { padding: 20px 16px; }
  .flow { opacity: .5; }
  .card { margin: 24px 0 auto; max-width: none; padding: 26px 20px; }
  .card h1 { font-size: 23px; }
  .gfoot { flex-direction: column; gap: 4px; margin-top: 20px; }
  input { font-size: 16px; }
}

/* email, shown inside a plain mail window */
.mailwin { min-height: 100vh; background: var(--canvas); padding: 32px; }
.mail-meta { max-width: 640px; margin: 0 auto 16px; display: grid; gap: 4px; font-size: var(--fs-s); color: var(--muted); }
.mail-meta b { color: var(--ink); font-weight: 600; font-size: 18px; margin-bottom: 6px; letter-spacing: -.01em; }
.mail-meta span strong { color: var(--ink); font-weight: 500; }
.mail { max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 40px 48px; display: grid; gap: 20px; font-size: var(--fs-m); line-height: 1.55; }
.mail .co { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.mail .mk { width: 30px; height: 30px; border-radius: var(--r); background: var(--ink); color: #fff; display: grid; place-items: center; font-size: var(--fs-m); }
.mail h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.mail .btn { justify-self: start; padding: 0 22px; }
.mail dl { display: grid; gap: 6px; padding: 14px 16px; background: var(--canvas); border-radius: var(--r); font-size: var(--fs); }
.mail dl div { display: flex; gap: 12px; }
.mail dt { width: 120px; color: var(--muted); flex: none; }
.mail dd { font-weight: 500; }
.mail .fine { font-size: var(--fs-s); color: var(--muted); }
.mail .sig { border-top: 1px solid var(--line); padding-top: 16px; font-size: var(--fs-xs); color: var(--soft); display: flex; justify-content: space-between; gap: 12px; }
.mail .sig .alw { font-size: var(--fs-s); color: var(--ink); }
@media (max-width: 860px) {
  .mailwin { padding: 16px 12px; }
  .mail { padding: 26px 20px; font-size: var(--fs-m); }
  .mail .btn { justify-self: stretch; }
  .mail dt { width: 96px; }
  .mail .sig { flex-direction: column; }
}
.otp.gap { margin-top: 8px; }
.setup { padding: 0; }
.f-box { padding: 10px 12px; border-radius: var(--r); background: var(--stop-tint); color: var(--stop); font-size: var(--fs-s); line-height: 1.45; }
input.bad, .otp.bad span { border-color: var(--stop); }
/* the build: one real field under the 6 boxes (auth.js fills them); meter steps */
.otp { position: relative; }
.otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; }
.meter.m1 i:nth-child(1), .meter.m2 i:nth-child(-n+2), .meter.m4 i { background: var(--ink); }
