/*
    Before signing in (AuthShell): head office's sign in and set your password, and the Conexio console's. Switchboard's sign-in, itself Pillarbox's, in Docket's
    navy (2026-12-01). Two columns: the stage, a navy card with a picture of labels going from head office to a shop's
    printer, and the page's own card beside it, with who it is for at the top and whose it is at the foot. One column
    below 860px, the stage above the card and its picture left out.
*/
.auth-shell {
    --stage: #14264a;
    --stage-deep: #0d1a35;
    --stage-ink: #ffffff;
    --stage-muted: #c3cde3;
    --stage-faint: #8d9cbd;
    --stage-line: rgba(255, 255, 255, 0.16);
    --stage-accent: #8cb4ff;
    /* Its own, so it looks the same in both apps whatever their sheets say. */
    --auth-ink: #1f2937;
    --auth-muted: #4b5563;
    --auth-line: #e5e7eb;
    --auth-accent: #1f3864;

    min-height: 100vh;
    display: grid;
    font-family: "Segoe UI", system-ui, sans-serif;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: clamp(28px, 5vw, 72px);
    padding: clamp(10px, 1.4vw, 18px);
    background:
        radial-gradient(110% 80% at 100% 0%, rgba(31, 56, 100, 0.07), transparent 60%),
        #f4f6fa;
}

.auth-shell > .auth-brand { grid-column: 1; grid-row: 1 / -1; min-width: 0; }
.auth-shell > .auth-card { grid-column: 2; grid-row: 2; align-self: center; justify-self: center; }
.auth-shell > .auth-top { grid-column: 2; grid-row: 1; justify-self: end; padding: 12px 16px 0 0; }
.auth-shell > .auth-foot {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px 16px;
    font-size: 13px;
    color: var(--auth-muted);
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--auth-line);
    background: #fff;
    font-size: 13px;
    color: var(--auth-muted);
}
.auth-pill svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* The stage: a navy card with a picture on it, rather than a column of words. */
.auth-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 3.2vh, 34px);
    padding: clamp(22px, 3.6vw, 52px);
    border-radius: 14px;
    color: var(--stage-ink);
    background: linear-gradient(160deg, var(--stage) 0%, var(--stage-deep) 100%);
    box-shadow: 0 12px 32px rgba(13, 26, 53, 0.25);
}

/* A faint dot grid, fading towards the edges, so the ground reads as a surface. */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(85% 75% at 60% 50%, #000 20%, transparent 80%);
    mask-image: radial-gradient(85% 75% at 60% 50%, #000 20%, transparent 80%);
}

.auth-glow {
    position: absolute;
    z-index: -1;
    width: 60%;
    aspect-ratio: 1;
    right: -18%;
    top: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140, 180, 255, 0.22) 0%, transparent 65%);
    filter: blur(18px);
    animation: auth-drift 14s ease-in-out infinite alternate;
}
@keyframes auth-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-14%, 24%) scale(1.15); }
}

.auth-lockup { display: flex; align-items: center; gap: 12px; }
.auth-mark { flex: none; fill: none; stroke: var(--stage-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-word { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }

.auth-pitch { display: flex; flex-direction: column; gap: 16px; }
.auth-headline {
    margin: 0;
    max-width: 18ch;
    font-size: clamp(28px, 3.1vw, 44px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    text-wrap: balance;
}
.auth-headline em { font-style: normal; color: var(--stage-muted); }
.auth-tagline { margin: 0; max-width: 50ch; font-size: 15px; line-height: 1.55; color: var(--stage-muted); text-wrap: pretty; }

/* The picture takes whatever height the words leave, and scales to fit it. */
.auth-scene { position: relative; flex: 1 1 auto; min-height: 300px; }
.auth-post { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.auth-post text { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11px; letter-spacing: 0.04em; fill: var(--stage-muted); }

.auth-lanes use { fill: none; stroke: var(--stage-line); stroke-width: 1.2; }
.auth-senders circle { fill: var(--stage-faint); }

/* A label travelling its line into the printer. Each carries its own line, pace and start (below). */
.auth-item {
    --lane: none;
    --t: 4.5s;
    --d: 0s;
    fill: var(--stage-deep);
    stroke: var(--stage-accent);
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    offset-path: var(--lane);
    offset-rotate: 0deg;
    animation: auth-travel var(--t) linear infinite;
    animation-delay: var(--d);
}
@keyframes auth-travel {
    0% { offset-distance: 0%; opacity: 0; transform: scale(0.85); }
    8% { opacity: 1; transform: scale(1); }
    88% { opacity: 1; transform: scale(1); }
    100% { offset-distance: 100%; opacity: 0; transform: scale(0.6); }
}
.auth-item-1 { --lane: path('M88 52 C 200 52, 250 140, 312 148'); --t: 5.2s; --d: 0s; }
.auth-item-2 { --lane: path('M88 104 C 190 104, 240 142, 312 148'); --t: 4.4s; --d: -1.7s; }
.auth-item-3 { --lane: path('M88 150 C 180 150, 240 148, 312 148'); --t: 3.8s; --d: -0.6s; }
.auth-item-4 { --lane: path('M88 196 C 190 196, 240 154, 312 148'); --t: 4.9s; --d: -2.9s; }
.auth-item-5 { --lane: path('M88 246 C 200 246, 250 156, 312 148'); --t: 4.1s; --d: -3.4s; }

.auth-printer rect, .auth-printer path { fill: var(--stage-deep); stroke: var(--stage-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-printer .auth-light { fill: var(--stage-accent); stroke: none; }
.auth-printer .auth-light-ring {
    fill: none;
    stroke: var(--stage-accent);
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    animation: auth-ring 2.4s ease-out infinite;
}
@keyframes auth-ring {
    0% { transform: scale(0.4); opacity: 0.9; }
    100% { transform: scale(2.2); opacity: 0; }
}
/* The label comes out of the printer, is torn off, and the next one follows. */
.auth-label-out rect { fill: #ffffff; stroke: var(--stage-accent); }
.auth-label-out path { stroke: var(--stage-deep); stroke-width: 1.4; fill: none; }
.auth-label-out .auth-barcode { stroke-width: 1.1; }
.auth-label-out { animation: auth-feed 3s ease-in-out infinite; }
@keyframes auth-feed {
    0% { transform: translateY(-30px); opacity: 0; }
    15% { opacity: 1; }
    55%, 80% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(14px); opacity: 0; }
}

.auth-outcome { --o: 0s; animation: auth-report 9s ease-in-out infinite; animation-delay: var(--o); }
.auth-outcome-2 { --o: -3s; }
.auth-outcome-3 { --o: -6s; }
.auth-outcome circle { fill: var(--stage-accent); }
@keyframes auth-report {
    0%, 28%, 100% { opacity: 0.45; }
    6%, 22% { opacity: 1; }
}
.auth-report {
    fill: none;
    stroke: var(--stage-line);
    stroke-width: 1.2;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: auth-draw 3s ease-out infinite;
}
@keyframes auth-draw {
    0% { stroke-dashoffset: 100; opacity: 0; }
    30%, 80% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Anywhere but the live service: which environment this is, before anyone signs in to the wrong one. */
.auth-env {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--stage-line);
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stage-muted);
}
.auth-env-dot { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }

/* Motion off means off: the picture stays, still. */
@media (prefers-reduced-motion: reduce) {
    .auth-glow, .auth-item, .auth-light-ring, .auth-label-out, .auth-outcome, .auth-report { animation: none; }
    .auth-item { offset-distance: 45%; opacity: 1; }
    .auth-light-ring { display: none; }
    .auth-outcome { opacity: 1; }
    .auth-report { stroke-dashoffset: 0; }
}

/* The card, to match: white, with a thread of navy along its top edge. */
.auth-card {
    position: relative;
    overflow: hidden;
    width: min(400px, 100%);
    padding: 32px 28px 24px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(13, 26, 53, 0.08);
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-accent), transparent 70%);
}
.auth-card h1 { font-size: 1.6rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.auth-card { color: var(--auth-ink); }
.auth-card label { display: block; margin: 14px 0 6px; font-weight: 600; }
.auth-card label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.auth-card input:not([type=checkbox]) { width: 100%; padding: 9px 11px; }
.auth-card input:not([type=checkbox]):focus { outline: 2px solid var(--auth-accent); outline-offset: 1px; border-color: var(--auth-accent); }
.auth-card .problem { margin-top: 14px; }
.auth-eyebrow {
    margin: 0 0 8px;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--auth-accent);
}
.auth-lede { margin: 0 0 6px; color: var(--auth-muted); line-height: 1.5; }
.auth-submit { width: 100%; margin-top: 18px; padding: 10px 14px; font-weight: 600; }
.auth-note { margin: 16px 0 0; font-size: 0.85rem; color: var(--auth-muted); line-height: 1.5; }

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; align-content: start; row-gap: 20px; }
    .auth-shell > .auth-brand,
    .auth-shell > .auth-card,
    .auth-shell > .auth-foot { grid-column: 1; grid-row: auto; width: min(480px, 100%); justify-self: center; }
    /* Who it is for stays on a phone, above the stage: on the console it is the only "Conexio staff only". */
    .auth-shell > .auth-top { grid-column: 1; grid-row: auto; width: min(480px, 100%); justify-self: center; padding: 0; text-align: right; }
    .auth-scene { display: none; }
    .auth-headline { font-size: 26px; }
    .auth-tagline { display: none; }
}
