/* Allauth auth-shell stylesheet — Mailbot vocabulary overlay.
 *
 * Loaded AFTER deck.css from auth_base.html so the cascade replaces the
 * Havre-flavoured tokens with the Mailbot palette + type + spacing for
 * every /accounts/* server-rendered page (login, signup, password reset,
 * MFA setup, etc.).
 *
 * Why a separate file? deck.css drives the entire /deck/ admin surface
 * (Havre product). Changing its tokens in place would re-skin every
 * platform-admin screen. Scoping the change to this file keeps the
 * blast radius to auth pages only.
 *
 * Variable names mirror products/paraphe/frontend/src/index.css so auth and
 * Mailbot SPA share one design vocabulary.
 */

/* ===== Mailbot design tokens (light, default) ============================ */
:root {
  /* Neutral palette */
  --color-surface:         #ffffff;
  --color-surface-muted:   #f7f7f5;
  --color-surface-raised:  #ffffff;
  --color-surface-sunken:  #f1f1ee;

  --color-text:         #1a1a18;
  --color-text-muted:   #6c6c67;
  --color-text-subtle:  #9a9a93;

  --color-border:         #e7e7e3;
  --color-border-strong:  #d6d6d1;

  --color-danger:       #9b3d34;
  --color-danger-bg:    #f7ece9;
  --color-danger-line:  #e7c9c3;
  --color-success:      #436a4d;
  --color-success-bg:   #edf1ed;
  --color-success-line: #cadccf;
  --color-warning:      #8a6921;
  --color-warning-bg:   #f6f0e3;
  --color-warning-line: #e6d8b9;
  --color-info:         #3c4b5a;
  --color-info-bg:      #eef0f2;
  --color-info-line:    #d2d8de;

  --color-primary:           #1a1a18;
  --color-primary-contrast:  #ffffff;
  --color-accent:            #1a1a18;

  /* Spacing — 4px base */
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 24px;
  --spacing-6: 32px;
  --spacing-7: 48px;

  /* Radii — sharp default, pill for chips */
  --radius-0:    0px;
  --radius-1:    2px;
  --radius-2:    4px;
  --radius-pill: 100px;

  /* Shadows — near-hairline */
  --shadow-raise: 0 1px 2px rgba(20, 18, 12, 0.05);
  --shadow-pop:
    0 2px 4px rgba(20, 18, 12, 0.06),
    0 8px 24px rgba(20, 18, 12, 0.1);

  /* Type */
  --font-sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --text-display: 28px;
  --text-display-lh: 1.12;
  --text-heading: 19px;
  --text-heading-lh: 1.2;
  --text-body: 13px;
  --text-body-lh: 1.5;
  --text-caption: 11px;
  --text-caption-lh: 1.45;
  --text-micro: 10px;
  --text-micro-lh: 1.2;

  /* ----- Bridge to deck.css legacy variable names -----
   *
   * deck.css consumes these names everywhere (--fg, --primary, --space-X,
   * --radius-md, etc.). Re-mapping them here means we don't have to rewrite
   * every rule that already references them — the cascade picks up the
   * Mailbot values via the legacy name.
   */
  --canvas:          var(--color-surface-muted);
  --surface:         var(--color-surface);
  --surface-sunken:  var(--color-surface-sunken);
  --surface-raised:  var(--color-surface-raised);
  --overlay:         rgba(20, 18, 12, 0.48);

  --text:        var(--color-text);
  --fg:          var(--color-text);
  --muted:       var(--color-text-muted);
  --fg-muted:    var(--color-text-muted);
  --fg-subtle:   var(--color-text-subtle);
  --fg-on-primary: var(--color-primary-contrast);
  --fg-on-accent:  var(--color-primary-contrast);

  --border:         var(--color-border);
  --border-strong:  var(--color-border-strong);
  --border-subtle:  var(--color-border);

  --primary:        var(--color-primary);
  --primary-hover:  var(--color-text);
  --primary-soft:   var(--color-surface-muted);

  --accent:         var(--color-accent);
  --accent-hover:   var(--color-text);
  --accent-soft:    var(--color-surface-muted);

  --success:        var(--color-success);
  --success-soft:   var(--color-success-bg);
  --warning:        var(--color-warning);
  --warning-soft:   var(--color-warning-bg);
  --danger:         var(--color-danger);
  --danger-soft:    var(--color-danger-bg);
  --info:           var(--color-info);
  --info-soft:      var(--color-info-bg);

  --focus-ring: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-text);

  --ff-sans: var(--font-sans);
  --ff-mono: var(--font-mono);

  --text-2xs:  var(--text-micro);
  --text-xs:   var(--text-caption);
  --text-sm:   var(--text-body);
  --text-base: var(--text-body);
  --text-md:   var(--text-heading);
  --text-lg:   var(--text-heading);
  --text-xl:   var(--text-display);
  --text-2xl:  var(--text-display);

  --space-0:  0;
  --space-1:  var(--spacing-1);
  --space-2:  var(--spacing-2);
  --space-3:  var(--spacing-3);
  --space-4:  var(--spacing-4);
  --space-5:  var(--spacing-5);
  --space-6:  var(--spacing-6);
  --space-8:  var(--spacing-6);
  --space-10: var(--spacing-7);
  --space-12: var(--spacing-7);
  --space-16: 64px;

  --radius-xs:   var(--radius-1);
  --radius-sm:   var(--radius-1);
  --radius-md:   var(--radius-1);
  --radius-lg:   var(--radius-1);
  --radius:      var(--radius-1);

  --shadow-xs:    var(--shadow-raise);
  --shadow-sm:    var(--shadow-raise);
  --shadow-md:    var(--shadow-raise);
  --shadow-lg:    var(--shadow-pop);
  --shadow-inset: inset 0 1px 0 rgba(20, 18, 12, 0.04);
}

/* ===== Dark theme — the OS's call, and nothing else ====================== */
/* No stored preference, no toggle, no ``data-theme`` attribute: this surface
 * has no chrome to hang a control on, so the media query IS the mechanism.
 * It also means the shell ships no theme script and cannot flash. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-surface:         #161614;
    --color-surface-muted:   #1b1b18;
    --color-surface-raised:  #201f1c;
    --color-surface-sunken:  #121210;

    --color-text:         #ececea;
    --color-text-muted:   #9b9a93;
    --color-text-subtle:  #6a6a63;

    --color-border:         #2a2a26;
    --color-border-strong:  #38382f;

    --color-danger:       #cf8076;
    --color-danger-bg:    #2a1c19;
    --color-danger-line:  #4a2d27;
    --color-success:      #84ac8e;
    --color-success-bg:   #18211a;
    --color-success-line: #2c3b2f;
    --color-warning:      #c6a35e;
    --color-warning-bg:   #241f12;
    --color-warning-line: #3d341d;
    --color-info:         #9fb2c4;
    --color-info-bg:      #181d22;
    --color-info-line:    #2c333b;

    --color-primary:           #ececea;
    --color-primary-contrast:  #161614;
    --color-accent:            #ececea;

    --shadow-raise: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-pop:
      0 2px 4px rgba(0, 0, 0, 0.4),
      0 10px 30px rgba(0, 0, 0, 0.5);
  }
}
/* ===== Body baseline — French-first leading, tabular mono ================ */
body.app.is-auth {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
  color: var(--color-text);
  background: var(--color-surface-muted);
}

body.app.is-auth code,
body.app.is-auth kbd,
body.app.is-auth samp,
body.app.is-auth pre,
body.app.is-auth .form-readonly,
body.app.is-auth .mfa-totp-secret,
body.app.is-auth .recovery-codes {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ===== Auth card — centred, near-hairline, generous padding ============= */
.is-auth .auth-card {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--spacing-6) var(--spacing-6);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-raise);
}
/* Dutch and German build unbreakable compounds — "Tweefactorauthenticatie" is
 * one 23-character word, and at ``--text-display`` it is wider than the card on
 * a phone. Hyphenate rather than shrink the type or widen the card, and let
 * anything that still can't fit break mid-word instead of escaping the card.
 * The hyphen dictionary is picked from <html lang>, which is why that attribute
 * has to be the negotiated locale and not a literal. */
.is-auth .auth-card {
  overflow-wrap: break-word;
  hyphens: auto;
}

.is-auth .auth-card.is-wide { max-width: 560px; }
/* One step wider again, for the two pages whose content is a grid rather than a
 * form: the WebAuthn key table and the recovery-code list. */
.is-auth .auth-card.is-wider { max-width: 720px; }

/* Group heading inside a card — the MFA overview and the email page each show
 * several labelled groups that used to be separate /deck/ cards. */
.is-auth .auth-card h2 {
  margin: 0 0 var(--spacing-2);
  font-family: var(--font-sans);
  font-size: var(--text-heading);
  line-height: var(--text-heading-lh);
  font-weight: 650;
  color: var(--color-text);
}

/* Divider between those stacked groups. */
.is-auth .auth-card-section {
  margin-top: var(--spacing-5);
  padding-top: var(--spacing-4);
  border-top: 1px solid var(--color-border);
}

.is-auth .auth-card h1 {
  margin: 0 0 var(--spacing-2);
  font-family: var(--font-sans);
  font-size: var(--text-display);
  line-height: var(--text-display-lh);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--color-text);
}

.is-auth .auth-card .form-help {
  margin: 0 0 var(--spacing-4);
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

.is-auth .auth-card-footer {
  margin-top: var(--spacing-5);
  padding-top: var(--spacing-4);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--color-text-subtle);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.is-auth .auth-card-aside {
  margin: var(--spacing-5) 0 0;
  padding-top: var(--spacing-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}
.is-auth .auth-card-aside a {
  color: var(--color-text);
  font-weight: 600;
}

.is-auth .auth-card .info-block {
  padding: var(--spacing-3) var(--spacing-4);
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-line);
  border-radius: var(--radius-1);
  color: var(--color-info);
  font-size: var(--text-body);
}

/* ===== Forms — Frow-style label width pattern ============================ */
.is-auth .form { display: grid; gap: var(--spacing-4); }

.is-auth .form-field { display: grid; gap: var(--spacing-1); }

/* Single-column on narrow widths; two-column "label : input" pattern
 * mirroring the Mailbot Frow once the card is wide enough.            */
@media (min-width: 540px) {
  .is-auth .auth-card.is-wide .form-field {
    grid-template-columns: 180px 1fr;
    align-items: start;
    gap: var(--spacing-2) var(--spacing-4);
  }
  .is-auth .auth-card.is-wide .form-field label { padding-top: 8px; }
  .is-auth .auth-card.is-wide .form-field .form-help,
  .is-auth .auth-card.is-wide .form-field .form-field-errors {
    grid-column: 2;
  }
}

.is-auth .form-field label {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--color-text);
}

.is-auth .form-field input,
.is-auth .form-field select,
.is-auth .form-field textarea {
  height: 36px;
  padding: 0 var(--spacing-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-1);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-body);
  line-height: var(--text-body-lh);
}
.is-auth .form-field textarea {
  height: auto;
  min-height: 80px;
  padding: var(--spacing-2) var(--spacing-3);
}
.is-auth .form-field input::placeholder,
.is-auth .form-field textarea::placeholder {
  color: var(--color-text-subtle);
}
.is-auth .form-field input:focus,
.is-auth .form-field select:focus,
.is-auth .form-field textarea:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-text);
}
.is-auth .form-field input[aria-invalid="true"],
.is-auth .form-field select[aria-invalid="true"],
.is-auth .form-field textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.is-auth .form-help {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

.is-auth .form-field-errors {
  color: var(--color-danger);
  font-size: var(--text-caption);
}
.is-auth .form-field-errors:empty { display: none; }
.is-auth .form-field-errors ul {
  margin: 0;
  padding-left: var(--spacing-4);
}

.is-auth .form-error-summary {
  padding: var(--spacing-2) var(--spacing-3);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-line);
  border-radius: var(--radius-1);
  color: var(--color-danger);
  font-size: var(--text-caption);
}
.is-auth .form-error-summary:empty { display: none; }

/* Flash / inline messages (allauth ``messages`` framework). */
.is-auth .form-messages {
  display: grid;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-4);
}
.is-auth .form-message {
  padding: var(--spacing-2) var(--spacing-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  background: var(--color-surface-muted);
  color: var(--color-text);
  font-size: var(--text-caption);
}
.is-auth .form-message--error,
.is-auth .form-message--danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-line);
  color: var(--color-danger);
}
.is-auth .form-message--success {
  background: var(--color-success-bg);
  border-color: var(--color-success-line);
  color: var(--color-success);
}
.is-auth .form-message--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-line);
  color: var(--color-warning);
}
.is-auth .form-message--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-line);
  color: var(--color-info);
}

/* The row itself must NOT wrap. Under ``space-between`` a wrapped row puts the
 * lone left-hand escape action ("Cancel", "Forgot your password?") on a line of
 * its own, left-aligned above the real buttons, where it reads as leftover text
 * rather than a choice — which is what the mid-login steps showed in French
 * (OCT-766). ``.btn`` is ``white-space: nowrap``, so the width a long
 * translation needs has to come from somewhere: the card, via ``is-wide`` on
 * the one screen with three actions (OCT-671 reached for wrapping instead).
 * ``.form-actions-end`` still wraps as a last resort, and ``flex-start`` keeps
 * the escape action level with the first button if it ever does. */
.is-auth .form-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-3);
  margin-top: var(--spacing-4);
  padding: 0;
  background: transparent;
  position: static;
}
/* No ``min-width: 0``: the group has to keep its widest button as a floor, or
 * shrinking pushes that nowrap button back out past the card edge. */
.is-auth .form-actions-end {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--spacing-2);
}

/* Narrower than the card: wrapping still leaves a single long label hanging
 * over the edge, so the actions stack full-width instead. */
@media (max-width: 460px) {
  .is-auth .form-actions,
  .is-auth .form-actions-end {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }
  .is-auth .form-actions .btn { width: 100%; }
}

/* ===== Password requirements (OCT-674) =================================== */
/* Compact enough to sit between the two password fields without pushing them
 * apart — which is what the validators' own four-sentence <ul> did. */
.is-auth .pw-requirements {
  margin-top: var(--spacing-1);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}

.is-auth .pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-1) var(--spacing-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.is-auth .pw-rule {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
}

/* Drawn in CSS rather than pulled from the icon sprite: the sprite only ships
 * on account pages, and two of the four screens that render this checklist
 * (signup, reset-from-key) are entrance pages. */
.is-auth .pw-rule-icon {
  position: relative;
  flex: none;
  width: 13px;
  height: 13px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  transition: background 120ms ease, border-color 120ms ease;
}
.is-auth .pw-rule.is-met .pw-rule-icon {
  background: var(--color-success);
  border-color: var(--color-success);
}
.is-auth .pw-rule.is-met .pw-rule-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 6px;
  border: solid var(--color-surface);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.is-auth .pw-rule.is-met { color: var(--color-text); }

.is-auth .pw-rules-note {
  margin: var(--spacing-2) 0 0;
  color: var(--color-text-subtle);
}

/* ===== Buttons — neutral, primary, ghost, danger ========================= */
.is-auth .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: 0 var(--spacing-4);
  height: 36px;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 600;
  border-radius: var(--radius-1);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.is-auth .btn:hover { text-decoration: none; }
.is-auth .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-text);
}
.is-auth .btn:disabled,
.is-auth .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.is-auth .btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-color: var(--color-primary);
}
.is-auth .btn-primary:hover {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  opacity: 0.9;
}
.is-auth .btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.is-auth .btn-secondary:hover { background: var(--color-surface-muted); }
.is-auth .btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.is-auth .btn-ghost:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}
.is-auth .btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-line);
}
.is-auth .btn-danger:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
}

/* ===== SSO buttons — neutral by default, provider dot for colour ========= */
.is-auth .auth-sso-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  margin-bottom: var(--spacing-4);
}
.is-auth .auth-sso-section > form { margin: 0; }

.is-auth .auth-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  width: 100%;
  height: 40px;
  padding: 0 var(--spacing-4) 0 calc(var(--spacing-4) + var(--spacing-3));
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 600;
  border-radius: var(--radius-1);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.is-auth .auth-button:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

/* Provider colour goes on a small dot, never the whole button. Keeps the
 * surface neutral. ::before sits left of the label. */
.is-auth .auth-button::before {
  content: "";
  position: absolute;
  left: var(--spacing-4);
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-border-strong);
}
.is-auth .auth-button--sso {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-color: var(--color-primary);
}
.is-auth .auth-button--sso:hover {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  border-color: var(--color-primary);
  opacity: 0.9;
}
.is-auth .auth-button--sso::before { background: var(--color-primary-contrast); }
.is-auth .auth-button--google {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.is-auth .auth-button--google::before { background: #ea4335; }
.is-auth .auth-button--microsoft {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.is-auth .auth-button--microsoft:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.is-auth .auth-button--microsoft::before { background: #0078d4; }
.is-auth .auth-button--apple {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.is-auth .auth-button--apple:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.is-auth .auth-button--apple::before { background: var(--color-text); }

.is-auth .auth-divider {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  margin: var(--spacing-2) 0;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.is-auth .auth-divider::before,
.is-auth .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.is-auth.app .app-main {
  /* ``safe center`` so a card taller than the viewport (recovery codes, the
   * WebAuthn list) scrolls from its top edge instead of being clipped at both. */
  min-height: 100vh;
  align-content: center;
  align-content: safe center;
  background: var(--color-surface-muted);
}
.is-auth.app .app-content {
  width: 100%;
  max-width: none;
}

/* ===== Misc auth bits ==================================================== */
.is-auth .muted        { color: var(--color-text-muted); }
.is-auth .subtle       { color: var(--color-text-subtle); }

.is-auth .empty-state {
  padding: var(--spacing-6) var(--spacing-5);
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  color: var(--color-text-muted);
}
.is-auth .empty-state h2 {
  margin: 0 0 var(--spacing-2);
  font-size: var(--text-heading);
  color: var(--color-text);
}
.is-auth .empty-state p {
  margin: 0 0 var(--spacing-3);
  font-size: var(--text-body);
}

.is-auth .tag {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  padding: 2px var(--spacing-2);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

.is-auth .email-list {
  list-style: none;
  margin: 0 0 var(--spacing-4);
  padding: 0;
  display: grid;
  gap: var(--spacing-2);
}
.is-auth .email-list li {
  display: grid;
  /* ``minmax(0, …)``, not a bare ``1fr``: a grid track's automatic minimum is
   * min-content, so a long address plus its two tags made the row — and with
   * it the card — wider than a phone instead of wrapping. */
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}
.is-auth .email-list .email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-2);
  min-width: 0;
}
/* An address has no spaces to break at, so it needs explicit permission. */
.is-auth .email-list .email-row > span { overflow-wrap: anywhere; }
.is-auth .email-list .email-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--spacing-1);
}
.is-auth .email-list .email-tags .tag.is-primary {
  background: var(--color-success-bg);
  border-color: var(--color-success-line);
  color: var(--color-success);
}
.is-auth .email-list .email-tags .tag.is-unverified {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-line);
  color: var(--color-warning);
}

.is-auth .mfa-totp-setup {
  display: grid;
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-4);
}
.is-auth .mfa-totp-qr {
  display: flex;
  justify-content: center;
  padding: var(--spacing-4);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}
.is-auth .mfa-totp-qr img { max-width: 200px; height: auto; }
.is-auth .mfa-totp-secret {
  display: block;
  padding: var(--spacing-3);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  font-family: var(--font-mono);
  font-size: var(--text-body);
  text-align: center;
  word-break: break-all;
}

.is-auth .recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-2);
  margin: var(--spacing-3) 0 var(--spacing-4);
  padding: var(--spacing-4);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  font-family: var(--font-mono);
  font-size: var(--text-body);
  list-style: none;
}
.is-auth .recovery-codes li {
  padding: var(--spacing-1) var(--spacing-2);
  background: var(--color-surface);
  border-radius: var(--radius-1);
  text-align: center;
}

/* Reduced-motion killswitch — strips animation + transitions. */
@media (prefers-reduced-motion: reduce) {
  .is-auth *,
  .is-auth *::before,
  .is-auth *::after {
    animation: none !important;
    transition: none !important;
  }
}
