/* Sign-in screen — Deployment Manager's front door (ported via env-manager
   styles.css section 20), shared by the three tools. The drawing inside
   .signin-map is this app's own (.cp-*, end of file). */

/* The door's own field, and the door's own tokens: the sign-in screen is
   the one surface with a drawing on it, so it carries pairs the app has
   nowhere else. They live HERE rather than on the panel because the field
   now covers the whole screen and fades into the app's canvas on the
   right -- the panel is a place ON that field, not a slab laid over it.

   Contrast for the light set was computed, not eyeballed: ink 11.94:1,
   ink-soft 6.5:1, ink-dim 5.11:1 (4.75 on the host fill), accent 5.09:1,
   ok 4.68:1, and the hairline 3.57:1, which it needs because the host box
   is told from its field by that border. */
.login-overlay {
    --si-ink: hsl(209 45% 16%);
    --si-ink-soft: hsl(209 22% 32%);      /* 6.5:1 on --si-bg */
    --si-ink-dim: hsl(209 14% 38%);       /* 5.11:1 on --si-bg */
    --si-bg: hsl(209 44% 91%);
    --si-line: hsl(209 32% 48%);          /* 3.57:1 — a border that means something */
    --si-accent: hsl(209 60% 38%);        /* 5.09:1 on --si-bg */
    --si-ok: hsl(149 50% 30%);            /* 4.68:1 on --si-bg */
    --si-svc-fill: hsl(209 48% 86%);
    --si-host-fill: hsl(209 42% 88%);

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--si-bg);
    display: block;
    overflow-y: auto;
    z-index: 2000;
}

/* The dark set is the original one -- it was always right for the theme
   it was drawn in. */
[data-theme="dark"] .login-overlay {
    --si-ink: hsl(210 30% 97%);
    --si-ink-soft: hsl(209 22% 78%);      /* 8.1:1 on --si-bg */
    --si-ink-dim: hsl(209 18% 62%);       /* 4.8:1 on --si-bg */
    --si-bg: hsl(209 47% 8%);
    --si-line: hsl(209 34% 26%);
    --si-accent: hsl(207 66% 62%);        /* 6.9:1 on --si-bg */
    --si-ok: hsl(150 52% 52%);
    --si-svc-fill: hsl(209 40% 16%);
    --si-host-fill: hsl(209 44% 14%);
}

/* Where the field GIVES WAY to the app's canvas. One layer of the canvas
   colour, masked so it is absent on the left and complete by the time the
   card sits on it -- so the two fields are never two fields meeting at an
   edge, which is the seam every earlier attempt was trying to hide.

   The ramp is a `linearGradient` ELEMENT inside an SVG, not the CSS ramp
   function the purple-gradient guard bans frontend-wide (it greps the
   hyphenated spelling, comments included -- do not write it here). It
   drives a mask's alpha; it paints no colour of its own.

   Narrow: one column, panel above card, so the fade runs DOWN instead. */
.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--bg-primary);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0.22' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='0.42' stop-color='%23fff' stop-opacity='0.55'/%3E%3Cstop offset='0.6' stop-color='%23fff' stop-opacity='1'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0.22' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='0.42' stop-color='%23fff' stop-opacity='0.55'/%3E%3Cstop offset='0.6' stop-color='%23fff' stop-opacity='1'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
}

@media (min-width: 1000px) {
    .login-overlay::before {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0.4' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='0.56' stop-color='%23fff' stop-opacity='0.6'/%3E%3Cstop offset='0.72' stop-color='%23fff' stop-opacity='1'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E");
                mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0.4' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='0.56' stop-color='%23fff' stop-opacity='0.6'/%3E%3Cstop offset='0.72' stop-color='%23fff' stop-opacity='1'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E");
    }
}

.login-overlay.hidden {
    display: none;
}

/* The content, above the fade. No padding and no gap: the field is the
   whole screen and the columns only place things on it -- an inset here
   would make the left side a slab laid over the page again, which is the
   thing being fixed. One column below 1000px, panel first -- "where am I"
   is answered before an address is asked for, and a screen reader gets
   the same order the wide layout reads left to right. */
.login-layout {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100%;
    align-items: stretch;
}

@media (min-width: 1000px) {
    .login-layout {
        grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
    }
}

/* ---- The panel ------------------------------------------------------
   A PLACE on the field, not a surface over it: no background, no radius,
   no shadow of its own. Everything it paints with comes from the overlay's
   token block above. It used to be fixed dark in both themes ("the front
   door looks the same to everyone"), then an inset card; both read as a
   slab laid over one half of the page, which is what the fade replaces. */
.signin-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--si-ink);
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 40px 24px;
}

/* Wider padding as the screen gets wider. No reserved dissolve zone any
   more: the fade belongs to the FIELD (`.login-overlay::before`), which
   crosses this column and the next one without either of them knowing. */
@media (min-width: 1000px) {
    .signin-panel {
        padding: 48px 40px;
    }
}

@media (min-width: 1320px) {
    .signin-panel {
        padding: 56px clamp(56px, 5.5vw, 88px);
    }
}

/* The blueprint the panel is drawn on: a 32px hairline grid, faded out
   toward the bottom right so it never competes with the diagram. */
.signin-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    /* Two hairlines of one 32px cell, drawn as SVG rather than as a pair
       of CSS ramps: the ramp function is banned frontend-wide (the
       purple-gradient guard in tests/design-tokens.test.js), and a grid is
       lines anyway -- a colour ramp was only ever a way to fake them. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M32 0H0v32' fill='none' stroke='%233f6c9c' stroke-opacity='0.16' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 32px 32px;
    /* Reaches most of the way to the form column before it dissolves.
       It used to fade out by 72% of the panel, which on a wide screen
       left a band of flat field between the grid and the card that read
       as the drawing having been cropped. */
    -webkit-mask-image: radial-gradient(150% 115% at 10% 6%, var(--si-ink) 18%, transparent 92%);
            mask-image: radial-gradient(150% 115% at 10% 6%, var(--si-ink) 18%, transparent 92%);
}

/* The same grid, drawn for the field it sits on: the line cannot be a
   token (it lives inside a data URI, where `var()` does not reach), so
   the theme swaps the whole image rather than one value. Lighter ink at a
   lower alpha on the dark panel, darker and stronger on the light one --
   the same VISIBILITY, which is what the grid is for. */
[data-theme="dark"] .signin-panel::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M32 0H0v32' fill='none' stroke='%23789cc4' stroke-opacity='0.09' stroke-width='1'/%3E%3C/svg%3E");
}

/* The browser's own selection blue lands on this panel as a foreign
   colour; scoped here rather than set app-wide, which is a change this
   screen has no business making. */
.signin-panel ::selection {
    background: hsl(209 60% 38% / 0.22);   /* --si-accent at 22% */
    color: var(--si-ink);
}

[data-theme="dark"] .signin-panel ::selection {
    background: hsl(207 66% 62% / 0.32);
}

.signin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.signin-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

/* The brand row and its gap (28 + 40) sit ABOVE this column and nothing
   balances them below, so its contents centred 34px lower than the card
   beside them -- measured at 1440x900: story+note centre 484, card 450.
   Reserving the same 68 at the bottom puts both on one line. Wide only:
   in one column the two are stacked, not compared, and the reserve would
   just be a hole under the panel. */
@media (min-width: 1000px) {
    .signin-body {
        padding-bottom: 68px;
    }
}

/* The one display step this app has, and it exists for this screen only
   (registered on the ramp in tests/design-tokens.test.js). Fluid between
   the two documented ends so the two-line break survives every width. */
.signin-headline {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.4vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--si-ink);
    margin-bottom: 16px;
    text-wrap: balance;
}

/* No bottom margin by default: below 1200 the drawing it separates from
   is not rendered, and the space it reserved read as a missing element —
   80px of empty panel between the lead and the note on a phone. The
   margin belongs to the figure, so it arrives with the figure. */
.signin-lead {
    color: var(--si-ink-soft);
    line-height: 1.6;
    max-width: 46ch;
}

@media (min-width: 1200px) {
    .signin-lead {
        margin-bottom: 40px;
    }
}

/* The drawing's labels are service KEYS at a fixed size inside the
   viewBox, so they shrink with it: below the two-column breakpoint the
   panel is narrower than the drawing's own 480 units and `oracle` would
   render at 8px. It is the flourish, not the answer -- the headline and
   the lead carry the same information -- so it leaves rather than
   arriving illegible. */
/* Pushed toward the form column: the drawing is the panel's widest
   element, and left-aligned under a headline that is much narrower it
   opened a corridor of empty field between itself and the card. */
.signin-map {
    display: none;
    margin: 0;
    /* Full content width rather than 480 pushed to one side: the drawing
       then shares BOTH edges with the headline and the lead above it, and
       the corridor of empty field between it and the card closes without
       it having to hang off an axis nothing else uses. */
    width: 100%;
    max-width: 600px;
}

/* 1200, not the 1000 the columns split at: the dissolve zone takes the
   panel's right quarter, and below this width what is left of the panel
   is narrower than the drawing's own 480 units. */
@media (min-width: 1200px) {
    .signin-map {
        display: block;
    }
}

.signin-map svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.signin-note {
    margin-top: 40px;
    color: var(--si-ink-dim);
    font-size: 0.875rem;
    line-height: 1.55;
    max-width: 46ch;
}

/* ---- The drawing ---------------------------------------------------- */

/* ---- The form column ------------------------------------------------ */
.signin-form-col {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    /* The card's own gutter, since the layout has none: the field runs
       edge to edge under it. */
    padding: 40px 24px;
}

/* The card is 400px wide or it is not the card: at 1024 a 5vw side
   padding left it 328 and the subtitle broke across two lines. The
   padding gives way before the card does. */
@media (min-width: 1000px) {
    .signin-form-col {
        padding: 48px clamp(24px, 3vw, 72px);
    }
}

/* ---- A phone, or any single column too short to hold the story ------
   The task comes first. Stacked in document order, the brand, the
   headline, the lead and the note filled the first screen, and the
   sign-in button sat below the fold: measured at 390x664 and 375x553 it
   ended at 675 and 697 -- off screen -- and at 412x700 it cleared the
   fold by 44px, which Android's larger text setting spends at once.

   So on these screens the order is: WHERE you are (brand, headline), the
   card, and only then WHAT this is (lead, note). `display: contents` on
   the panel and its body lifts their children into this grid, where
   `order` can place the card between them. Nothing in the panel is
   focusable, so tab order is unchanged; a screen reader still meets the
   story first, which is the order that reads right without eyes.

   The second clause is a short single column -- a phone on its side, a
   small tablet in landscape -- where the same fold problem arrives at a
   greater width. Two columns (>= 1000) never match. */
@media (max-width: 699px), (max-width: 999px) and (max-height: 700px) {
    /* CENTRED, not top-aligned. Top-aligned, a tall phone (392x850) kept
       the whole stack in its upper two-thirds over ~290px of empty canvas.
       Centring is safe for the fold by construction: a stack shorter than
       the screen moves down by half of what is free, which never carries
       the button past the bottom; a stack taller than the screen has
       nothing free to split and starts at the top exactly as before. The
       note's own 32px bottom margin is inside the stack, so it already
       sits a touch above true centre, where the eye puts the middle. */
    .login-layout {
        align-content: center;
    }

    .signin-panel,
    .signin-body {
        display: contents;
    }

    /* One field, fading DOWN behind the brand and headline only. The
       overlay's own fade is sized to the viewport and would run out
       under the card and come back behind the lead; this layer is sized
       in pixels from the top of the content instead. It is the panel's
       own grid pseudo-element, which `display: contents` still generates
       and which now takes `.login-layout` as its containing block -- so
       the dark theme's grid swap above keeps applying unchanged. */
    .login-overlay {
        background: var(--bg-primary);
    }

    .login-overlay::before {
        display: none;
    }

    .signin-panel::before {
        background-color: var(--si-bg);
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='1'/%3E%3Cstop offset='0.35' stop-color='%23fff' stop-opacity='0.9'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E");
                mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='1'/%3E%3Cstop offset='0.35' stop-color='%23fff' stop-opacity='0.9'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Crect width='1' height='1' fill='url(%23g)'/%3E%3C/svg%3E");
        /* 440, not 300: centred on a tall phone the brand starts ~120px
           down, and a 300px fade was already thin behind the headline --
           the tint read as a band over empty screen rather than as the
           field the story stands on. At 440 it is still ~0.75 behind the
           headline there and gone by the end of the card on every size. */
        -webkit-mask-size: 100% 440px;
                mask-size: 100% 440px;
        -webkit-mask-repeat: no-repeat;
                mask-repeat: no-repeat;
    }

    .signin-brand {
        order: 0;
        margin: 24px 24px 0;
    }

    .signin-headline {
        order: 1;
        margin: 20px 24px 0;
    }

    /* 24, not 20: the card casts a shadow upward, and at 20 its top edge
       read as touching the headline's descenders. */
    .signin-form-col {
        order: 2;
        padding: 24px 16px 4px;
    }

    .signin-lead {
        order: 3;
        margin: 20px 24px 0;
    }

    .signin-map {
        order: 4;
    }

    .signin-note {
        order: 5;
        margin: 12px 24px 32px;
    }

    /* Scoped through the overlay: the base `.login-card` rule is
       authored AFTER this block, and at equal specificity it would win. */
    .login-overlay .login-card {
        padding: 28px 24px;
    }

    /* 16px or larger, or iOS Safari zooms the page on focus -- which on
       this screen scrolls the very button this block brings into view.
       1.15rem is the ramp's nearest step at or above it (16.1px). */
    .login-card .form-group input {
        font-size: 1.15rem;
    }
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

/* h2, not h1: the page's one h1 is the product name in the intro column,
   and two h1s leave a screen reader without a document title. */
.login-card h2 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    /* The title carries the product name, so at 390 it is two lines —
       balanced rather than "…to Deployment" + a lone "Manager". */
    text-wrap: balance;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    text-wrap: pretty;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 24px;
}

.login-card .btn-large {
    width: 100%;
}

.login-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* A remembered address is an account chooser, not an extra shortcut
   stacked above the email form. `loginRecentRender` shows exactly one
   of those two paths, leaving one clear primary action in the card. */
.login-recent {
    text-align: left;
}

/* An address is data and can be longer than the card. It WRAPS inside
   the button rather than being cut with an ellipsis: the hidden half
   would only be recoverable through a `title`, which no keyboard
   reaches. */
#loginRecentBtn {
    white-space: normal;
    overflow-wrap: anywhere;
}

.login-switch-account {
    margin-top: 10px;
}

/* One quiet line, not a box. It was a bordered, filled panel carrying a
   label and an address -- the heaviest element on a step whose whole job
   is six empty boxes, and close enough to the input vocabulary that it
   read as a disabled field. What it says is a fact to confirm in
   passing, so it is weighted like one. */
.login-code-recipient {
    display: block;
    margin: -4px 0 20px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-code-recipient span::after {
    content: ' ';
}

.login-code-recipient strong {
    color: var(--text-primary);
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Its own line below 480: on one line with the label, an address broke
   mid-domain ("friendly-" / "tech.com"), and an address broken across
   two lines is one the reader has to reassemble to check it. Given the
   full width it fits whole. */
@media (max-width: 479px) {
    .login-code-recipient strong { display: block; }
    .login-code-recipient span::after { content: none; }
}

/* Set apart from the primary rather than stacked under it: these are the
   two ways out, not two more ways forward. */
.login-code-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.login-code-actions .btn {
    width: 100%;
    min-height: 40px;
    justify-content: center;
}

/* The code is READ OFF A PHONE and typed, one character at a time, and
   the eye has to be able to check its work against the paper. One box per
   character does that in a way tracking inside a single field cannot: the
   place in the code is a POSITION on screen, so a mistyped third digit is
   corrected in place rather than by clearing the lot. Auto-advance,
   Backspace-to-previous and paste-distribution live in js/auth.js.

   Filled is `:valid`, not a JS class — each slot is `required`, so it is
   valid exactly when it holds a character, and the pop fires the moment
   that becomes true. No state to keep in sync. */
.otp-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Three and three. A six-character code is read off a phone in two
   halves and typed in two halves; the break is the one that is already
   in the reader's head, and it costs 8px. */
.otp-group .otp-slot:nth-child(3) {
    margin-right: 10px;
}

/* Not `.form-group input`: those rules would land the shared 10px/14px
   padding and left-aligned text on a one-character box. */
.otp-group .otp-slot {
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    padding: 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    caret-color: var(--accent-text);
    transition: transform var(--transition), border-color var(--transition),
                box-shadow var(--transition), background-color var(--transition);
}

/* A filled box is quietly claimed by the accent — enough to count the
   characters entered at a glance, not enough to compete with focus. */
.otp-group .otp-slot:valid {
    border-color: var(--accent-text);
    background: var(--accent-tint);
    animation: otp-pop 200ms var(--ease-out);
}

.otp-group .otp-slot:focus,
.otp-group .otp-slot:focus-visible {
    outline: none;
    z-index: 1;
    border-color: var(--accent-text);
    box-shadow: var(--focus-ring);
    transform: scale(1.05);
}

.otp-group .otp-slot:disabled {
    background: var(--surface-sunken);
    cursor: not-allowed;
    opacity: 0.6;
}

/* A rejected code is wrong as a WHOLE — there is no telling which
   character was mistyped — so the state belongs to the group. */
.otp-group.error .otp-slot,
.otp-group.error .otp-slot:valid {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.otp-group.error .otp-slot:focus,
.otp-group.error .otp-slot:focus-visible {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px hsl(var(--status-error-border) / 0.4);
}

.otp-group.shake {
    animation: otp-shake 380ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* Accepted. Colour lands on all six at once (the verdict is about the
   whole code); the pop runs left to right, 30 ms apart, so it reads as
   the code being checked off rather than six boxes blinking. The hold in
   auth.js (OTP_SUCCESS_HOLD_MS) waits for the last one. */
.otp-group.success .otp-slot,
.otp-group.success .otp-slot:valid {
    border-color: hsl(var(--status-success-text));
    background: var(--success-bg);
    animation: otp-confirm 220ms var(--ease-out) backwards;
}
.otp-group.success .otp-slot:nth-child(2) { animation-delay: 30ms; }
.otp-group.success .otp-slot:nth-child(3) { animation-delay: 60ms; }
.otp-group.success .otp-slot:nth-child(4) { animation-delay: 90ms; }
.otp-group.success .otp-slot:nth-child(5) { animation-delay: 120ms; }
.otp-group.success .otp-slot:nth-child(6) { animation-delay: 150ms; }

/* A new name, not otp-pop: the boxes already ran that one when they
   filled, and the same name would not replay. */
@keyframes otp-confirm {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* The card gives way to the app drawn beneath it. Exit, so short;
   the slight shrink says "receding", not "closing a dialog". */
.login-overlay.leaving {
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms var(--ease-out);
}
.login-overlay.leaving .login-layout {
    transform: scale(0.985);
    transition: transform 220ms var(--ease-out);
}

@keyframes otp-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.09); }
    100% { transform: scale(1); }
}

@keyframes otp-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
    .otp-group .otp-slot,
    .otp-group .otp-slot:valid,
    .otp-group.shake {
        animation: none;
        transition: border-color var(--transition), box-shadow var(--transition);
    }
    .otp-group .otp-slot:focus,
    .otp-group .otp-slot:focus-visible {
        transform: none;
    }
    /* Colour and the fade stay — they carry the outcome; movement goes. */
    .otp-group.success .otp-slot,
    .otp-group.success .otp-slot:valid {
        animation: none;
    }
    .login-overlay.leaving .login-layout {
        transform: none;
    }
}

.login-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-align: left;
}

.login-message.success {
    background: var(--success-bg);
    border: 1px solid hsl(var(--status-success-border));
    color: hsl(var(--status-success-text));
}

.login-message.success::before { content: '✓'; }

.login-message.error {
    background: var(--danger-bg);
    border: 1px solid hsl(var(--status-error-border));
    color: hsl(var(--status-error-text));
}

.login-message.error::before { content: '✕'; }

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

/* ---- The drawing: a release going through (cp-*) -------------------
   env-manager's panel drops pods into a namespace; this one runs LEFT TO
   RIGHT, because a release is a sequence: the version ticks over, four
   job cards run one after another (a progress ring fills while a job runs,
   then closes green and its status ticks over to the result), and the
   release announcement arrives. Every "change of value" is the same odometer motion, so the
   drawing reads as one system. Colours are the panel's --si-* tokens. The
   rules below are the FINISHED frame; js/login-panel.js animates into it,
   so without JS or with reduced motion the panel simply stands complete. */
.cp { display: grid; gap: 24px; user-select: none; }   /* decorative: copy would pick up every hidden reel row */
.cp-head { display: grid; gap: 8px; }
.cp-title { display: flex; align-items: baseline; gap: 14px; font: 600 1.75rem/1.15 var(--font-mono);
            letter-spacing: -0.02em; color: var(--si-ink); }
.cp-repo { color: var(--si-ink-dim); }
/* An odometer: only the digits that change roll, each in its own one-line
   window, and they stay in the accent colour so the bump reads at a glance
   in the finished frame too. */
.cp-ver { display: inline-flex; align-items: flex-start; height: 1.15em; }
.cp-ver > span { height: 1.15em; }
.cp-digit { overflow: hidden; color: var(--si-accent); }
.cp-digit-reel { display: flex; flex-direction: column; transform: translateY(-50%); }
.cp-digit-reel span { height: 1.15em; }
.cp-branch { display: inline-flex; align-items: center; gap: 6px; font: 400 0.8rem/1 var(--font-mono);
             color: var(--si-ink-soft); }
.signin-map .cp-branch svg { width: 14px; height: 14px; flex: none; color: var(--si-accent); }

/* Cards with a link between each pair; the link fills as one job hands
   over to the next. */
.cp-flow { display: grid; align-items: center;
           grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr) 12px minmax(0, 1fr); }
.cp-card { position: relative; min-width: 0; padding: 12px; background: var(--si-svc-fill);
           border: 1px solid var(--si-line); border-radius: var(--radius); }
/* The running highlight: its own layer so only opacity animates. */
.cp-glow { position: absolute; inset: -1px; border: 1.5px solid var(--si-accent); border-radius: inherit;
           opacity: 0; pointer-events: none; }
.cp-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.signin-map .cp-card svg { width: 18px; height: 18px; flex: none; overflow: visible; }
.cp-track { fill: none; stroke: var(--si-line); stroke-width: 2; opacity: 0.45; }
.cp-prog { fill: none; stroke: var(--si-ok); stroke-width: 2; stroke-linecap: round;
           stroke-dasharray: 1; stroke-dashoffset: 0; transform: rotate(-90deg); transform-origin: 10px 10px; }
.cp-tick { fill: none; stroke: var(--si-ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
           stroke-dasharray: 1; stroke-dashoffset: 0; }
.cp-name { font: 500 0.875rem/1.2 var(--font-sans); color: var(--si-ink);
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-status { display: block; height: 1.2em; margin-top: 8px; overflow: hidden;
             font: 400 0.75rem/1.2 var(--font-mono); color: var(--si-ink-dim); }
.cp-status-reel { display: flex; flex-direction: column; transform: translateY(-66.6667%); }
.cp-status-reel span { height: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-link { position: relative; height: 2px; overflow: hidden; background: var(--si-line); }
.cp-link i { position: absolute; inset: 0; background: var(--si-ok); transform-origin: left center; }

/* Where a release ends in real life: the announcement mail. */
.cp-mail { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--si-svc-fill);
           border: 1px solid var(--si-line); border-radius: var(--radius-lg); }
.cp-mail-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px;
                border-radius: var(--radius); background: var(--si-accent); color: var(--si-bg); }
.signin-map .cp-mail-icon svg { width: 16px; height: 16px; }
.cp-mail-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.cp-mail-body strong { font: 600 0.875rem/1.2 var(--font-sans); color: var(--si-ink); }
.cp-mail-body span { font: 400 0.75rem/1.2 var(--font-mono); color: var(--si-ink-soft);
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-mail-time { flex: none; font: 400 0.75rem/1 var(--font-sans); color: var(--si-ink-dim); }
