/* auth.css — the sign-in screen.
 *
 * Loaded AFTER app.css and depends on it: the palette, .btn, .input, .field, .badge and .toast
 * all come from there unchanged, so a change to the panel's controls reaches this page too.
 * Everything below is either new to this screen (the backdrop, the card, the strength meter) or
 * an override that only makes sense off the application shell.
 */

/* app.css sets overflow:hidden for the fixed panel layout. The sign-in card has to be able to
   scroll on a short window, so this page opts back out. */
.auth-body{overflow:auto}

/* ── backdrop ──────────────────────────────────────────────────────────────
   The D2R lobby stone, already in the repo.

   bg.png is a UI panel, not a scene: it has its own carved border painted into the edges. Cover
   it at 1:1 and those edges land inside the viewport and read as a rendering artefact. So it is
   overscanned past every side and softly blurred — what survives is the stone grain, the gothic
   arch and the gold filigree, which is all it was ever wanted for. */
.auth-body::before{
  content:"";position:fixed;inset:-260px -140px;z-index:0;
  background:#0a0908 url("/assets/d2r/bg.png") center/cover no-repeat;
  filter:blur(5px) saturate(1.15);
  opacity:.8;
}
.auth-body::after{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:radial-gradient(ellipse 78% 70% at 50% 44%,rgba(5,5,5,.15) 0%,rgba(5,5,5,.62) 68%,#050505 100%);
}

.auth-wrap{
  position:relative;z-index:1;
  min-height:100vh;display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  padding:40px 20px;gap:22px;
}

/* ── wordmark ────────────────────────────────────────────────────────────── */
.auth-brand{text-align:center;display:flex;flex-direction:column;align-items:center;gap:9px}
.auth-brand .wordmark{
  font:600 46px/1 var(--font-display);
  letter-spacing:.19em;text-indent:.19em;      /* letter-spacing pads the right edge only */
  background:linear-gradient(180deg,var(--gold-bright) 6%,var(--gold) 52%,#8a6f33 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.7));
}
.auth-brand .rule{
  width:190px;height:1px;
  background:linear-gradient(90deg,transparent,var(--border-gold) 24%,var(--border-gold) 76%,transparent);
  opacity:.65;
}
.auth-brand .tagline{font-size:12.5px;color:var(--text-muted);letter-spacing:.08em}

/* ── card ────────────────────────────────────────────────────────────────── */
.auth-card{
  width:404px;max-width:100%;
  background:rgba(17,20,20,.93);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius);
  box-shadow:0 28px 70px rgba(0,0,0,.72);
  backdrop-filter:blur(2px);
  overflow:hidden;
}
.auth-card .card-body{padding:22px}

/* Tabs. Reuses the .seg shape from app.css but full width, since there are exactly two. */
.auth-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--border-subtle)}
.auth-tabs button{
  height:46px;background:transparent;border:0;cursor:pointer;
  color:var(--text-secondary);font-size:13.5px;font-weight:500;
  border-bottom:2px solid transparent;transition:color .12s,border-color .12s,background .12s;
}
.auth-tabs button:hover{color:var(--text-primary);background:rgba(255,255,255,.02)}
.auth-tabs button.on{color:var(--gold-bright);border-bottom-color:var(--gold)}

.auth-form{display:flex;flex-direction:column;gap:15px}
.auth-form h2{
  margin:0;font:600 17px/1.3 var(--font-display);letter-spacing:.3px;color:var(--text-primary);
}
.auth-form .lede{margin:-6px 0 0;font-size:12.5px;line-height:1.55;color:var(--text-secondary)}

/* Password field with a reveal toggle. The button sits inside the input's box rather than
   beside it, so the field keeps its full width and the layout does not shift when it appears. */
.pw-wrap{position:relative}
.pw-wrap .input{padding-right:42px}
.pw-wrap .peek{
  position:absolute;right:1px;top:1px;bottom:1px;width:40px;
  display:grid;place-items:center;
  background:transparent;border:0;cursor:pointer;color:var(--text-muted);border-radius:0 6px 6px 0;
}
.pw-wrap .peek:hover{color:var(--gold)}
.pw-wrap .peek svg{width:17px;height:17px;display:block}

/* Strength meter. Four segments, driven by a real measure (length first, variety second) —
   it is not a decoration that always shows "strong". */
.pw-meter{display:flex;flex-direction:column;gap:5px;margin-top:-8px}
/* Nothing typed yet: four empty tracks under an empty field read as a stray divider, so the
   meter only appears once there is something to measure. */
.pw-meter.s0{display:none}
.pw-meter .bars{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
.pw-meter .bars i{height:3px;border-radius:2px;background:#241f18;transition:background .15s}
.pw-meter.s1 .bars i:nth-child(-n+1){background:var(--danger)}
.pw-meter.s2 .bars i:nth-child(-n+2){background:var(--warning)}
.pw-meter.s3 .bars i:nth-child(-n+3){background:#b8a55c}
.pw-meter.s4 .bars i{background:var(--success)}
.pw-meter .lbl{font-size:11.5px;color:var(--text-muted)}

/* Inline error/notice. Sits in the flow so it pushes the button down rather than overlapping. */
.auth-msg{
  border-radius:6px;padding:10px 12px;font-size:12.5px;line-height:1.5;
  border:1px solid var(--border-subtle);background:var(--bg-panel-raised);color:var(--text-secondary);
}
.auth-msg.err{border-color:rgba(201,91,82,.5);background:rgba(201,91,82,.1);color:#e9a49d}
.auth-msg.ok{border-color:rgba(105,185,107,.45);background:rgba(105,185,107,.09);color:#a3d6a4}
.auth-msg strong{color:var(--text-primary);font-weight:600}

.auth-form .btn.primary{height:44px;font-size:14px}
.auth-form .btn.primary[data-busy="1"]{opacity:.6;cursor:progress}

/* Field-level hint under an input (code format, password floor). */
.hint{font-size:11.5px;color:var(--text-muted);line-height:1.5}
.hint.bad{color:var(--danger)}

/* The setup state gets a gold hairline so first run is visibly not the ordinary sign-in. */
.auth-card.setup{border-color:var(--border-gold)}

.auth-foot{
  font-size:11.5px;color:var(--text-muted);text-align:center;line-height:1.6;
  max-width:404px;
}
.auth-foot code{font-family:var(--font-mono);font-size:11px;color:var(--text-secondary)}

/* Monospace for the registration and reset codes — they are transcribed by hand from a chat
   message, so the characters need to be unambiguous. */
.input.code{font-family:var(--font-mono);letter-spacing:.1em}

/* The secondary way out of a form: "I have a reset code", "Back to sign in". A link rather than
   a button, because it navigates rather than acts. */
.auth-form .alt{text-align:center;margin-top:-4px}
.auth-form .alt a{
  font-size:12.5px;color:var(--text-secondary);cursor:pointer;
  border-bottom:1px solid transparent;
}
.auth-form .alt a:hover{color:var(--gold);border-bottom-color:var(--border-gold)}
