/* ===========================================================================
   Signed-out screens (ui-v2): sign-in, 2FA verify, 2FA setup, forgot password,
   reset / set password. Loaded after css/ui/foundation.css + page-frame.css;
   every rule here is the au- shell the shared system has no part for.

   Layout: a brand-teal pane (white logo, headline) beside the form on wide
   screens; on phones the whole screen is teal with the form in a white card.

   The page scripts are the login flow and are not touched by the redesign, so
   this sheet also styles what they write into the page: .alert / .spinner /
   .btn-spinner, .setup-step.active, .method-card.selected, li.valid.
   =========================================================================== */

/* Always light (js/auth/auth.js drops a saved dark theme on these screens). */
.au-page { color-scheme: light; min-height: 100vh; display: grid; grid-template-columns: minmax(25rem, 0.92fr) minmax(0, 1.08fr); background: var(--background); }
.au-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Brand pane --------------------------------------------------------- */
.au-brand {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; gap: 2rem; padding: 2.25rem 3rem 2rem; color: #fff;
    /* Brand teal (the accent), lifted at the top and deepened at the foot. */
    background: linear-gradient(160deg,
        color-mix(in srgb, hsl(var(--accent-component)) 82%, #fff) 0%,
        hsl(var(--accent-component)) 45%,
        color-mix(in srgb, hsl(var(--accent-component)) 74%, #0f172a) 100%);
}
.au-brand::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(55% 42% at 88% 6%, rgb(255 255 255 / 0.2), transparent 70%),
        radial-gradient(48% 38% at 0% 100%, rgb(255 255 255 / 0.1), transparent 70%);
}
.au-brand::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(75% 65% at 70% 30%, #000, transparent);
            mask-image: radial-gradient(75% 65% at 70% 30%, #000, transparent);
}
.au-wordmark { --au-logo-h: 3.4rem; display: inline-flex; align-self: flex-start; }
/* The PNG carries transparent padding (8% left, 11% top, 18% bottom of its
   height-scaled box): pull it back so the visible logo sits on the text edge. */
.au-wordmark img {
    display: block; width: auto; height: var(--au-logo-h);
    margin: calc(var(--au-logo-h) * -0.11) 0 calc(var(--au-logo-h) * -0.18) calc(var(--au-logo-h) * -0.294);
}
/* The logo's own teal (mark and "AI") is the pane's colour, so on the pane it
   goes one-colour white: the usual treatment for a logo on its brand colour. */
.au-brand-logo img { filter: brightness(0) invert(1); }
.au-brand-body { margin: auto 0; max-width: 33rem; animation: au-rise 0.6s var(--cui-ease) both; }
.au-eyebrow { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: rgb(255 255 255 / 0.12); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18); }
.au-eyebrow svg { width: 0.85rem; height: 0.85rem; }
.au-live { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: hsl(var(--cui-positive)); box-shadow: 0 0 0 3px rgb(255 255 255 / 0.16); }
.au-page .au-headline { margin: 1.1rem 0 0.9rem; font-size: clamp(2rem, 3.1vw, 2.9rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
/* The sign-in headline's clause (#auth-type, driven by signin.html): held
   still on wide screens, so the caret only shows on phones. */
.auth-type { color: color-mix(in srgb, hsl(var(--accent-component)) 18%, #fff); }
.auth-type-caret { display: none; width: 3px; height: 0.88em; margin-left: 3px; vertical-align: -0.06em; border-radius: 2px; background: currentColor; animation: au-blink 1.05s steps(1) infinite; }
.auth-type.is-typing .auth-type-caret { animation: none; }
.au-page .au-lede { margin: 0 0 1.75rem; font-size: 1.05rem; line-height: 1.55; color: rgb(255 255 255 / 0.82); }
.au-brand-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem; }

/* Sign-in particle stage (js/auth/brand-particles.js): the copy sits at the
   top and the stage takes the rest of the pane. Wide screens only; scoped so
   it can't outrank the phone layout below. */
@media (min-width: 1024px) {
    .au-brand.has-particles { gap: 1.5rem; }
    .au-brand.has-particles .au-brand-body { margin: 0; }
    .au-page .au-brand.has-particles .au-lede { margin: 0; }
    /* The stage and its caption are centred, so the store badges under them are too. */
    .au-brand.has-particles .au-brand-foot { justify-content: center; align-items: center; }
}
.au-particles { flex: 1; min-height: 18rem; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.5rem; animation: au-rise 0.7s 0.1s var(--cui-ease) both; }
.au-particles-canvas { width: 100%; height: 100%; min-height: 0; cursor: crosshair; touch-action: none; }
.au-particles-caption { display: grid; justify-items: center; gap: 0.2rem; text-align: center; transition: opacity 0.45s var(--cui-ease), transform 0.45s var(--cui-ease); }
/* Safari only (Monday #13570433360): the check matches WebKit alone, so Chrome,
   Edge and Firefox keep the rules above unchanged. In flow, Safari sized the
   stage's first row from the canvas's natural height (its pixel buffer,
   devicePixelRatio times its CSS height), and js/auth/particle-stage.js then
   grew the buffer to the new height: on a Retina Mac the pane doubled on every
   resize and pushed the sign-in form down the page without end. Out of flow,
   filling the first row, the canvas can no longer size the stage. The same
   check gates the engine's guard in particle-stage.js. */
@supports (font: -apple-system-body) and (-webkit-appearance: none) {
    .au-particles { position: relative; }
    .au-particles-canvas { position: absolute; grid-row: 1 / 2; grid-column: 1 / -1; inset: 0; }
    .au-particles-caption { grid-row: 2; }
}
.au-particles-caption.is-out { opacity: 0; transform: translateY(6px); }
.au-particles-title { font-size: 1.15rem; font-weight: 750; letter-spacing: -0.015em; }
.au-particles-sub { font-size: 0.8929rem; color: rgb(255 255 255 / 0.75); }
.au-particles-dots { display: flex; gap: 0.35rem; margin-bottom: 0.45rem; }
.au-particles-dots i { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: rgb(255 255 255 / 0.35); transition: width 0.4s var(--cui-ease), background 0.4s; }
.au-particles-dots i.is-on { width: 1.3rem; background: #fff; }
.au-page .app-store-links { justify-content: flex-start; }

/* ---- Form pane ---------------------------------------------------------- */
.au-main { position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; padding: 1.5rem 2rem 1.25rem; background: radial-gradient(60% 45% at 100% 0%, hsl(var(--accent-component) / 0.07), transparent 70%), var(--background); }
.au-center { flex: 1; display: grid; place-items: center; padding: 2rem 0; }
.au-form { width: min(25.5rem, 100%); animation: au-rise 0.5s var(--cui-ease) both; }
.au-form.is-wide { width: min(31rem, 100%); }
.au-only-narrow { display: none; }

/* Help and legal: small, quiet links under the store badges (brand pane on wide
   screens, under the card on phones), a dot between each. Always on teal. */
.au-legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.4rem; margin-inline: -0.3rem; font-size: 0.75rem; line-height: 1.4; }
.au-legal-links a { position: relative; padding: 0.15rem 0.3rem; border-radius: 0.35rem; font-weight: 500; color: rgb(255 255 255 / 0.7); text-decoration: none; transition: color 0.2s, background-color 0.2s; }
.au-legal-links a:hover, .au-legal-links a:focus-visible { color: #fff; background: rgb(255 255 255 / 0.12); }
.au-legal-links a + a::before { content: ""; position: absolute; left: calc(-0.2rem - 1px); top: 50%; width: 2px; height: 2px; margin-top: -1px; border-radius: 50%; background: rgb(255 255 255 / 0.5); pointer-events: none; }

/* Back: a quiet pill with the arrow in its own disc. */
.au-back {
    display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: 1.75rem; padding: 0.3rem 0.95rem 0.3rem 0.3rem;
    font-size: 0.8571rem; font-weight: 600; color: var(--foreground); text-decoration: none;
    background: var(--card); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--cui-shadow-xs);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.au-back:hover { color: var(--foreground); border-color: hsl(var(--accent-component) / 0.4); box-shadow: 0 0 0 3px hsl(var(--accent-component) / 0.08); }
.au-back:focus-visible { outline: 2px solid hsl(var(--accent-component)); outline-offset: 2px; }
.au-back svg { width: 0.85rem; height: 0.85rem; }
.au-back-ico { width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; color: hsl(var(--accent-component)); background: hsl(var(--accent-component) / 0.1); transition: background 0.15s, color 0.15s; }
.au-back:hover .au-back-ico { background: hsl(var(--accent-component)); color: var(--cui-on-accent); }

/* Heading: icon (or the CHIIRP mark on sign-in) on the title's line. */
.au-head { margin-bottom: 1.6rem; }
.au-head-row { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.6rem; }
.au-head.is-center { text-align: center; }
.au-head.is-center .au-head-row { justify-content: center; }
.au-page .au-title { margin: 0; font-size: 1.85rem; line-height: 1.2; font-weight: 750; letter-spacing: -0.025em; }
.au-mark { display: inline-flex; flex: none; color: hsl(var(--accent-component)); }
.au-mark svg { width: 2.6rem; height: 2.6rem; }
/* Subtext under the title: a touch larger, softer ink, balanced line breaks. */
.au-page .au-desc { margin: 0; font-size: 1rem; line-height: 1.55; letter-spacing: -0.003em; color: color-mix(in srgb, var(--muted-foreground) 88%, var(--foreground)); text-wrap: pretty; }
.au-head.is-center .au-desc { max-width: 34ch; margin-inline: auto; text-wrap: balance; }
.au-desc strong { color: var(--foreground); font-weight: 650; }

/* Fields */
.au-fields { display: grid; gap: 1.05rem; }
.au-page .au-form .cui-field { margin-bottom: 0; }
.au-page .au-form .cui-input { height: 3rem; font-size: 1rem; border-radius: 0.75rem; background: var(--card); box-shadow: 0 1px 2px rgb(15 23 42 / 0.04); }
.au-page .au-form .cui-field-label { font-size: 0.8571rem; }
.au-page .au-field-link { margin-left: auto; font-size: 0.8571rem; }
.au-page .au-input-peek { padding-right: 2.75rem; }
.au-peek { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.au-page .au-submit { width: 100%; height: 3rem; margin-top: 0.4rem; font-size: 1rem; border-radius: 0.75rem; }

/* Sign-in, email first (wide screens; js/auth/auth.js): the arrow sits in the
   email field until the password step opens, then the step slides down. The
   page is served open, so without the script it is a plain two-field form. */
.au-signin { display: grid; }
.au-page .au-input-next { padding-right: 3.1rem; }
/* Same inset on the right as top and bottom: (field height - button) / 2. */
.au-next { position: absolute; right: calc((3rem - 2.15rem) / 2); top: 50%; transform: translateY(-50%); transition: opacity 0.2s; }
/* Outranks .cui-btn-icon's width so the circle stays a circle. */
.au-page .cui-input-wrap .au-next { width: 2.15rem; height: 2.15rem; aspect-ratio: 1; border-radius: 50%; padding: 0; }
.au-page .au-next svg { width: 1rem; height: 1rem; }
.au-step-pw { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.4s var(--cui-ease), opacity 0.3s ease; }
.au-step-inner { min-height: 0; overflow: hidden; display: grid; gap: 1.05rem; padding: 0 3px 3px; margin: 0 -3px -3px; }
.au-step-inner > :first-child { margin-top: 1.05rem; }
[data-au-step="password"] .au-step-pw { grid-template-rows: 1fr; opacity: 1; }
/* overflow:hidden is only for the slide; once open, let the button's shadow
   show (clipped, it reads as a hard-edged box under the button). */
.au-step-pw.is-open .au-step-inner { overflow: visible; }
[data-au-step="password"] .au-next { opacity: 0; pointer-events: none; }

/* "Keep me signed in": a drawn checkbox (rounded square, accent fill and white
   tick when on) so it matches the fields instead of the browser's default box. */
.au-page .au-row .cui-check { align-items: center; gap: 0.6rem; padding: 0.15rem 0; margin: 0; font-size: 0.9286rem; font-weight: 500; color: var(--foreground); user-select: none; }
.au-page .au-row .cui-check:hover { background: none; }
.au-page .au-row .cui-check input {
    appearance: none; -webkit-appearance: none; display: grid; place-items: center;
    width: 1.2rem; height: 1.2rem; margin: 0; flex: none; cursor: pointer;
    background: var(--card); border: 1.5px solid color-mix(in srgb, var(--border) 60%, var(--muted-foreground));
    border-radius: 0.375rem; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.au-page .au-row .cui-check input::after {
    content: ""; width: 0.7rem; height: 0.7rem; background: var(--cui-on-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: scale(0); transition: transform 0.18s var(--cui-ease);
}
.au-page .au-row .cui-check:hover input { border-color: hsl(var(--accent-component) / 0.7); }
.au-page .au-row .cui-check input:checked { background: hsl(var(--accent-component)); border-color: hsl(var(--accent-component)); }
.au-page .au-row .cui-check input:checked::after { transform: scale(1); }
.au-page .au-row .cui-check input:focus-visible { box-shadow: 0 0 0 3px hsl(var(--accent-component) / 0.2); border-color: hsl(var(--accent-component)); outline: none; }

/* Links and the footer line ("Don't have an account? Contact Sales"): set off
   by a hairline that fades at both ends, with the action as a soft accent pill. */
.au-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: hsl(var(--accent-component)); text-decoration: none; cursor: pointer; transition: color 0.15s, background 0.15s; }
.au-link:hover { color: color-mix(in srgb, hsl(var(--accent-component)) 75%, var(--foreground)); }
.au-page .au-alt {
    position: relative; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.25rem 0.5rem;
    margin: 1.6rem 0 0; padding-top: 1.35rem; text-align: center; font-size: 0.9286rem; color: var(--muted-foreground);
}
.au-page .au-alt::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--border) 18%, var(--border) 82%, transparent); }
.au-page .au-alt .au-link { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem; border-radius: 999px; background: hsl(var(--accent-component) / 0.08); }
.au-page .au-alt .au-link:hover { background: hsl(var(--accent-component) / 0.15); }
.au-page .au-alt .au-link:focus-visible { outline: 2px solid hsl(var(--accent-component)); outline-offset: 2px; }
/* Opens the mail app: a small ↗ says it leaves the page. */
.au-page .au-alt a[href^="mailto:"]::after {
    content: ""; width: 0.8rem; height: 0.8rem; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10M7 17 17 7'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10M7 17 17 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.au-page .cui-callout { margin-bottom: 1.1rem; }

/* What the page scripts write: alerts into #alert-container, spinners into
   buttons while a request runs. */
.au-page .alert { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 1.1rem; padding: 0.75rem 0.9rem; font-size: 0.9286rem; line-height: 1.45; border: 1px solid; border-radius: var(--cui-r-md); }
.au-page .alert svg { width: 1.05rem; height: 1.05rem; flex: none; margin-top: 0.1rem; }
.au-page .alert-error { color: color-mix(in srgb, hsl(var(--destructive-component)) 75%, var(--foreground)); border-color: hsl(var(--destructive-component) / 0.3); background: hsl(var(--destructive-component) / 0.06); }
.au-page .alert-success { color: color-mix(in srgb, hsl(var(--cui-positive)) 75%, var(--foreground)); border-color: hsl(var(--cui-positive) / 0.3); background: hsl(var(--cui-positive) / 0.07); }
.au-page .spinner, .au-page .btn-spinner { display: inline-block; flex: none; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: au-spin 0.75s linear infinite; }
.au-page .btn-spinner { margin-right: 0.45rem; vertical-align: -0.15em; }

/* ---- 2FA verify ----------------------------------------------------------- */
/* Six boxes, 3 + 3. The ids, classes and handlers are 2fa.html's. */
.au-otp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 0.7rem repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: center; }
.au-otp-sep { height: 2px; border-radius: 2px; background: var(--border); }
.au-otp input {
    width: 100%; height: 3.5rem; padding: 0; text-align: center; outline: none;
    font: inherit; font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums;
    color: var(--foreground); caret-color: hsl(var(--accent-component));
    background: var(--card); border: 1px solid var(--border); border-radius: var(--cui-r-md);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.au-otp input:focus { border-color: hsl(var(--accent-component)); box-shadow: 0 0 0 3px hsl(var(--accent-component) / 0.14); }
.au-otp input.is-filled { border-color: hsl(var(--accent-component) / 0.5); background: hsl(var(--accent-component) / 0.04); }
/* Recovery-code mode: the script hides boxes 2-6 and widens box 1. */
.au-otp:has(#otp-2[style*="none"]) { display: flex; justify-content: center; }
.au-otp:has(#otp-2[style*="none"]) .au-otp-sep { display: none; }
.au-otp:has(#otp-2[style*="none"]) #otp-1 { font-family: var(--cui-mono); font-size: 1.25rem; }
.au-note { display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.85rem; font-size: 0.8571rem; line-height: 1.45; color: var(--muted-foreground); }
.au-note svg { width: 0.95rem; height: 0.95rem; flex: none; margin-top: 0.1rem; }
.au-note strong { color: var(--foreground); font-weight: 650; }
.au-otp + .au-note + .au-submit { margin-top: 1.25rem; }

/* "Other ways to verify": each way is a row the whole of which is its link.
   The script shows a way with style="display: block"; the divider only shows
   when at least one is visible. */
.au-ways:not(:has(.au-options > [style*="block"])) { display: none; }
.au-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.6rem 0 0.8rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted-foreground); }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.au-options { display: grid; gap: 0.5rem; }
.au-option { position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--cui-r-md); transition: background 0.15s, border-color 0.15s; }
.au-option:hover { background: var(--muted); border-color: hsl(var(--accent-component) / 0.35); }
.au-option a { flex: 1; min-width: 0; font-size: 0.9286rem; font-weight: 650; color: var(--foreground); text-decoration: none; }
.au-option a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.au-option a:focus-visible { outline: none; }
.au-option:has(a:focus-visible) { outline: 2px solid hsl(var(--accent-component)); outline-offset: 2px; }
.au-option > svg { width: 1rem; height: 1rem; color: var(--muted-foreground); }

/* ---- 2FA setup ------------------------------------------------------------ */
.setup-step { display: none; }
.setup-step.active { display: block; }
.au-page .au-stepper { margin-bottom: 1.9rem; }
.au-methods { display: grid; gap: 0.6rem; }
.au-method { position: relative; display: flex; align-items: center; gap: 0.9rem; width: 100%; padding: 0.95rem 1rem; text-align: left; font: inherit; color: var(--foreground); background: var(--card); border: 1px solid var(--border); border-radius: var(--cui-r-lg); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.au-method:hover { border-color: hsl(var(--accent-component) / 0.45); }
.au-method:focus-visible { outline: 2px solid hsl(var(--accent-component)); outline-offset: 2px; }
.au-method.selected { border-color: hsl(var(--accent-component)); background: hsl(var(--accent-component) / 0.035); box-shadow: 0 0 0 3px hsl(var(--accent-component) / 0.12); }
.au-method-text { flex: 1; min-width: 0; }
.au-method-name { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 650; }
.au-method-desc { display: block; margin-top: 0.15rem; font-size: 0.8571rem; color: var(--muted-foreground); }
.au-radio { width: 1.15rem; height: 1.15rem; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border); transition: box-shadow 0.15s; }
.au-method.selected .au-radio { box-shadow: inset 0 0 0 5px hsl(var(--accent-component)); }
.au-qr-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; padding: 1.1rem; background: var(--muted); border: 1px solid var(--border); border-radius: var(--cui-r-lg); }
.au-qr { width: 9.75rem; height: 9.75rem; padding: 0.55rem; border-radius: 0.8rem; background: #fff; box-shadow: var(--cui-shadow-card); }
.au-qr img { display: block; width: 100%; height: 100%; }
.au-qr img[src=""] { visibility: hidden; }
.au-qr-steps { margin: 0; padding: 0; list-style: none; counter-reset: au-step; display: grid; gap: 0.6rem; font-size: 0.8929rem; }
.au-qr-steps li { display: flex; gap: 0.6rem; counter-increment: au-step; }
.au-qr-steps li::before { content: counter(au-step); flex: none; width: 1.35rem; height: 1.35rem; display: grid; place-items: center; border-radius: 50%; font-size: 0.75rem; font-weight: 700; color: hsl(var(--accent-component)); background: hsl(var(--accent-component) / 0.12); }
.au-key { margin-top: 0.95rem; display: grid; gap: 0.35rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.au-key code { justify-self: start; max-width: 100%; overflow-wrap: anywhere; padding: 0.25rem 0.55rem; font-family: var(--cui-mono); font-size: 0.8571rem; letter-spacing: 0.04em; color: var(--foreground); background: var(--card); border: 1px solid var(--border); border-radius: var(--cui-r); user-select: all; }
.au-page .au-code-input { height: 3.25rem; text-align: center; font-family: var(--cui-mono); font-size: 1.4rem; letter-spacing: 0.35em; }
.au-wait { display: grid; justify-items: center; gap: 0.9rem; padding: 2rem 0; text-align: center; color: var(--muted-foreground); }
.au-wait .cui-spinner { width: 1.75rem; height: 1.75rem; border-width: 3px; color: hsl(var(--accent-component)); }
.au-wait b { display: block; font-size: 1.05rem; color: var(--foreground); }
/* Recovery codes: the script writes one <div> per code. */
.au-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem; padding: 1rem 1.15rem; counter-reset: au-code; font-family: var(--cui-mono); font-size: 0.9643rem; letter-spacing: 0.04em; background: var(--muted); border: 1px solid var(--border); border-radius: var(--cui-r-lg); }
.au-codes > div { counter-increment: au-code; }
.au-codes > div::before { content: counter(au-code) "."; display: inline-block; min-width: 1.6rem; margin-right: 0.4rem; text-align: right; color: var(--muted-foreground); }
.au-codes-actions { display: flex; gap: 0.5rem; margin: 0.75rem 0 0.4rem; }

/* ---- Passwords -------------------------------------------------------------- */
.au-reqs { list-style: none; margin: 0; padding: 0.8rem 0.95rem; display: grid; gap: 0.4rem; font-size: 0.8571rem; color: var(--muted-foreground); background: var(--muted); border-radius: var(--cui-r-md); }
.au-reqs li { display: flex; align-items: center; gap: 0.5rem; transition: color 0.15s; }
.au-reqs svg { width: 0.95rem; height: 0.95rem; }
.au-reqs li.valid { color: hsl(var(--cui-positive)); font-weight: 600; }

@keyframes au-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes au-blink { 50% { opacity: 0; } }
@keyframes au-spin { to { transform: rotate(360deg); } }

/* ---- Phones and small tablets ---------------------------------------------
   Today's layout, kept: the whole screen is brand teal, the white logo sits
   centred on top, the form is a white card, and logo, card and badges are one
   block centred in the screen. Only sign-in keeps its typed headline. */
@media (max-width: 1023px) {
    .au-page {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        min-height: 100vh; min-height: 100svh;
        padding: max(2rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
        background: linear-gradient(170deg,
            color-mix(in srgb, hsl(var(--accent-component)) 82%, #fff) 0%,
            hsl(var(--accent-component)) 40%,
            color-mix(in srgb, hsl(var(--accent-component)) 70%, #0f172a) 100%);
    }
    .au-brand { flex: none; background: none; padding: 0 0 1.5rem; gap: 0; align-items: center; }
    .au-brand::before, .au-brand::after, .au-brand-body, .au-brand-foot, .au-particles { display: none; }
    .au-wordmark { --au-logo-h: 3.6rem; align-self: center; }
    /* The PNG has more padding on the left (353px) than the right (210px):
       nudge it so the visible logo is centred. */
    .au-wordmark img { margin-left: calc(var(--au-logo-h) * -0.12); margin-right: 0; }
    /* Sign-in keeps its typed headline. Two lines stay reserved so a
       wrapping phrase never moves the card. */
    .au-brand-body.is-marquee { display: block; margin: 1.1rem 0 0; text-align: center; animation: none; }
    .au-brand-body.is-marquee .au-eyebrow { display: none; }
    .auth-type-caret { display: inline-block; }
    .au-page .au-brand-body.is-marquee .au-headline { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin: 0 0 0.35rem; font-size: 1.6rem; min-height: 2.3em; }
    .au-page .au-brand-body.is-marquee .au-lede { margin: 0; font-size: 0.9643rem; }
    .au-main { flex: none; width: 100%; max-width: 27rem; padding: 0; background: none; }
    .au-center { display: block; padding: 0; }
    .au-form, .au-form.is-wide { width: 100%; padding: 1.6rem 1.25rem 1.5rem; background: var(--card); border-radius: 1.25rem; box-shadow: 0 1px 2px rgb(15 23 42 / 0.08), 0 20px 48px -12px rgb(15 23 42 / 0.35); }
    /* One CHIIRP mark per screen: the logo above the card already brands it. */
    .au-mark { display: none; }
    .au-page .au-head { text-align: center; }
    .au-head-row { justify-content: center; }
    .au-page .au-desc { max-width: 34ch; margin-inline: auto; text-wrap: balance; }
    .au-page .au-title { font-size: 1.5rem; }
    .au-step-pw { transition: none; }
    .au-only-narrow { display: flex; justify-content: center; margin-top: 1.5rem; }
    .au-only-narrow .app-store-links { justify-content: center; }
    .au-only-narrow.au-legal-narrow { margin-top: 0.9rem; }
}
@media (max-width: 420px) {
    .au-otp { gap: 0.35rem; grid-template-columns: repeat(3, minmax(0, 1fr)) 0.4rem repeat(3, minmax(0, 1fr)); }
    .au-otp input { height: 3.1rem; font-size: 1.3rem; }
    .au-qr-card { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .au-codes { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-type-caret, .au-page .spinner, .au-page .btn-spinner { animation: none; }
    .au-step-pw { transition: none; }
}

/* ===========================================================================
   Motion (js/auth/auth.js adds the classes; js/auth/brand-particles.js joins in).
   No size, font, colour or layout rule changes: each screen as it stands is the
   starting frame of every animation. Phones and desktop share everything except
   the first block and the "desktop only" one. Teal throughout: a finished state
   is shown by shape (a full ring, a drawn tick), never by turning green.
   =========================================================================== */

/* ---- Phones only: desktop keeps its particle stage and its own entrance ---- */
@media (max-width: 1023px) {
    /* ---- Ambient: two soft lights drift behind the card ---- */
    .au-page { position: relative; overflow: hidden; isolation: isolate; }
    .au-page::before, .au-page::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(40px); pointer-events: none; }
    .au-page::before { width: 70vw; height: 70vw; left: -22vw; top: -12vw; background: rgb(255 255 255 / 0.22); animation: au-drift-a 13s ease-in-out infinite alternate; }
    .au-page::after { width: 80vw; height: 80vw; right: -30vw; bottom: 4vh; background: color-mix(in srgb, hsl(var(--accent-component)) 55%, #0f172a); opacity: 0.5; animation: au-drift-b 17s ease-in-out infinite alternate; }
    @keyframes au-drift-a { to { transform: translate(26vw, 18vh) scale(1.25); } }
    @keyframes au-drift-b { to { transform: translate(-30vw, -22vh) scale(0.85); } }

    /* ---- Entrance, sign-in only (.au-entry): logo, headline, then the card springs up and its rows follow ---- */
    /* The brand pane clips its contents (a desktop need). On phones that cut the top off the logo
       while it moved, so the clip is lifted here and the logo grows in place instead of dropping in. */
    .au-brand { overflow: visible; }
    .au-entry .au-wordmark { animation: au-in-logo 0.7s var(--cui-ease) both; }
    .au-entry .au-brand-body { animation: au-in-down 0.6s 0.08s var(--cui-ease) both; }
    .au-entry .au-form { animation: au-in-card 0.75s 0.16s cubic-bezier(0.2, 0.9, 0.25, 1.12) both; }
    .au-entry .au-form > .au-head, .au-entry .au-signin > .cui-field, .au-entry .au-step-inner > *, .au-entry .au-form > .au-alt { animation: au-in-row 0.5s calc(0.34s + var(--i, 0) * 0.06s) var(--cui-ease) both; }
    .au-entry .au-signin > .cui-field { --i: 1; }
    .au-entry .au-step-inner > :nth-child(1) { --i: 2; }
    .au-entry .au-step-inner > :nth-child(2) { --i: 3; }
    .au-entry .au-step-inner > :nth-child(3) { --i: 4; }
    .au-entry .au-form > .au-alt { --i: 5; }
    .au-entry .au-only-narrow { animation: au-in-row 0.5s 0.75s var(--cui-ease) both; }
    @keyframes au-in-logo { from { opacity: 0; transform: scale(0.9); } }
    @keyframes au-in-down { from { opacity: 0; transform: translateY(8px); } }
    @keyframes au-in-card { from { opacity: 0; transform: translateY(34px) scale(0.97); } }
    @keyframes au-in-row { from { opacity: 0; transform: translateY(10px); } }
}

/* ---- Every width ---- */
/* ---- Fields: the label and icon take the accent, the icon gives a small nod ---- */
.au-page .cui-field-label { transition: color 0.2s; }
.au-page .cui-field:focus-within .cui-field-label { color: hsl(var(--accent-component)); }
.au-page .cui-field:focus-within .au-field-link { color: hsl(var(--accent-component)); }
.au-page .cui-input-wrap > svg.cui-lead { transition: color 0.2s; }
.au-page .cui-input-wrap:focus-within > svg.cui-lead { color: hsl(var(--accent-component)); animation: au-nod 0.45s var(--cui-ease); }
@keyframes au-nod { 40% { transform: translateY(-50%) scale(1.25) rotate(-8deg); } }
/* A tick lands in the email field once it looks like an email. */
.au-ok { position: absolute; right: 0.8rem; top: 50%; width: 1.25rem; height: 1.25rem; margin-top: -0.625rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: hsl(var(--accent-component)); transform: scale(0); transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.au-ok svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cui-input-wrap.is-valid .au-ok { transform: scale(1); }
/* The eye blinks when it opens or closes. */
.au-peek.is-blink svg { animation: au-blink-eye 0.22s ease-in-out; }
@keyframes au-blink-eye { 50% { transform: scaleY(0.1); } }
/* The checkbox sends out one ring when ticked. */
.au-page .au-row .cui-check input:checked { animation: au-ring-out 0.5s ease-out; }
@keyframes au-ring-out { from { box-shadow: 0 0 0 0 hsl(var(--accent-component) / 0.45); } to { box-shadow: 0 0 0 10px hsl(var(--accent-component) / 0); } }

/* ---- The button: presses in, becomes its own spinner, then a tick ---- */
.au-page .au-submit { display: flex; margin-inline: auto; overflow: hidden; transition: width 0.4s var(--cui-ease), border-radius 0.4s var(--cui-ease), background 0.3s, transform 0.12s; }
.au-page .au-submit:active { transform: scale(0.975); }
.au-page .au-submit > * { transition: opacity 0.15s; }
.au-page .au-submit > svg:first-child { animation: au-twinkle 4.5s ease-in-out infinite; }
@keyframes au-twinkle { 0%, 86%, 100% { transform: none; } 91% { transform: scale(1.3) rotate(18deg); } 96% { transform: scale(0.95) rotate(-6deg); } }
/* The page scripts disable the button and put a spinner in it while a request runs: that is the
   cue. (A button disabled for another reason, like "Continue" on 2FA setup, has no spinner.) */
.au-page .au-submit:disabled:has(.spinner, .btn-spinner), .au-page .au-submit.is-ok { width: 3rem; padding: 0; border-radius: 1.5rem; opacity: 1; pointer-events: none; }
.au-page .au-submit:disabled:has(.spinner, .btn-spinner) > :not(.spinner):not(.btn-spinner), .au-page .au-submit.is-ok > * { display: none; }
.au-page .au-submit .spinner, .au-page .au-submit .btn-spinner { width: 1.25rem; height: 1.25rem; margin: 0; border-width: 2.5px; }
.au-page .au-submit.is-ok { background: hsl(var(--accent-component)); border-color: hsl(var(--accent-component)); }
.au-page .au-submit.is-ok::after { content: ""; width: 1.4rem; height: 1.4rem; background: #fff; animation: au-pop-in 0.4s cubic-bezier(0.3, 1.7, 0.5, 1) both;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
@keyframes au-pop-in { from { transform: scale(0); } }

/* ---- Something wrong: the message drops in, the field shakes once ---- */
.au-page .alert { animation: au-drop 0.4s var(--cui-ease) both; }
@keyframes au-drop { from { opacity: 0; transform: translateY(-8px); } }
.cui-input-wrap.is-wrong, .au-otp.is-wrong { animation: au-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.au-page .au-form .cui-input-wrap.is-wrong .cui-input { border-color: var(--destructive); box-shadow: 0 0 0 3px hsl(var(--destructive-component) / 0.14); }
@keyframes au-shake { 15%, 55% { transform: translateX(-7px); } 35%, 75% { transform: translateX(6px); } 90% { transform: translateX(-2px); } }

/* ---- Between pages: the step you leave slides out, the step you arrive at slides in.
   (Sign-in, the code and the dashboard are separate pages, so each plays its own half.) ---- */
.au-form { transition: height 0.45s var(--cui-ease); }
.au-form.is-leaving > * { animation: au-leave 0.22s ease-in both; }
.au-page:not(.au-entry) .au-form { animation: au-enter 0.42s var(--cui-ease) both; }
@keyframes au-leave { to { opacity: 0; transform: translateX(-26px); } }
@keyframes au-enter { from { opacity: 0; transform: translateX(30px); } }

/* ---- The code: each digit pops in, the empty box breathes, a right code ripples teal ---- */
.au-otp input { transition: border-color 0.15s, box-shadow 0.15s, background 0.25s, color 0.25s, transform 0.2s; }
.au-otp input:focus:placeholder-shown, .au-otp input:focus { animation: au-breathe 1.6s ease-in-out infinite; }
.au-otp input.is-pop { animation: au-digit 0.3s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes au-breathe { 50% { box-shadow: 0 0 0 5px hsl(var(--accent-component) / 0.1); } }
@keyframes au-digit { from { transform: scale(0.8); color: transparent; } 60% { transform: scale(1.1); } }
.au-otp.is-right input { color: #fff; background: hsl(var(--accent-component)); border-color: hsl(var(--accent-component)); animation: au-hop 0.45s calc(var(--i) * 0.06s) var(--cui-ease) both; }
@keyframes au-hop { 40% { transform: translateY(-7px); } }
.au-otp.is-wrong input { border-color: var(--destructive); background: hsl(var(--destructive-component) / 0.06); }

.au-form.is-done > :not(.au-done) { display: none; }
/* ---- In: the agent builder's "setting up" moment, sized for this card. A soft aurora, a
   glowing orb around the CHIIRP mark, and a short checklist that fills a bar as each part lands. ---- */
.au-done { position: relative; display: grid; justify-items: center; padding: 0.9rem 0 0.15rem; text-align: center; isolation: isolate; }
/* A soft glow of brand colour behind the orb. Each light fades to nothing before it reaches
   the edge of its box, so there is never a visible patch or outline, on a card or on a bare page. */
.au-done-aurora { position: absolute; left: 50%; top: -1.5rem; width: min(26rem, 118%); height: 12.5rem; z-index: -1; pointer-events: none; transform: translateX(-50%);
    background: radial-gradient(closest-side at 36% 50%, hsl(var(--accent-component) / 0.17), transparent), radial-gradient(closest-side at 66% 44%, hsl(var(--cui-purple) / 0.11), transparent);
    animation: au-aurora 7s ease-in-out infinite alternate; }
/* The orb: the mark on a white disc, a thin comet of colour circling it, a soft halo behind. */
.au-orb { position: relative; width: 5rem; height: 5rem; margin: 0.2rem 0 1.25rem; }
.au-orb-glow { position: absolute; inset: -1.1rem; border-radius: 50%; filter: blur(9px);
    background: radial-gradient(closest-side, hsl(var(--accent-component) / 0.34), hsl(var(--cui-purple) / 0.12) 62%, transparent 78%);
    animation: au-orb-halo 2.4s ease-in-out infinite; transition: opacity 0.5s; }
.au-orb::before, .au-orb::after { content: ""; position: absolute; inset: -0.42rem; border-radius: 50%;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); transition: opacity 0.4s; }
.au-orb::before { background: conic-gradient(from 0deg, hsl(var(--accent-component) / 0) 0 18%, hsl(var(--accent-component) / 0.55) 55%, hsl(var(--cui-purple)) 82%, hsl(var(--accent-component)) 100%); animation: au-spin 1.25s linear infinite; }
.au-orb::after { background: hsl(var(--accent-component)); opacity: 0; }
.au-orb-core { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: hsl(var(--accent-component));
    background: linear-gradient(160deg, #fff 35%, color-mix(in srgb, hsl(var(--accent-component)) 9%, #fff));
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px hsl(var(--accent-component) / 0.1), 0 2px 5px rgb(15 23 42 / 0.07), 0 14px 28px -14px hsl(var(--accent-component) / 0.6); }
.au-orb-core svg { width: 2.3rem; height: 2.3rem; filter: drop-shadow(0 2px 3px hsl(var(--accent-component) / 0.28)); animation: au-orb-breathe 1.8s ease-in-out infinite; }
/* The tick badge is a white disc with a teal tick, above the ring, so it reads against the teal ring. */
.au-orb-badge { position: absolute; z-index: 2; right: -0.45rem; bottom: -0.45rem; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; background: var(--card); box-shadow: 0 0 0 1px hsl(var(--accent-component) / 0.25), 0 3px 8px -2px rgb(15 23 42 / 0.35); transform: scale(0); }
.au-orb-badge svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: hsl(var(--accent-component)); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
/* All set: the comet becomes a full teal ring, a tick lands on the orb, the halo settles. */
.au-done.is-ready .au-orb::before { opacity: 0; }
.au-done.is-ready .au-orb::after { opacity: 1; animation: au-orb-ring 0.7s var(--cui-ease); }
.au-done.is-ready .au-orb-glow { animation: none; opacity: 0.7; background: radial-gradient(closest-side, hsl(var(--accent-component) / 0.26), transparent 75%); }
.au-done.is-ready .au-orb-core svg { animation: au-pop-in 0.45s cubic-bezier(0.3, 1.7, 0.5, 1); }
.au-done.is-ready .au-orb-badge { transform: none; transition: transform 0.45s 0.15s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes au-orb-halo { 50% { transform: scale(1.12); opacity: 0.75; } }
@keyframes au-orb-ring { from { transform: scale(1.35); opacity: 0; } }
/* The greeting: a quiet line, then the name as the one big thing on the card. */
.au-done-hello { margin: 0; display: grid; justify-items: center; gap: 0.15rem; }
.au-done-hello span { font-size: 0.8571rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted-foreground); }
.au-done-hello b { padding: 0 0.1em 0.08em; font-size: 2.3rem; line-height: 1.08; font-weight: 800; letter-spacing: -0.04em;
    background: linear-gradient(100deg, color-mix(in srgb, hsl(var(--accent-component)) 62%, #0f172a) 0%, hsl(var(--accent-component)) 48%, hsl(var(--cui-purple)) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.au-done-hello span { animation: au-in-row 0.5s 0.1s var(--cui-ease) both; }
.au-done-hello b { animation: au-name-in 0.7s 0.18s var(--cui-ease) both; }
@keyframes au-name-in { from { opacity: 0; transform: translateY(12px) scale(0.94); letter-spacing: -0.01em; } }
/* The status: a small pill with a live dot; it turns solid and stops pulsing when everything is ready. */
.au-done-status { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0.75rem 0 0; padding: 0.3rem 0.8rem 0.3rem 0.65rem; border-radius: 999px;
    font-size: 0.8214rem; font-weight: 600; letter-spacing: 0.005em; color: color-mix(in srgb, hsl(var(--accent-component)) 78%, #0f172a); background: hsl(var(--accent-component) / 0.08); box-shadow: inset 0 0 0 1px hsl(var(--accent-component) / 0.16);
    transition: color 0.3s, background 0.3s, box-shadow 0.3s; }
.au-done-status i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; animation: au-live 1.2s ease-in-out infinite; }
.au-done.is-ready .au-done-status { color: color-mix(in srgb, hsl(var(--accent-component)) 78%, #0f172a); background: hsl(var(--accent-component) / 0.1); box-shadow: inset 0 0 0 1px hsl(var(--accent-component) / 0.22); }
.au-done.is-ready .au-done-status i { animation: none; }
@keyframes au-live { 50% { opacity: 0.35; transform: scale(0.8); } }
/* The checklist's own text: slightly tighter, steadier numbers. */
.au-dl-text b { letter-spacing: -0.008em; }
.au-dl-text small { margin-top: 0.05rem; }
/* The checklist: one tinted panel, the bar flush along its top edge, and a white highlight
   that glides to whichever line is being worked on. Each tick draws itself. */
.au-done-card { position: relative; width: 100%; margin-top: 1.15rem; overflow: hidden; text-align: left; border-radius: 1.1rem;
    background: linear-gradient(180deg, hsl(var(--accent-component) / 0.06), hsl(var(--accent-component) / 0.025)); box-shadow: inset 0 0 0 1px hsl(var(--accent-component) / 0.1); transition: box-shadow 0.4s, background 0.4s; }
.au-done.is-ready .au-done-card { background: linear-gradient(180deg, hsl(var(--accent-component) / 0.07), hsl(var(--accent-component) / 0.02)); box-shadow: inset 0 0 0 1px hsl(var(--accent-component) / 0.18); }
.au-done-bar { --p: 0; position: relative; height: 3px; overflow: hidden; background: hsl(var(--accent-component) / 0.12); }
.au-done-bar span { position: relative; display: block; height: 100%; width: calc(var(--p) * 100%); overflow: hidden; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, hsl(var(--accent-component)), hsl(var(--cui-purple))); transition: width 0.5s var(--cui-ease), background 0.4s; }
.au-done-bar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.75), transparent); transform: translateX(-100%); animation: au-sheen 1.1s ease-in-out infinite; }
.au-done.is-ready .au-done-bar span { border-radius: 0; background: hsl(var(--accent-component)); }
.au-done.is-ready .au-done-bar span::after { animation: none; }
@keyframes au-sheen { to { transform: translateX(100%); } }
.au-done-list { position: relative; list-style: none; margin: 0; padding: 0.4rem; display: flex; flex-direction: column; gap: 0.1rem; }
.au-done-list li { position: relative; z-index: 1; display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.65rem; opacity: 0.45; transition: opacity 0.35s; }
.au-done-list li.is-on { opacity: 1; }
.au-done-list li:not(.au-dl-glide) { animation: au-dl-in 0.5s calc(0.25s + var(--i, 0) * 0.07s) var(--cui-ease) backwards; }
@keyframes au-dl-in { from { opacity: 0; transform: translateX(-10px); } }
.au-done-list li.au-dl-glide { position: absolute; z-index: 0; left: 0; top: 0; width: 0; height: 0; padding: 0; opacity: 0; border-radius: 0.8rem; background: var(--card);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 10px 22px -12px hsl(var(--accent-component) / 0.55), inset 0 0 0 1px hsl(var(--accent-component) / 0.12);
    transition: transform 0.45s var(--cui-ease), width 0.45s var(--cui-ease), height 0.45s var(--cui-ease), opacity 0.35s; }
.au-dl-tile { flex: none; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 0.7rem; color: var(--muted-foreground); background: hsl(var(--accent-component) / 0.07); transition: background 0.3s, color 0.3s, transform 0.3s var(--cui-ease); }
.au-dl-tile svg { width: 1.05rem; height: 1.05rem; }
.au-done-list li.is-on .au-dl-tile { color: var(--cui-on-accent); background: hsl(var(--accent-component)); }
.au-done-list li.is-on:not(.is-done) .au-dl-tile { animation: au-orb-breathe 1.1s ease-in-out infinite; }
.au-done-list li.is-done .au-dl-tile { color: hsl(var(--accent-component)); background: hsl(var(--accent-component) / 0.12); }
.au-dl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.au-dl-text b { font-size: 0.9286rem; font-weight: 600; }
.au-dl-text small { font-size: 0.8rem; color: var(--muted-foreground); }
.au-dl-ico { flex: none; width: 1.35rem; height: 1.35rem; display: grid; place-items: center; border-radius: 50%; }
.au-dl-ico .cui-spinner { width: 1rem; height: 1rem; opacity: 0; color: hsl(var(--accent-component)); }
.au-done-list li.is-on .cui-spinner { opacity: 1; }
.au-done-list li.is-done .au-dl-ico { background: hsl(var(--accent-component)); animation: au-pop-in 0.4s cubic-bezier(0.3, 1.7, 0.5, 1); }
.au-dl-ico svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: #fff; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: au-tick 0.35s 0.15s ease-out forwards; }
@keyframes au-tick { to { stroke-dashoffset: 0; } }
@keyframes au-aurora { from { transform: translateX(-53%) scale(1); } to { transform: translateX(-47%) scale(1.1); } }
@keyframes au-orb-breathe { 50% { transform: scale(1.07); } }
@keyframes au-shimmer { to { background-position: -200% 0; } }
/* Three small lights circle the orb while it works, and fly off when it is done. */
.au-orb-orbit { position: absolute; inset: -1.15rem; border-radius: 50%; animation: au-spin 4.5s linear infinite; }
.au-orb-orbit i { position: absolute; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: hsl(var(--accent-component)); box-shadow: 0 0 8px hsl(var(--accent-component) / 0.7); transition: transform 0.6s var(--cui-ease), opacity 0.5s; }
.au-orb-orbit i:nth-child(1) { left: 50%; top: -0.2rem; }
.au-orb-orbit i:nth-child(2) { right: 6%; bottom: 12%; width: 0.3rem; height: 0.3rem; background: hsl(var(--cui-purple)); box-shadow: 0 0 8px hsl(var(--cui-purple) / 0.7); }
.au-orb-orbit i:nth-child(3) { left: 4%; bottom: 20%; width: 0.26rem; height: 0.26rem; opacity: 0.7; }
.au-done.is-ready .au-orb-orbit i { opacity: 0; transform: scale(2.6); }
/* A burst of sparks from the orb at the moment everything is ready. */
.au-spark { position: absolute; left: 50%; top: 50%; width: 0.4rem; height: 0.4rem; margin: -0.2rem; border-radius: 50%; pointer-events: none; background: hsl(var(--accent-component)); animation: au-spark 0.9s var(--cui-ease) forwards; }
.au-spark:nth-child(3n) { background: hsl(var(--cui-purple)); }
.au-spark:nth-child(4n) { width: 0.26rem; height: 0.26rem; background: color-mix(in srgb, hsl(var(--accent-component)) 45%, #fff); }
@keyframes au-spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }
/* A band of light crosses the name once. */
.au-done-hello b { background-size: 220% 100%; background-position: 100% 0; }
.au-done.is-ready .au-done-hello b { animation: au-name-shine 1.1s 0.15s var(--cui-ease); }
@keyframes au-name-shine { from { background-position: 100% 0; filter: brightness(1); } 50% { filter: brightness(1.35); } to { background-position: 0 0; filter: brightness(1); } }

/* ---- Desktop only: the signed-in moment has room, so it takes it ---- */
@media (min-width: 1024px) {
    .au-done { margin-inline: -6rem; padding-top: 0.5rem; }
    .au-done-aurora { top: -3.5rem; width: 44rem; height: 22rem; }
    .au-orb { width: 7.25rem; height: 7.25rem; margin-bottom: 1.7rem; }
    .au-orb::before, .au-orb::after { inset: -0.6rem; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px)); }
    .au-orb-glow { inset: -1.7rem; filter: blur(14px); }
    .au-orb-orbit { inset: -1.7rem; }
    .au-orb-orbit i { width: 0.55rem; height: 0.55rem; }
    .au-orb-core svg { width: 3.35rem; height: 3.35rem; }
    .au-orb-badge { right: -0.5rem; bottom: -0.5rem; width: 2.35rem; height: 2.35rem; }
    .au-orb-badge svg { width: 1.4rem; height: 1.4rem; }
    .au-done-hello { gap: 0.3rem; }
    .au-done-hello span { font-size: 0.9286rem; letter-spacing: 0.14em; }
    .au-done-hello b { font-size: 4rem; letter-spacing: -0.045em; }
    .au-done-status { margin-top: 1rem; padding: 0.4rem 1rem 0.4rem 0.8rem; font-size: 0.9286rem; }
    /* The three steps sit side by side, and the highlight slides across them. */
    .au-done-card { margin-top: 1.9rem; border-radius: 1.3rem; }
    .au-done-bar { height: 4px; }
    .au-done-list { flex-direction: row; gap: 0.35rem; padding: 0.5rem; }
    .au-done-list li:not(.au-dl-glide) { flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 0.85rem; min-height: 8.6rem; padding: 1.05rem 1rem 1rem; }
    .au-done-list li.au-dl-glide { border-radius: 1rem; }
    .au-done-list li:not(.au-dl-glide) { animation-name: au-dl-up; }
    @keyframes au-dl-up { from { opacity: 0; transform: translateY(14px); } }
    .au-dl-tile { width: 2.75rem; height: 2.75rem; border-radius: 0.85rem; }
    .au-dl-tile svg { width: 1.3rem; height: 1.3rem; }
    .au-dl-text b { font-size: 1.0357rem; }
    .au-dl-text small { margin-top: 0.2rem; font-size: 0.8571rem; }
    .au-dl-ico { position: absolute; top: 1.05rem; right: 1rem; width: 1.5rem; height: 1.5rem; }
    .au-dl-ico svg { width: 0.9rem; height: 0.9rem; }

    /* The hand-off: teal opens out from the orb and takes the whole screen, as the dashboard loads. */
    .au-iris { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 1.1rem; color: #fff; pointer-events: none;
        background: linear-gradient(160deg, color-mix(in srgb, hsl(var(--accent-component)) 82%, #fff) 0%, hsl(var(--accent-component)) 45%, color-mix(in srgb, hsl(var(--accent-component)) 74%, #0f172a) 100%);
        clip-path: circle(0 at var(--x) var(--y)); transition: clip-path 0.95s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.5s; }
    .au-iris.is-open { clip-path: circle(150vmax at var(--x) var(--y)); }
    .au-iris.is-gone { opacity: 0; }
    .au-iris svg { width: 5.5rem; height: 5.5rem; opacity: 0; transform: scale(0.6); transition: opacity 0.4s 0.45s, transform 0.7s 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
    .au-iris.is-open svg { opacity: 1; transform: none; }
    .au-iris b { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.02em; opacity: 0; transform: translateY(8px); transition: opacity 0.4s 0.65s, transform 0.5s 0.65s var(--cui-ease); }
    .au-iris.is-open b { opacity: 1; transform: none; }
    .au-iris span { width: 11rem; height: 3px; overflow: hidden; border-radius: 3px; background: rgb(255 255 255 / 0.25); }
    .au-iris span::after { content: ""; display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
    .au-iris.is-open span::after { animation: au-iris-bar 1.3s 0.8s var(--cui-ease) forwards; }
    @keyframes au-iris-bar { to { transform: scaleX(1); } }
}

/* Desktop asks for the email first, with an arrow inside the field: the tick sits beside it. */
[data-au-step="email"] .au-ok { right: 3.15rem; }
.au-page .cui-input-wrap .au-next { transition: opacity 0.2s, transform 0.12s; }
.au-page .cui-input-wrap .au-next:active { transform: translateY(-50%) scale(0.92); }
/* Anyone who has asked their phone for less motion gets none of this. */
@media (prefers-reduced-motion: reduce) {
    .au-page *, .au-page::before, .au-page::after { animation: none !important; transition: none !important; }
    .au-dl-ico svg { stroke-dashoffset: 0; }
}
