/*
 * Auth entrance shell (the allauth account pages): the standalone centered
 * card wrapping sign-in / sign-out / password-reset / sign-up-closed. Loaded
 * by apps/portal/templates/allauth/layouts/base.html AFTER tokens.css and
 * portal.css — portal.css supplies the shared component recipes (ADR-031:
 * .card, .field/.field-row, .btn-primary, .notice); this file adds ONLY the
 * auth-specific entrance layout that has no home elsewhere: the full-viewport
 * centering frame, the wordmark, the single-column field stack, and the
 * remember-me inline checkbox row. Every design value is a token via var()
 * (ADR-023). No topbar here: the not-signed-in surface has no app shell, the
 * card carries the brand mark AND the wordmark.
 */

/* Full-viewport stone ground with the card centred both ways. Page bg and
 * base font come from portal.css's body rules; this adds the centering frame. */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--auth-page-min-height);
  box-sizing: border-box;
  padding: var(--space-4xl);
}

.auth-main {
  width: 100%;
  max-width: var(--auth-card-max-width);
}

/* The card itself is the shared .card recipe (background/border/radius/
 * shadow/padding — see portal.css §ADR-031, applied via class="auth-card
 * card" in base.html); .auth-card here is purely a scoping hook for the
 * auth-only typography below, not a second box recipe. */

/* The brand block is the shells' .brand markup (portal.css) centred on the
 * card — one mark everywhere (spec D6). Layout only; the mark's colour and
 * shape are portal.css's .brand-mark. */
.auth-card .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: var(--auth-wordmark-size);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-3xl);
}

.auth-card h1 {
  font-size: var(--text-section);
  margin: 0 0 var(--space-2xl);
}

.auth-card p {
  margin: 0 0 var(--space-2xl);
}

.auth-intro {
  color: var(--color-text-muted);
  font-size: var(--text-body);
}

/* The single-column field stack (auth-specific IA: this card is always a
 * one-column form, unlike the operational screens' horizontal .field-row
 * toolbars/panels) — vertical rhythm between .field rows plus the submit.
 * Fields themselves render via the shared .field component (portal.css); no
 * auth-specific label/input recipe is needed any more. */
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* Full-width submit — the entrance card's one action fills the field-stack
 * width; colour/shape are entirely the shared .btn-primary recipe
 * (portal.css) — this is layout only, not a re-implementation of it. */
.auth-fields .btn-primary {
  width: 100%;
}

/* Remember-me row: checkbox and label inline. No shared component covers an
 * inline checkbox+label — genuinely auth-specific. */
.auth-field-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.auth-field-checkbox label {
  margin-bottom: 0;
}

/* Field errors: quiet danger text under the control. The non-field
 * wrong-credentials banner uses portal.css's .notice.error instead. Django's
 * default ErrorList class (.errorlist) is covered so unoverridden allauth
 * pages get the same treatment. list-style/padding 0 are structural. */
.auth-field-errors,
.auth-card .errorlist {
  list-style: none;
  margin: var(--space-3xs) 0 0;
  padding: 0;
  color: var(--color-danger-text);
  font-size: var(--text-body);
}
/* Scoped under .auth-card so it outranks the `.auth-card p` margin rule
 * above (0,1,1) — a bare .auth-error-line (0,1,0) would lose the margin
 * fight and pick up the paragraph bottom margin inside the notice. Same
 * reasoning for .auth-help and .auth-links below. */
.auth-card .auth-error-line {
  margin: 0;
}

/* Field help text — on the sign-in page this IS the forgot-password link
 * (ink from portal.css's one link rule, S-4a) (allauth's LoginForm sets it as the password field's help_text, wired
 * to the input via aria-describedby). */
.auth-card .auth-help {
  margin: var(--space-3xs) 0 0;
  font-size: var(--text-body);
}

/* Quiet secondary links (back to sign in). */
.auth-card .auth-links {
  margin: var(--space-2xl) 0 0;
  text-align: center;
  font-size: var(--text-body);
}

/* The bare-markup fallback layer that used to live here is GONE (continuity
 * audit 2026-08-02). It existed because allauth's own {% element field %} and
 * {% element button %} emit no class attribute, so no Cadence component could
 * reach the ~25 account pages this project does not template-override; it
 * compensated with zero-specificity :where() rules re-implementing .field's
 * label and input treatment, plus a blanket
 * `:where(.auth-card) button:where([type="submit"])` fill.
 *
 * That blanket rule was the problem it was papering over. allauth's stock
 * account/password_reset_from_key.html emits TWO bare submits — "Change
 * Password" and a "Cancel" posting to a second form — so on the page every
 * password-reset email lands on, two OPPOSITE outcomes rendered as identical
 * full-width PK-orange CTAs. The old comment here recorded that pairing and
 * carried it deliberately.
 *
 * Both elements are now overridden once
 * (apps/portal/templates/allauth/elements/{button,field}.html), which puts
 * every account page — overridden or not — on the real component system and
 * maps allauth's own tags onto Cadence's four button tiers, so Cancel reads as
 * .btn-ghost. There is nothing left for a fallback layer to reach. */
