/* =================================================================
   THE SIGN-IN PAGES - UI.Portal/Pages/Login + AcceptInvite + Components/SignIn/SignInStage
   (docs/claude/AUTH.md "The sign-in page and its billboards"; redesigned 2026-11-23)
   -----------------------------------------------------------------
   Rendered outside MainLayout (App.razor / BlankLayout), so this file owns
   the whole surface. Every class here is login-* or signin-* and owned by
   THIS file alone. TOKENS ONLY, the whole file (Tests/ShellTokensOnlyTests):
   the night field is mixed from the nav colour, and the only hues on it are
   the four moment families (--conv-ask / say / act / flow), so the page
   re-skins with the platform theme.

   Desktop (>= 1024px): the STAGE (the Listrak logo, the Converse wordmark,
   a conversation that types itself in once, the billboards) beside the
   PANEL (the sign-in card on the light surface). Narrower: the stage folds
   into a band with the logo and the wordmark; the panel is the page.
   ONE authored moment: the thread's arrival. Reduced motion = all shown.
   ================================================================= */

/* -- The page behind it all ------------------------------------------ */

body:has(.login-wrapper) {
    background: color-mix(in oklab, var(--theme-nav-background) 16%, black) !important;
}

/* THE scroll container for the whole auth flow. `html`/`body` are
   `overflow: hidden` (see BlazorConventions "the document never scrolls"),
   so if this element does not scroll, NOTHING does - anything below the
   fold is clipped and unreachable.
   `min-height: 0` (not `100vh`) is load-bearing twice over: a flex item
   whose min-height exceeds its container grows to fit its content instead
   of scrolling it, and on iOS `100vh` is taller than the visible area
   (it excludes the URL/toolbar chrome), so 100vh guarantees a fold no
   swipe can reach. `flex: 1` + `min-height: 0` sizes it to the real
   viewport and hands the overflow to `overflow-y`. */
.login-wrapper {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--theme-text-muted) 45%, transparent) transparent;
}

.login-wrapper::-webkit-scrollbar,
.login-body .login-scroll-list::-webkit-scrollbar {
    width: 6px;
}

.login-wrapper::-webkit-scrollbar-track,
.login-body .login-scroll-list::-webkit-scrollbar-track {
    background: transparent;
}

.login-wrapper::-webkit-scrollbar-thumb,
.login-body .login-scroll-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--theme-text-muted) 45%, transparent);
    border-radius: 3px;
}

/* -- The frame: stage + panel ----------------------------------------- */

.signin {
    --signin-night: color-mix(in oklab, var(--theme-nav-background) 22%, black);
    --signin-white: color-mix(in srgb, white 100%, transparent);
    --signin-ink: color-mix(in srgb, white 94%, transparent);
    --signin-ink-soft: color-mix(in srgb, white 72%, transparent);
    --signin-ink-faint: color-mix(in srgb, white 46%, transparent);
    --signin-rule: color-mix(in srgb, white 13%, transparent);
    --signin-ease: cubic-bezier(.16, 1, .3, 1);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100%;
}

@media (min-width: 1024px) {
    .signin {
        grid-template-columns: minmax(0, 1.38fr) minmax(420px, 1fr);
    }
}

/* -- THE STAGE ---------------------------------------------------------- */

.signin-stage {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: clamp(28px, 4vh, 44px);
    overflow: hidden;
    padding: clamp(32px, 5vh, 56px) clamp(32px, 4.5vw, 72px) clamp(28px, 4vh, 44px);
    background:
        radial-gradient(75% 65% at 6% 0%, color-mix(in oklab, var(--conv-ask) 46%, transparent), transparent 70%),
        radial-gradient(55% 45% at 78% 48%, color-mix(in oklab, var(--conv-say) 16%, transparent), transparent 75%),
        radial-gradient(65% 75% at 100% 100%, color-mix(in oklab, var(--conv-flow) 38%, transparent), transparent 72%),
        var(--signin-night);
    color: var(--signin-ink);
}

/* The builder canvas's dot grid - the surface conversations are drawn on -
   fading out toward the words. */
.signin-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(color-mix(in srgb, white 11%, transparent) 1px, transparent 1.5px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(115deg, transparent 18%, var(--signin-white) 62%);
    mask-image: linear-gradient(115deg, transparent 18%, var(--signin-white) 62%);
    pointer-events: none;
}

.signin-stage ::selection {
    background: color-mix(in oklab, var(--conv-ask) 60%, transparent);
    color: var(--signin-white);
}

.signin-stage-mark {
    display: flex;
    align-items: center;
}

.signin-listrak {
    display: block;
    width: 140px;
    height: auto;
}

.signin-stage-hero {
    max-width: 640px;
}

.signin-word {
    margin: 0;
    color: var(--signin-ink);
    font-size: clamp(56px, 6.6vw, 96px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: .94;
}

.signin-claim {
    max-width: 30ch;
    margin: 18px 0 0;
    color: var(--signin-ink-soft);
    font-size: clamp(17px, 1.3vw, 21px);
    font-weight: 450;
    line-height: 1.4;
    text-wrap: balance;
}

/* -- The conversation that types itself in ------------------------------ */

.signin-thread {
    display: flex;
    align-self: center;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 540px);
}

.signin-turn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    animation: signin-rise 560ms var(--signin-ease) backwards;
}

.signin-turn:nth-child(1) { animation-delay: 350ms; }
.signin-turn:nth-child(2) { animation-delay: 1250ms; }
.signin-turn:nth-child(3) { animation-delay: 2500ms; }
.signin-turn:nth-child(4) { animation-delay: 3300ms; }

.signin-bubble {
    max-width: 88%;
    padding: 12px 17px;
    border-radius: 18px 18px 18px 6px;
    font-size: 16.5px;
    line-height: 1.4;
    box-shadow: 0 6px 18px color-mix(in srgb, black 28%, transparent);
}

.signin-turn.is-say .signin-bubble {
    background: color-mix(in oklab, var(--conv-say) 82%, black);
    color: var(--signin-white);
}

.signin-turn.is-ask .signin-bubble {
    background: color-mix(in oklab, var(--conv-ask) 88%, white);
    color: var(--signin-white);
}

.signin-turn.is-person {
    align-items: flex-end;
}

.signin-turn.is-person .signin-bubble {
    border-radius: 18px 18px 6px 18px;
    background: var(--signin-white);
    color: color-mix(in oklab, var(--theme-text-emphasis) 92%, var(--conv-ask));
    font-weight: 550;
}

.signin-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.signin-chip {
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, white 34%, transparent);
    border-radius: var(--wf-radius-pill);
    color: var(--signin-ink);
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
}

/* The tap: the chosen chip fills just before the reply lands. */
.signin-chip.is-picked {
    animation: signin-tap 420ms var(--signin-ease) 2150ms both;
}

.signin-receipt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid color-mix(in oklab, var(--conv-act) 55%, transparent);
    border-radius: 14px;
    background: color-mix(in oklab, var(--conv-act) 16%, var(--signin-night));
    box-shadow: 0 8px 24px color-mix(in srgb, black 30%, transparent);
}

.signin-receipt .bi {
    color: color-mix(in oklab, var(--conv-act) 62%, white);
    font-size: 20px;
    line-height: 1;
}

.signin-receipt-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    line-height: 1.35;
}

.signin-receipt-text strong {
    color: var(--signin-ink);
    font-size: 15.5px;
    font-weight: 650;
}

.signin-receipt-text span {
    color: var(--signin-ink-soft);
}

@keyframes signin-rise {
    from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
    to { opacity: 1; transform: none; filter: none; }
}

@keyframes signin-tap {
    0% { background: transparent; color: var(--signin-ink); transform: scale(1); }
    45% { transform: scale(.94); }
    100% { border-color: var(--signin-white); background: var(--signin-white); color: var(--conv-ask-ink); transform: scale(1); }
}

/* -- The other scenes: one per built-in billboard ------------------------- */
/* Each is product UI at small scale - the same family hues, the same bubbles
   and chips - entering with the thread's stagger (.signin-turn). */

.signin-thread.is-channels,
.signin-thread.is-work {
    display: grid;
    align-items: start;
    gap: 12px;
    width: min(100%, 620px);
}

.signin-thread.is-channels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signin-thread.is-work {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

/* A channel face: the same moment, drawn the way that channel draws it. */
.signin-face {
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--signin-rule);
    border-radius: 16px;
    background: color-mix(in oklab, var(--signin-white) 6%, var(--signin-night));
    box-shadow: 0 10px 26px color-mix(in srgb, black 30%, transparent);
}

.signin-face-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--signin-ink-soft);
    font-size: 12px;
    font-weight: 600;
}

.signin-face-card,
.signin-face-page {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--theme-background);
    color: var(--theme-text-secondary);
    font-size: 12.5px;
    line-height: 1.35;
}

.signin-face-card {
    padding-bottom: 10px;
}

.signin-face-card strong,
.signin-face-card > span:not(.signin-face-art) {
    padding: 0 10px;
}

.signin-face-card strong,
.signin-face-page strong {
    color: var(--theme-text-emphasis);
    font-size: 13.5px;
    font-weight: 650;
}

.signin-face-art {
    display: grid;
    place-items: center;
    height: 56px;
    margin-bottom: 6px;
    background: color-mix(in oklab, var(--conv-act) 22%, var(--theme-background));
    color: var(--conv-act-ink);
    font-size: 24px;
}

.signin-face .signin-chip {
    padding: 6px 10px;
    font-size: 12.5px;
    text-align: center;
}

.signin-chip.is-solid {
    border-color: var(--signin-white);
    background: var(--signin-white);
    color: var(--conv-ask-ink);
}

.signin-face-bubble {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px 12px 12px 4px;
    background: color-mix(in oklab, var(--conv-ask) 42%, var(--signin-night));
    color: var(--signin-ink);
    font-size: 12.5px;
    line-height: 1.35;
}

.signin-face-bubble strong {
    font-size: 13.5px;
}

.signin-face-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid var(--signin-rule);
    color: color-mix(in oklab, var(--conv-say) 45%, var(--signin-white));
    font-size: 12.5px;
    font-weight: 600;
}

.signin-face-page {
    padding: 10px;
}

.signin-face-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    border-top: 1px solid var(--theme-border);
    color: var(--theme-text);
}

.signin-face-option .bi {
    color: var(--theme-text-placeholder);
}

.signin-face-option.is-on .bi {
    color: var(--theme-primary);
}

/* Their own words: what the AI Concierge heard, as typed answers. */
.signin-heard {
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid color-mix(in oklab, var(--conv-flow) 55%, transparent);
    border-radius: 14px;
    background: color-mix(in oklab, var(--conv-flow) 16%, var(--signin-night));
    box-shadow: 0 8px 24px color-mix(in srgb, black 30%, transparent);
}

.signin-heard-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: color-mix(in oklab, var(--conv-flow) 40%, var(--signin-white));
    font-size: 12.5px;
    font-weight: 650;
}

.signin-heard-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.signin-answer {
    padding: 6px 12px;
    border-radius: var(--wf-radius-pill);
    color: var(--signin-white);
    font-size: 13.5px;
    font-weight: 600;
}

.signin-answer em {
    margin-right: 6px;
    color: var(--signin-ink-soft);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
}

.signin-answer.is-ask { background: color-mix(in oklab, var(--conv-ask) 78%, var(--signin-night)); }
.signin-answer.is-say { background: color-mix(in oklab, var(--conv-say) 72%, var(--signin-night)); }
.signin-answer.is-flow { background: color-mix(in oklab, var(--conv-flow) 72%, var(--signin-night)); }

/* Every answer goes to work: the record, and the post the team sees. */
.signin-record {
    align-items: stretch;
    gap: 0;
    padding: 14px;
    border-radius: 14px;
    background: var(--theme-background);
    box-shadow: 0 10px 26px color-mix(in srgb, black 32%, transparent);
}

.signin-record-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--theme-text-emphasis);
    font-size: 14px;
    font-weight: 650;
}

.signin-record-head .bi {
    color: var(--theme-primary);
    font-size: 18px;
}

.signin-record-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--theme-border);
    font-size: 13px;
}

.signin-record-row em {
    color: var(--theme-text-muted);
    font-style: normal;
}

.signin-record-row strong {
    color: var(--theme-text-emphasis);
    font-weight: 600;
    text-align: right;
}

.signin-record-row strong.is-new {
    padding: 2px 8px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-primary-soft);
    color: var(--wf-primary-ink);
}

.signin-slack {
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--signin-rule);
    border-radius: 14px;
    background: color-mix(in oklab, var(--signin-white) 7%, var(--signin-night));
    box-shadow: 0 10px 26px color-mix(in srgb, black 30%, transparent);
}

.signin-slack-head {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--signin-ink-soft);
    font-size: 12.5px;
    font-weight: 650;
}

.signin-slack-post {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.signin-slack-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--conv-ask);
    color: var(--signin-white);
    font-size: 15px;
}

.signin-slack-words {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.4;
}

.signin-slack-words strong {
    color: var(--signin-ink);
    font-size: 13.5px;
}

.signin-slack-words span {
    color: var(--signin-ink-soft);
}

/* -- The billboards ------------------------------------------------------ */

.signin-billboards {
    display: grid;
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid var(--signin-rule);
}

.signin-billboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 92px;
    animation: signin-board 520ms var(--signin-ease) backwards;
}

/* A platform billboard's picture IS the scene: the stage's panel, 16:10, the size uploads are cut to. */
.signin-thread.is-picture {
    width: min(100%, 600px);
}

.signin-picture {
    position: relative;
    align-items: stretch;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--signin-rule);
    border-radius: 18px;
    background: color-mix(in oklab, var(--signin-white) 6%, var(--signin-night));
    box-shadow: 0 18px 48px color-mix(in srgb, black 45%, transparent);
}

.signin-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.signin-picture.is-broken img {
    visibility: hidden;
}

.signin-billboard-words {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.signin-billboard-title {
    margin: 0;
    color: var(--signin-ink);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.25;
    text-wrap: balance;
}

.signin-billboard-body {
    max-width: 58ch;
    margin: 0;
    color: var(--signin-ink-soft);
    font-size: 15px;
    line-height: 1.5;
}

.signin-billboard-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 4px;
    color: color-mix(in oklab, var(--conv-ask) 42%, white);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 3px;
}

.signin-billboard-link:hover {
    color: var(--signin-white);
    text-decoration-color: currentColor;
}

.signin-billboard-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.signin-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: var(--wf-radius-pill);
    background: var(--signin-ink-faint);
    cursor: pointer;
    transition: width 320ms var(--signin-ease), background-color 200ms ease;
}

.signin-dot:hover {
    background: var(--signin-ink-soft);
}

.signin-dot.is-on {
    width: 24px;
    background: var(--signin-white);
}

.signin-pause {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: 6px;
    padding: 0;
    border: 1px solid var(--signin-rule);
    border-radius: var(--wf-radius-pill);
    background: transparent;
    color: var(--signin-ink-soft);
    font-size: 14px;
    cursor: pointer;
}

.signin-pause:hover {
    border-color: var(--signin-ink-faint);
    color: var(--signin-white);
}

.signin-dot:focus-visible,
.signin-pause:focus-visible,
.signin-billboard-link:focus-visible {
    outline: 2px solid var(--signin-white);
    outline-offset: 3px;
}

@keyframes signin-board {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: none; }
}

/* -- THE PANEL: the sign-in card on the light surface -------------------- */

.signin-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: clamp(28px, 5vh, 64px) clamp(20px, 4vw, 56px);
    background: var(--theme-background);
    color: var(--theme-text);
    caret-color: var(--theme-primary);
}

.signin-panel ::selection {
    background: var(--wf-primary-soft);
    color: var(--theme-text-emphasis);
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: left;
}

.login-header {
    margin-bottom: 26px;
}

.login-workspace {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.login-workspace-logo {
    max-width: 160px;
    max-height: 40px;
    object-fit: contain;
}

.login-workspace-name {
    color: var(--theme-text-secondary);
    font-size: var(--wf-text-sm);
    font-weight: 600;
}

.login-title {
    margin: 0;
    color: var(--theme-text-emphasis);
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -0.022em;
    line-height: 1.15;
    text-wrap: balance;
}

.login-subtitle {
    margin: 8px 0 0;
    color: var(--theme-text-muted);
    font-size: 15px;
}

.login-body {
    display: flex;
    flex-direction: column;
}

.login-lede {
    margin: 0 0 18px;
    color: var(--theme-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.login-field {
    margin-bottom: 18px;
}

.login-body .form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--theme-text);
    font-size: 13px;
    font-weight: 600;
}

.login-body .form-control,
.login-body .form-select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--theme-border-subtle);
    border-radius: var(--wf-radius-sm);
    background: var(--theme-background);
    color: var(--theme-text-emphasis);
    font-size: 15px;
    transition: border-color var(--theme-transition), box-shadow var(--theme-transition);
}

.login-body .form-control::placeholder {
    color: var(--theme-text-placeholder);
}

.login-body .form-control:hover:not(:disabled):not(:focus) {
    border-color: var(--theme-text-placeholder);
}

.login-body .form-control:focus,
.login-body .form-select:focus {
    border-color: var(--theme-primary);
    outline: none;
    box-shadow: var(--theme-focus-ring);
}

.login-body .form-control:disabled {
    background: var(--theme-background-subtle);
    color: var(--theme-text-muted);
}

.login-body .login-code {
    height: 56px;
    font-family: var(--theme-font-mono);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .42em;
    text-align: center;
}

.login-hint {
    margin-top: 6px;
    color: var(--theme-text-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.login-body .validation-message {
    margin-top: 6px;
    color: var(--wf-danger-ink);
    font-size: 12.5px;
}

.login-body .validation-errors {
    margin: 0 0 14px;
    padding-left: 18px;
    color: var(--wf-danger-ink);
    font-size: 13px;
}

/* The one primary action - full width, the platform's primary. */
.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 4px;
    border-radius: var(--wf-radius-sm);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
}

.signin-panel .btn-primary.login-btn {
    border: 1px solid var(--theme-primary);
    background: var(--theme-primary);
    color: var(--theme-text-on-primary);
    box-shadow: 0 1px 2px var(--wf-shadow-ink), 0 6px 16px color-mix(in srgb, var(--theme-primary) 24%, transparent);
    transition: background-color var(--theme-transition), transform var(--theme-transition), box-shadow var(--theme-transition);
}

.signin-panel .btn-primary.login-btn:hover:not(:disabled) {
    border-color: var(--theme-primary-hover);
    background: var(--theme-primary-hover);
    box-shadow: 0 2px 4px var(--wf-shadow-ink), 0 10px 22px color-mix(in srgb, var(--theme-primary) 30%, transparent);
}

.signin-panel .btn-primary.login-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.signin-panel .btn-primary.login-btn:disabled {
    opacity: .7;
}

.signin-panel .btn-outline-secondary.login-btn {
    border: 1px solid var(--theme-border-subtle);
    background: var(--theme-background);
    color: var(--theme-text);
}

.signin-panel .btn:focus-visible {
    outline: none;
    box-shadow: var(--theme-focus-ring);
}

.login-back-link {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--wf-primary-ink);
    font-size: 13.5px;
    font-weight: 550;
    text-decoration: none;
}

.login-back-link:hover:not(:disabled) {
    color: var(--theme-primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-back-row {
    margin-top: 10px;
}

.login-link-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 16px;
}

/* -- Alerts on the panel ------------------------------------------------- */

.signin-panel .login-alert {
    margin: 0 0 18px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--wf-radius-sm);
    font-size: 13.5px;
    line-height: 1.45;
}

.signin-panel .alert-danger.login-alert {
    border-color: color-mix(in srgb, var(--theme-danger) 30%, transparent);
    background: var(--wf-danger-soft);
    color: var(--wf-danger-ink);
}

.signin-panel .alert-success.login-alert {
    border-color: color-mix(in srgb, var(--theme-success) 30%, transparent);
    background: var(--wf-success-soft);
    color: var(--wf-success-ink);
}

.signin-panel .alert-warning.login-alert {
    border-color: color-mix(in srgb, var(--theme-warning) 34%, transparent);
    background: var(--wf-warning-soft);
    color: var(--wf-warning-ink);
}

/* -- The pickers (a contact for the code, a workspace) ------------------- */

/* A picker with an unbounded row count caps its own height and scrolls
   itself - fifteen workspaces must never push Continue off a phone. */
.login-body .login-scroll-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(320px, 46vh);
    margin-bottom: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.login-body .list-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--theme-border);
    border-radius: var(--wf-radius-sm);
    background: var(--theme-background);
    color: var(--theme-text);
    font-size: 14.5px;
    text-align: left;
    transition: border-color var(--theme-transition), background-color var(--theme-transition);
}

.login-body .list-group-item:hover:not(:disabled) {
    border-color: var(--theme-border-subtle);
    background: var(--theme-background-subtle);
}

.login-body .list-group-item.active {
    border-color: var(--theme-primary);
    background: var(--wf-primary-soft);
    color: var(--theme-text-emphasis);
    font-weight: 600;
}

.login-body .list-group-item:disabled {
    color: var(--theme-text-muted);
}

.login-body .list-group-item:focus-visible {
    outline: none;
    box-shadow: var(--theme-focus-ring);
}

.login-contact-value,
.login-list-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.login-check {
    flex: none;
    color: var(--theme-primary);
    font-size: 18px;
}

.login-locked {
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-danger-soft);
    color: var(--wf-danger-ink);
    font-size: 11.5px;
    font-weight: 600;
}

/* -- Done / waiting states ----------------------------------------------- */

.login-done {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.login-done-icon {
    margin-bottom: 14px;
    color: var(--theme-primary);
    font-size: 40px;
    line-height: 1;
}

.login-done-icon.is-good {
    color: var(--theme-success);
}

.login-done-icon.is-warn {
    color: var(--theme-accent);
}

.login-done-heading {
    margin: 0 0 6px;
    color: var(--theme-text-emphasis);
    font-size: 18px;
    font-weight: 650;
}

.login-spinner {
    width: 28px;
    height: 28px;
    margin-bottom: 14px;
    color: var(--theme-primary);
}

.login-callout {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: var(--wf-radius-sm);
    background: var(--theme-background-subtle);
}

.login-callout-label {
    color: var(--theme-text-muted);
    font-size: 12.5px;
}

.login-callout-value {
    color: var(--theme-text-emphasis);
    font-size: 17px;
    overflow-wrap: anywhere;
}

/* -- The step counter and the foot -------------------------------------- */

.login-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    color: var(--theme-text-muted);
    font-size: 12.5px;
}

.login-steps {
    display: inline-flex;
    gap: 4px;
}

.login-step-pip {
    width: 18px;
    height: 4px;
    border-radius: var(--wf-radius-pill);
    background: var(--theme-border);
}

.login-step-pip.is-done {
    background: var(--theme-primary);
}

.signin-legal {
    margin: 0;
    color: var(--theme-text-muted);
    font-size: 12px;
}

/* The free trial (2026-11-24): where the "by Listrak" line was - a quiet link in the panel's own link ink, a new tab. */
.signin-trial {
    margin: 0;
    font-size: 13.5px;
    text-align: center;
}

.signin-trial a {
    color: var(--wf-primary-ink);
    font-weight: 600;
    text-decoration: none;
}

.signin-trial a:hover,
.signin-trial a:focus-visible {
    color: var(--theme-primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* iOS Safari zooms the page in on focus of any input under 16px and never
   zooms back out - the whole flow then renders over-size with the card's
   right edge off screen. Sized in px on purpose: rem would track a tenant
   font scale back under the threshold. */
@media (pointer: coarse) {
    .login-body .form-control,
    .login-body .form-select {
        font-size: 16px;
    }
}

/* -- Under 1024px: the stage folds into a band --------------------------- */

@media (max-width: 1023.98px) {
    .signin {
        grid-template-rows: auto 1fr;
    }

    .signin-stage {
        grid-template-rows: auto;
        grid-auto-flow: column;
        justify-content: space-between;
        align-items: end;
        gap: 16px;
        padding: 22px clamp(20px, 5vw, 40px) 20px;
    }

    /* Scoped through the stage so it outranks every scene's own display
       (.signin-thread.is-channels / .is-work set grid) - the band is the
       logo and the wordmark, nothing else. */
    .signin-stage .signin-thread,
    .signin-stage .signin-billboards,
    .signin-stage .signin-claim {
        display: none;
    }

    .signin-listrak {
        width: 104px;
    }

    .signin-word {
        font-size: 30px;
        letter-spacing: -0.03em;
    }

    .signin-panel {
        justify-content: flex-start;
        padding: 32px clamp(20px, 6vw, 48px) 28px;
    }
}

@media (max-width: 360px) {
    .signin-stage {
        padding: 18px 16px 16px;
    }

    .signin-word {
        font-size: 26px;
    }

    .signin-panel {
        padding: 26px 16px 22px;
    }

    .login-title {
        font-size: 24px;
    }
}

/* -- THE SCREEN SAVER (docs/claude/AUTH.md "The screen saver") ------------
   The same stage over a signed-in Portal, full screen, one column. Above
   every dialog and dock; .is-leaving (screensaver.js) takes it away at once
   while .NET removes it. */

.signin.signin-saver {
    position: fixed;
    inset: 0;
    z-index: 2000;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    outline: none;
    cursor: none;
    animation: signin-saver-in 900ms var(--signin-ease) both;
}

.signin-saver .signin-stage {
    min-height: 100%;
    padding: clamp(40px, 7vh, 88px) clamp(40px, 7vw, 120px) clamp(36px, 6vh, 72px);
}

.signin-saver .signin-stage-hero {
    max-width: 760px;
}

.signin-saver.is-leaving {
    opacity: 0;
    transition: opacity 120ms linear;
    pointer-events: none;
}

.signin-saver-hint {
    position: absolute;
    left: 50%;
    bottom: clamp(16px, 3vh, 28px);
    margin: 0;
    transform: translateX(-50%);
    color: var(--signin-ink-faint);
    font-size: 13px;
    letter-spacing: 0.01em;
    white-space: nowrap;
    pointer-events: none;
}

@keyframes signin-saver-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* -- Less motion: everything simply there -------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .signin-turn,
    .signin-chip.is-picked,
    .signin-billboard {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }

    .signin-chip.is-picked {
        border-color: var(--signin-white);
        background: var(--signin-white);
        color: var(--conv-ask-ink);
    }

    .signin-dot {
        transition: none;
    }

    .signin.signin-saver {
        animation: none;
    }
}
