/* staff.css -- the staff sign-in design system, as ONE app-served stylesheet.
 *
 * Ported from the preserved export via the reviewed browser fixture at
 * docs/design/identity-login/preview/styles/. Values are COPIED, not
 * reinterpreted: the palette, the type scale, the square-edged geometry
 * (--aeg-radius: 0 everywhere), the stage ratios and every motion timing are
 * the export's own, from its README "Tokens used" and "Animation spec" tables.
 *
 * THREE THINGS THE FIXTURE LEFT BEHIND, WHICH BELONG HERE.
 * The preview split its CSS into tokens.css + product.css (the product surface)
 * and preview.css (harness chrome). Four rules that LOOK like harness chrome
 * are actually load-bearing product rules and lived in the wrong file:
 *
 *   1. `:focus-visible` -- the global focus ring. product.css only ever sets
 *      focus outline COLOUR (`.aeg-btn--primary:focus-visible`), so a port of
 *      product.css alone would have shipped a sign-in page with NO VISIBLE
 *      FOCUS INDICATOR at all: WCAG 2.4.7 and 2.4.11, on the one page where
 *      keyboard-only completion matters most. It is the first rule below.
 *   2. `box-sizing: border-box` -- without it every padded control overflows
 *      its track and the 320px reflow requirement fails.
 *   3. `[hidden] { display: none !important }` -- the layout classes set
 *      `display`, which otherwise beats the user-agent [hidden] rule.
 *   4. `.visually-hidden` / the skip link.
 *
 * NO INLINE STYLES ANYWHERE. Everything is served from this file under
 * `style-src 'self'`, so the page needs no `'unsafe-inline'` allowance. The
 * decorative mark cells are laid out by grid rather than by the fixture's
 * inline left/top, for exactly that reason.
 */

/* ========================================================================== */
/* Tokens -- transcribed from the export's "Tokens used" table                 */
/* ========================================================================== */

:root {
  /* Brand palette */
  --aeg-navy: #101c3a;
  --aeg-deep: #0b1226;
  --aeg-ink: #15192b;
  --aeg-coral: #ff5c39;
  --aeg-coral-hover: #ff7554;
  --aeg-coral-deep: #b33716;
  --aeg-coral-deepest: #7e2005;
  --aeg-slate: #4a5068;
  --aeg-mist: #aab4ce;
  --aeg-fog: #f5f6fa;
  --aeg-hairline: #e4e7f0;
  /* The export's field border. It is 1.61:1 on white, so it is a DECORATIVE
     hairline only -- see --aeg-control-border below. */
  --aeg-field-border: #c6ccdd;
  /* ADJUSTED, not imported. WCAG 2.2 AA 1.4.11 asks 3:1 of a "meaningful UI
     boundary", and a text input's border IS how a person finds the input --
     the design has no filled field background to identify it by. The export's
     #c6ccdd measures 1.61:1 on white, which fails, and nothing in the design
     handoff or the preview README ever measured it: the reviewed contrast
     figures cover TEXT and the focus ring only. Section 1 anticipates exactly
     this and authorises exactly this fix: "Measure contrast of controls/error/
     focus states and ADJUST SUPPORTING ACCESSIBILITY TOKENS as needed;
     importing the palette is not contrast evidence."
     #818eb4 is the LIGHTEST value on the export's own hue and saturation that
     clears 3:1 against BOTH surfaces a bordered control sits on -- white
     (3.25:1) and the fog of a checked choice row (3.01:1). Hue and saturation
     are the export's; only lightness moved, so the family is unchanged.
     `staff-accessibility.test.mjs` recomputes both ratios from this file. */
  --aeg-control-border: #818eb4;
  --aeg-white: #ffffff;
  --aeg-mark-white: #f2f4fa;

  /* Export inline values that behave as tokens */
  --aeg-muted: #6b7390;        /* 4.70:1 on white */
  --aeg-error-bg: #fff1ed;
  --aeg-error-field-border: #e0a08c;

  /* Focus. The export used one coral ring; coral on coral is invisible, so a
     control with a coral surface switches to the ink ring below. Measured:
     coral on white 3.06:1, coral on navy 5.48:1 -- both clear the 3:1 that
     WCAG 1.4.11 asks of a non-text indicator. */
  --aeg-focus: var(--aeg-coral);
  --aeg-focus-on-coral: var(--aeg-ink);
  --aeg-focus-width: 3px;
  --aeg-focus-offset: 2px;

  /* Type */
  --aeg-font-display: 'Familjen Grotesk', system-ui, sans-serif;
  --aeg-font-body: 'Public Sans', system-ui, sans-serif;
  --aeg-title-size: 30px;
  --aeg-title-line: 1.08;
  --aeg-title-tracking: -0.015em;
  --aeg-body-size: 15.5px;
  --aeg-small-size: 13.5px;
  --aeg-meta-size: 12px;
  --aeg-eyebrow-tracking: 0.1em;

  /* Spacing / geometry. Square-edged component language: no radii anywhere. */
  --aeg-radius: 0;
  --aeg-gap-xs: 6px;
  --aeg-gap-sm: 10px;
  --aeg-gap: 12px;
  --aeg-gap-md: 16px;
  --aeg-gap-lg: 22px;
  --aeg-gap-xl: 30px;
  --aeg-panel-pad: clamp(24px, 5vw, 62px);
  --aeg-form-width: 380px;

  /* Touch targets. §6 prefers 44x44 for principal controls. */
  --aeg-target-min: 44px;
  --aeg-control-height: 52px;
  --aeg-field-height: 50px;

  /* Mark stage. 5 * 54 + 4 * 12 = 318 -- the export's own 54px cell on a 66px
     pitch, stated as a grid track and a gutter so percentages hold at any
     rendered size. */
  --aeg-stage-size: 318px;
  --aeg-cell-track: 16.981132%;
  --aeg-cell-gap: 3.773585%;

  /* Motion (export README "Animation spec") */
  --aeg-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --aeg-ease-scan: cubic-bezier(0.4, 0, 0.2, 1);
  --aeg-ease-shake: cubic-bezier(0.36, 0.07, 0.19, 0.97);
  --aeg-dur-assemble: 420ms;
  --aeg-dur-scatter: 520ms;
  --aeg-dur-color: 300ms;
  --aeg-dur-underline: 260ms;
  --aeg-dur-scan: 500ms;
  --aeg-dur-shake: 420ms;
}

/* Reduced motion: every duration collapses. §1: "replace displacement, shake
   and particle motion with immediate equivalent states" -- the state still
   happens, it just arrives at once. Nothing's MEANING lives in the motion. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --aeg-dur-assemble: 1ms;
    --aeg-dur-scatter: 1ms;
    --aeg-dur-color: 1ms;
    --aeg-dur-underline: 1ms;
    --aeg-dur-scan: 1ms;
    --aeg-dur-shake: 1ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================== */
/* Globals (the four rules the fixture kept in its harness stylesheet)         */
/* ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--aeg-deep);
  color: var(--aeg-ink);
  font-family: var(--aeg-font-body);
  font-size: var(--aeg-body-size);
  -webkit-font-smoothing: antialiased;
}

/* THE focus indicator. Not a harness rule. */
:focus-visible {
  outline: var(--aeg-focus-width) solid var(--aeg-focus);
  outline-offset: var(--aeg-focus-offset);
}

a { color: var(--aeg-coral-deep); }
a:hover { color: var(--aeg-coral-deepest); }

::selection { background: var(--aeg-coral); color: var(--aeg-navy); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Visible on focus, and only then -- but with a real target size and the same
   ring as everything else when it is. */
.aeg-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 12px 16px;
  min-height: var(--aeg-target-min);
  background: var(--aeg-white);
  color: var(--aeg-ink);
  font-weight: 700;
}

.aeg-skip:focus { left: 0; }

/* ========================================================================== */
/* The split surface                                                          */
/* ========================================================================== */

.aeg-surface {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  background: var(--aeg-deep);
  color: var(--aeg-ink);
  min-height: 620px;
}

/* The form panel is FIRST in source order (so it is first for assistive
   technology and first at 320px) and SECOND visually at desktop widths, which
   is what the export shows. The decorative stage is aria-hidden, so this
   visual reorder changes nothing for a screen reader. */
.aeg-panel {
  order: 2;
  flex: 1 1 420px;
  background: var(--aeg-white);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--aeg-panel-pad);
  min-height: 360px;
}

.aeg-stage {
  order: 1;
  flex: 1 1 460px;
  position: relative;
  overflow: hidden;
  background: var(--aeg-navy);
  min-height: 440px;
  display: grid;
  place-items: center;
}

.aeg-stage[data-shake='a'] { animation: aeg-shake var(--aeg-dur-shake) var(--aeg-ease-shake); }
.aeg-stage[data-shake='b'] { animation: aeg-shake-b var(--aeg-dur-shake) var(--aeg-ease-shake); }

@keyframes aeg-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-9px); }
  38% { transform: translateX(8px); }
  58% { transform: translateX(-5px); }
  78% { transform: translateX(3px); }
}
@keyframes aeg-shake-b {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-9px); }
  38% { transform: translateX(8px); }
  58% { transform: translateX(-5px); }
  78% { transform: translateX(3px); }
}

/* The decorative canvas is scoped to the navy panel, holds nothing focusable
   and never sits over the form. §1. */
.aeg-field-host { position: absolute; inset: 0; z-index: 0; }
.aeg-field-host canvas { display: block; width: 100%; height: 100%; }

.aeg-stage__grid-wrap {
  position: relative;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.aeg-stage__grid {
  display: grid;
  grid-template-columns: repeat(5, var(--aeg-cell-track));
  grid-template-rows: repeat(5, var(--aeg-cell-track));
  gap: var(--aeg-cell-gap);
  width: min(var(--aeg-stage-size), 68vw, 68vh);
  aspect-ratio: 1;
}

.aeg-cell {
  /* An unfilled position: the export draws it as a faint inset ring, so the
     letter sits in a visible field rather than floating. */
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(170, 180, 206, 0.12);
  transition:
    opacity var(--aeg-dur-assemble) var(--aeg-ease-out),
    transform var(--aeg-dur-scatter) var(--aeg-ease-out),
    background var(--aeg-dur-color);
}

/* Server-rendered resting state: the letter is fully assembled. If the
   decorative module never loads, this is what a person sees -- the mark, whole,
   which is exactly what the static logo looks like. */
.aeg-cell--filled { background: var(--aeg-mark-white); box-shadow: none; }
.aeg-cell--filled[data-signal='true'] { background: var(--aeg-coral); }

/* The scan rule: a coral bar that follows the focused field. Decorative. */
.aeg-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--aeg-hairline);
  overflow: hidden;
}

.aeg-scan__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 34%;
  background: var(--aeg-coral);
  transform: translateX(var(--aeg-scan-x, -100%));
  transition: transform var(--aeg-dur-scan) var(--aeg-ease-scan);
}

/* The panel's children were bare siblings relying on their own margins, so at a
   tall viewport the OR divider landed on top of the next field's label. One
   flow gap here fixes the rhythm for every screen at once, and the elements
   below drop their own bottom margins so nothing double-spaces. */
.aeg-panel__inner {
  max-width: var(--aeg-form-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--aeg-gap-lg);
}

/* ========================================================================== */
/* Lockup, headings, text                                                     */
/* ========================================================================== */

.aeg-lockup {
  display: flex;
  align-items: center;
  gap: var(--aeg-gap-sm);
  margin-bottom: var(--aeg-gap-sm);
  flex-wrap: wrap;
}

.aeg-mark { display: block; flex: 0 0 auto; }

.aeg-lockup__word {
  font-family: var(--aeg-font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: var(--aeg-eyebrow-tracking);
}

.aeg-lockup__divider { width: 1px; height: 16px; background: var(--aeg-hairline); }

.aeg-lockup__org {
  font-size: var(--aeg-meta-size);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--aeg-slate);
}

.aeg-title {
  font-family: var(--aeg-font-display);
  font-weight: 700;
  font-size: var(--aeg-title-size);
  line-height: var(--aeg-title-line);
  letter-spacing: var(--aeg-title-tracking);
  margin: 0;
}

.aeg-lede { margin: calc(-1 * var(--aeg-gap)) 0 0; font-size: 14.5px; line-height: 1.5; color: var(--aeg-slate); }

.aeg-section-title {
  font-family: var(--aeg-font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 var(--aeg-gap-sm);
  color: var(--aeg-ink);
}

.aeg-form,
.aeg-stack { display: flex; flex-direction: column; gap: var(--aeg-gap); }
.aeg-stack--tight { gap: var(--aeg-gap-sm); }
.aeg-stack--loose { gap: var(--aeg-gap-lg); }

/* ========================================================================== */
/* Fields                                                                     */
/* ========================================================================== */

.aeg-field { display: flex; flex-direction: column; gap: var(--aeg-gap-xs); }

/* PERSISTENT and VISIBLE. There is no placeholder-as-label anywhere in this
   system, and no rule that could hide one. */
.aeg-label { font-size: var(--aeg-small-size); font-weight: 600; color: var(--aeg-ink); }

.aeg-input-wrap { position: relative; }

.aeg-input {
  width: 100%;
  font-family: var(--aeg-font-body);
  font-size: var(--aeg-body-size);
  padding: 14px;
  border: 1px solid var(--aeg-control-border);
  border-radius: var(--aeg-radius);
  background: var(--aeg-white);
  color: var(--aeg-ink);
  min-height: var(--aeg-field-height);
  transition: border-color 180ms;
}

.aeg-input::placeholder { color: var(--aeg-muted); opacity: 1; }
.aeg-input:hover { border-color: var(--aeg-slate); }
.aeg-input:focus { border-color: var(--aeg-ink); }
.aeg-input[aria-invalid='true'] { border-color: var(--aeg-error-field-border); }

.aeg-input--code {
  font-family: var(--aeg-font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.34em;
  text-indent: 0.17em;
  text-align: center;
  min-height: 58px;
}

.aeg-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--aeg-coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--aeg-dur-underline) var(--aeg-ease-out);
}

.aeg-input:focus ~ .aeg-underline { transform: scaleX(1); }

/* Decorative segmentation for the ONE code input. Never six focusable boxes. */
.aeg-code-marks { display: flex; gap: 10px; margin-top: var(--aeg-gap-sm); padding: 0 2px; }
.aeg-code-marks span { flex: 1 1 0; height: 3px; background: var(--aeg-hairline); }
.aeg-code-marks span[data-filled='true'] { background: var(--aeg-coral); }

.aeg-hint { font-size: var(--aeg-small-size); line-height: 1.45; color: var(--aeg-slate); margin: 0; }

.aeg-field-error {
  font-size: var(--aeg-small-size);
  font-weight: 600;
  color: var(--aeg-coral-deep);   /* 6.05:1 on white */
  margin: 0;
}

/* ========================================================================== */
/* Notices, the error summary and the live region                             */
/* ========================================================================== */

.aeg-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  background: var(--aeg-fog);
  border-left: 3px solid var(--aeg-coral);
  font-size: var(--aeg-small-size);
  line-height: 1.45;
  color: var(--aeg-ink);
}

/* The bar and the dot are decoration; every notice also carries its meaning in
   words, so nothing here is a colour-only distinction. */
.aeg-notice::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-top: 6px;
  flex: 0 0 auto;
  background: var(--aeg-coral);
}

.aeg-notice--error {
  background: var(--aeg-error-bg);
  border-left-color: var(--aeg-coral-deep);
  color: var(--aeg-coral-deepest);
  font-weight: 600;
}
.aeg-notice--error::before { background: var(--aeg-coral-deep); }
.aeg-notice--quiet { border-left-color: var(--aeg-slate); }
.aeg-notice--quiet::before { background: var(--aeg-slate); }

.aeg-status { display: block; }

/* Present and empty until it has something to say -- an announcement made into
   a region that appeared at the same moment is unreliable. */
.aeg-status:not(:empty) {
  padding: 11px 13px;
  background: var(--aeg-fog);
  border-left: 3px solid var(--aeg-slate);
  font-size: var(--aeg-small-size);
  line-height: 1.45;
}

.aeg-error-summary {
  padding: 13px 15px;
  background: var(--aeg-error-bg);
  border-left: 3px solid var(--aeg-coral-deep);
}

.aeg-error-summary h2 {
  margin: 0 0 var(--aeg-gap-xs);
  font-family: var(--aeg-font-display);
  font-size: 14.5px;
  color: var(--aeg-coral-deepest);
}

.aeg-error-summary ul { margin: 0; padding-left: 18px; }
.aeg-error-summary li { font-size: var(--aeg-small-size); }
.aeg-error-summary a { color: var(--aeg-coral-deep); }

/* ========================================================================== */
/* Buttons                                                                    */
/* ========================================================================== */

.aeg-btn {
  font-family: var(--aeg-font-display);
  font-weight: 700;
  font-size: 15.5px;
  padding: 15px 22px;
  border: 1px solid transparent;
  border-radius: var(--aeg-radius);
  min-height: var(--aeg-control-height);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  display: block;
  transition: background 160ms, border-color 160ms;
}

.aeg-btn--primary {
  background: var(--aeg-coral);
  color: var(--aeg-ink);          /* 5.67:1 */
  font-size: 16px;
  text-align: center;
  width: 100%;
}
.aeg-btn--primary:hover { background: var(--aeg-coral-hover); }
/* Coral on coral is invisible, so a coral surface takes the ink ring. */
.aeg-btn--primary:focus-visible { outline-color: var(--aeg-focus-on-coral); }

.aeg-btn--outline {
  background: var(--aeg-white);
  color: var(--aeg-ink);
  border-color: var(--aeg-control-border);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  width: 100%;
}
.aeg-btn--outline:hover { border-color: var(--aeg-ink); }

.aeg-btn--quiet {
  background: none;
  border: 0;
  /* Horizontal padding so a wrapped row of quiet actions has real separation
     without the column gap that made them read as four unrelated links. */
  padding: 10px 2px;
  min-height: var(--aeg-target-min);
  font-family: var(--aeg-font-body);
  font-size: var(--aeg-small-size);
  font-weight: 600;
  color: var(--aeg-coral-deep);
  text-align: left;
  width: auto;
}
.aeg-btn--quiet:hover { color: var(--aeg-coral-deepest); }
.aeg-btn--quiet-neutral { color: var(--aeg-slate); }   /* 7.96:1 */
.aeg-btn--quiet-neutral:hover { color: var(--aeg-ink); }

.aeg-provider-slot {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background: var(--aeg-fog);
  border: 1px dashed var(--aeg-mist);
}

.aeg-actions { display: flex; flex-wrap: wrap; gap: var(--aeg-gap-md); align-items: center; }
.aeg-actions--spread { justify-content: space-between; }

.aeg-divider { display: flex; align-items: center; gap: var(--aeg-gap); }
.aeg-divider::before,
.aeg-divider::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--aeg-hairline); }
.aeg-divider span {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: var(--aeg-eyebrow-tracking);
  color: var(--aeg-slate);
}

/* ========================================================================== */
/* Fieldsets, choices and the text-code disclosure                            */
/* ========================================================================== */

.aeg-fieldset { border: 0; margin: 0; padding: 0; }
.aeg-fieldset > legend,
.aeg-fieldset > .aeg-label {
  padding: 0;
  font-size: var(--aeg-small-size);
  font-weight: 600;
  color: var(--aeg-ink);
  margin-bottom: var(--aeg-gap-sm);
  display: block;
}

/* The text-code panel is a <details>, not a scripted disclosure: it works with
   scripting off, carries its own expanded state for assistive technology, and
   needs no aria-expanded bookkeeping. */
.aeg-disclosure > summary {
  list-style: none;
  cursor: pointer;
}
.aeg-disclosure > summary::-webkit-details-marker { display: none; }
.aeg-disclosure__body { margin-top: var(--aeg-gap-sm); }

.aeg-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--aeg-gap-sm);
  padding: 13px 14px;
  border: 1px solid var(--aeg-control-border);
  min-height: var(--aeg-target-min);
  cursor: pointer;
}
.aeg-choice:hover { border-color: var(--aeg-ink); }
.aeg-choice:has(input:checked) { border-color: var(--aeg-ink); background: var(--aeg-fog); }
.aeg-choice:has(input:focus-visible) {
  outline: var(--aeg-focus-width) solid var(--aeg-focus);
  outline-offset: var(--aeg-focus-offset);
}
.aeg-choice input {
  margin: 2px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--aeg-coral-deep);
  flex: 0 0 auto;
}
.aeg-choice__text { display: flex; flex-direction: column; gap: 2px; }
.aeg-choice__title { font-size: 14.5px; font-weight: 600; }
.aeg-choice__meta { font-size: 12.5px; color: var(--aeg-slate); }

/* ========================================================================== */
/* Rows (contacts, passkeys, sessions, the finder's organization list)        */
/* ========================================================================== */

.aeg-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--aeg-hairline); }
.aeg-rows:empty { display: none; }
.aeg-rows-empty {
  margin: 0;
  padding: 13px 0;
  border-top: 1px solid var(--aeg-hairline);
  border-bottom: 1px solid var(--aeg-hairline);
  font-size: var(--aeg-small-size);
  color: var(--aeg-slate);
}

.aeg-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aeg-gap-sm);
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--aeg-hairline);
}

.aeg-row__label { font-size: 14.5px; font-weight: 600; }
.aeg-row__meta { font-size: 12.5px; color: var(--aeg-slate); margin: 2px 0 0; }

/* A tag always carries its state in WORDS ("Verified", "Needs verification").
   The border colour is reinforcement, never the meaning. */
.aeg-tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--aeg-field-border);
  color: var(--aeg-slate);
}
.aeg-tag--verified { border-color: var(--aeg-slate); color: var(--aeg-ink); }
.aeg-tag--pending { border-color: var(--aeg-coral-deep); color: var(--aeg-coral-deep); }

.aeg-foot {
  padding: 14px var(--aeg-gap-md);
  background: var(--aeg-deep);
  color: var(--aeg-mist);
  font-size: var(--aeg-meta-size);
  text-align: center;
}

.aeg-admitted { display: none; }

/* ========================================================================== */
/* Responsive: the form is first and complete at 320px                        */
/* ========================================================================== */

@media (max-width: 860px) {
  .aeg-surface { min-height: 0; }
  /* The visual order now matches source order, so the form is on top. */
  .aeg-panel { order: 1; flex-basis: 100%; min-height: 0; padding: 24px 16px 32px; }
  .aeg-stage { order: 2; flex-basis: 100%; min-height: 220px; }
  .aeg-stage__grid { width: min(220px, 60vw); }
}

@media (max-width: 380px) {
  .aeg-panel { padding: 20px 12px 28px; }
  .aeg-title { font-size: 26px; }
  .aeg-actions { flex-direction: column; align-items: stretch; }
  .aeg-actions--spread { justify-content: flex-start; }
}

/* 400% zoom at 1280px lands at a 320px viewport, which the rules above already
   serve; this keeps the decorative stage from eating the screen when a person
   zooms a SHORT window, where a vh-based stage would otherwise dominate. */
@media (max-height: 520px) {
  .aeg-stage { min-height: 120px; }
  .aeg-stage__grid { width: min(140px, 40vw); }
}

/* D22: the temporary password, shown once on the onboarding page. Monospace so no glyph is
   ambiguous; selectable; wraps rather than overflowing at 320px. */
.aeg-code-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border: 1px solid currentColor;
  overflow-wrap: anywhere;
  user-select: all;
}
