/* ============================================================
   auth.css — sign-in flow (app/login.php)
   Loaded AFTER app.css, so these rules refine the shared .auth-*
   base rather than restating it. Dark mode follows app.css's
   [data-theme="dark"] contract.
   ============================================================ */

/* The card is no longer the only child — the home link sits above it and the
   legal row below, so the page stacks instead of centring a single box. */
.auth-page {
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Home link ───────────────────────────────────────────────
   Requested explicitly: a signed-out visitor who lands here from a
   deep link needs a way back to the site without hitting Back. */
.auth-home {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text2);
  text-decoration: none;
  background: transparent;
  transition: color .18s, background .18s, border-color .18s;
}
.auth-home:hover,
.auth-home:focus-visible {
  color: var(--gold);
  background: var(--card);
  border-color: var(--border);
}
.auth-home svg { flex: none; }

/* ── Brand lockup ────────────────────────────────────────────
   The logo doubles as a second route home, so the whole lockup is
   the link and the tagline rides with it. */
.auth-brand {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
}
.auth-brand img {
  height: 46px;
  width: auto;
  margin: 0 auto .55rem;
  border-radius: 12px;
  display: block;
}
/* Replaces an inline onerror="this.style.display='none'" — a broken CDN
   logo hides the image without putting CSS in the markup. */
.auth-brand img.is-hidden { display: none; }

.auth-tagline {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 0;
}

/* ── Step indicator ──────────────────────────────────────────
   Segment count is rendered per-flow: an existing user has two steps,
   a new one has three. It never claims a step that will not happen. */
.auth-steps {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin: 1.35rem 0 1.5rem;
}
.auth-step {
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: var(--border-solid);
  transition: background .25s;
}
.auth-step.is-done   { background: var(--gold-dim); }
.auth-step.is-active { background: var(--gold-grad); }

/* ── One-time code field ─────────────────────────────────────
   Deliberately ONE input, not six boxes: a single field with
   autocomplete="one-time-code" is what iOS/Android autofill targets,
   and splitting it breaks that. letter-spacing pushes a trailing gap
   after the last digit, so text-indent cancels it to keep the digits
   optically centred. */
.auth-otp {
  width: 100%;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: .55rem;
  text-indent: .55rem;
  padding: .85rem .5rem;
}
.auth-otp::placeholder {
  color: var(--border-solid);
  font-weight: 400;
}
/* Slightly more room than a stock .form-group (1.1rem) — the code field is the
   only control on the step, so it gets a little air before the button. */
.auth-otp-group { margin-bottom: 1.25rem; }

/* Chevron inside the "Continue" button. */
.auth-btn-icon { margin-left: .35rem; }

/* ── Secondary actions (resend / change email) ───────────────── */
.auth-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: 1.25rem;
  font-size: .84rem;
}
.auth-linkbtn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--gold);
  transition: color .18s;
}
.auth-linkbtn:hover { color: var(--gold-hover); }
.auth-linkbtn--muted { color: var(--text2); font-weight: 500; }
.auth-linkbtn--muted:hover { color: var(--text); }
.auth-sep { color: var(--border-solid); }

/* Revealed by JS after ~15s — class toggle, not an inline display write. */
.auth-hint {
  display: none;
  margin-top: 1.1rem;
  font-size: .8rem;
  line-height: 1.5;
  text-align: center;
  color: var(--text2);
}
.auth-hint.is-visible { display: block; }

.auth-help {
  font-size: .75rem;
  color: var(--text3);
  margin-top: .35rem;
}

/* ── Legal / footer row ──────────────────────────────────────── */
.auth-legal {
  margin-top: 1.1rem;
  font-size: .72rem;
  line-height: 1.6;
  text-align: center;
  color: var(--text3);
}
.auth-legal a { color: inherit; text-decoration: underline; }
.auth-legal a:hover { color: var(--gold); }

.auth-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  font-size: .75rem;
  color: var(--text3);
}
.auth-foot a {
  color: inherit;
  text-decoration: none;
  transition: color .18s;
}
.auth-foot a:hover { color: var(--gold); }

/* ── Small screens ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-page { padding: 1.25rem .9rem 2rem; gap: .85rem; }
  .auth-card { padding: 1.75rem 1.35rem 2rem; border-radius: 16px; }
  .auth-otp  { font-size: 1.6rem; letter-spacing: .4rem; text-indent: .4rem; }
  .auth-brand img { height: 40px; }
}

/* ── Dark mode ───────────────────────────────────────────────── */
[data-theme="dark"] .auth-home:hover,
[data-theme="dark"] .auth-home:focus-visible {
  background: var(--card);
  border-color: var(--border);
}
[data-theme="dark"] .auth-otp::placeholder { color: var(--text3); }
