/* =====================================================================
   10-8 Systems login / logout
   Shared by index-new.php and logout-new.php. No Bootstrap or template CSS needed.
   ===================================================================== */

/* BRAND TOKENS: set these to the 10-8systems.com Webflow style guide. */
:root {
    --brand-bg: #0a111c;          /* page / darkest surface */
    --brand-surface: #111b2a;     /* card surface */
    --brand-well: #08101a;        /* input wells */
    --brand-line: #24334a;        /* borders, dividers */
    --brand-text: #eef2f7;
    --brand-muted: #95a3b8;
    --brand-accent: #2f7bff;      /* primary buttons, >> markers, focus */
    --brand-accent-press: #1f66e6;
    --brand-on-accent: #ffffff;
    --brand-alert: #ff6b61;
    --font-display: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    --cut: 18px;                  /* cut-corner size on cards */
    --cut-sm: 12px;               /* cut-corner size on buttons */
}

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

/* ---------- Sign-out -> sign-in transition ----------
   Chrome/Edge: a cross-page view transition. The background and logo hold still, the card
   reshapes in place while its contents cross-fade, and the left-side text fades out, then in.
   Other browsers: the same idea in plain CSS (t8-leaving on sign-out, t8-arriving on sign-in). */
@view-transition { navigation: auto; }
.t8-media { view-transition-name: t8-background; }
.t8-logo { view-transition-name: t8-logo; }
.t8-clock { view-transition-name: t8-clock; }
.t8-card-wrap .t8-card { view-transition-name: t8-card; }
.t8-hero { view-transition-name: t8-hero; }

/* Still: background, logo, clock. Show the sign-out page's snapshot of them for the whole transition
   (the sign-in page may paint a frame before its script sets the background and clock); the live
   page takes over underneath with the same background, so nothing visibly changes. */
::view-transition-group(t8-background), ::view-transition-old(t8-background),
::view-transition-group(t8-logo), ::view-transition-old(t8-logo),
::view-transition-group(t8-clock), ::view-transition-old(t8-clock) { animation: none; }
::view-transition-new(t8-background), ::view-transition-new(t8-logo), ::view-transition-new(t8-clock) { display: none; }

/* Card: resizes into the sign-in card while the old contents fade out and the new fade in */
::view-transition-group(t8-card) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(t8-card), ::view-transition-new(t8-card) { height: 100%; object-fit: none; object-position: top; overflow: clip; }
::view-transition-old(t8-card) { animation: t8-vt-out .15s ease-in both; }
::view-transition-new(t8-card) { animation: t8-vt-in .28s ease-out .17s both; }

/* Left text: out, then in with a small rise */
::view-transition-group(t8-hero) { animation-duration: .45s; }
::view-transition-old(t8-hero) { animation: t8-vt-out .15s ease-in both; }
::view-transition-new(t8-hero) { animation: t8-vt-rise .36s cubic-bezier(.2, .8, .2, 1) .17s both; }

/* Anything else (notice banners, etc.) */
::view-transition-old(root) { animation: t8-vt-out .2s ease-in both; }
::view-transition-new(root) { animation: t8-vt-in .3s ease-out .08s both; }

@keyframes t8-vt-out { to { opacity: 0; } }
@keyframes t8-vt-in { from { opacity: 0; } }
@keyframes t8-vt-rise { from { opacity: 0; transform: translateY(10px); } }

/* Fallback for browsers without cross-page view transitions */
.t8-leaving .t8-hero, .t8-leaving .t8-card-inner > * { opacity: 0; transition: opacity .2s ease-in; }
.t8-arriving .t8-hero { animation: t8-vt-rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.t8-arriving .t8-card-inner > * { animation: t8-vt-rise .4s cubic-bezier(.2, .8, .2, 1) .05s both; }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .t8-leaving .t8-hero, .t8-leaving .t8-card-inner > * { transition: none; }
    .t8-arriving .t8-hero, .t8-arriving .t8-card-inner > * { animation: none; }
}
html, body { height: 100%; margin: 0; background: var(--brand-bg); }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--brand-text);
    -webkit-font-smoothing: antialiased;
}
img { user-select: none; -webkit-user-drag: none; -webkit-user-select: none; }
a { color: var(--brand-text); }
a:hover { color: var(--brand-accent); }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.t8-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Background media: night drone video, photo fallback, shade ---------- */
.t8-media { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--brand-bg); }
.t8-media-photo { position: absolute; inset: 0; background-size: cover; background-position: center; }
.t8-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.t8-shade {
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(10,17,28,.94) 0%, rgba(10,17,28,.72) 48%, rgba(10,17,28,.55) 100%),
        linear-gradient(0deg, rgba(10,17,28,.85) 0%, rgba(10,17,28,0) 40%);
}
.t8-holiday-photo .t8-shade {
    background:
        linear-gradient(90deg, rgba(10,17,28,.86) 0%, rgba(10,17,28,.5) 50%, rgba(10,17,28,.3) 100%),
        linear-gradient(0deg, rgba(10,17,28,.8) 0%, rgba(10,17,28,0) 40%);
}

/* ---------- Page layout ---------- */
.t8-layout {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
    gap: clamp(32px, 5vw, 96px);
    min-height: 100vh;
    padding: 40px clamp(24px, 6vw, 96px);
}

/* ---------- Left: hero ---------- */
.t8-stage { position: relative; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; cursor: default; }
.t8-stage canvas { position: absolute; top: 0; left: 0; }
.t8-stage-inner { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; pointer-events: none; }
.t8-stage-inner a { pointer-events: auto; align-self: flex-start; }
.t8-logo { display: block; height: 38px; width: auto; }

.t8-hero { margin: auto 0; max-width: 640px; }
.t8-holiday-photo .t8-hero { text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.t8-kicker { margin: 0 0 18px; font-family: var(--font-display); font-weight: 500; color: var(--brand-muted); }
.t8-mark { font-family: var(--font-display); font-weight: 600; color: var(--brand-accent); letter-spacing: -.02em; margin-right: .35em; }
.t8-headline, .t8-holiday-header {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.25rem, 4.2vw, 3.75rem);
    line-height: 1.04;
    letter-spacing: -.025em;
    color: var(--brand-text);
    text-wrap: balance;
}
.t8-holiday-header sup { font-size: .45em; top: -1.1em; letter-spacing: 0; }
.t8-holiday-text { margin: 18px 0 0; max-width: 46ch; font-size: 1.125rem; color: var(--brand-text); }
.t8-holiday-header:empty, .t8-holiday-text:empty { display: none; }
.t8-is-holiday .t8-headline { display: none; }

/* Colors usable in login_holidays.header / .text */
.t8c-hl-red, .t8-hl-red { color: #ff5a52; }
.t8c-hl-blue, .t8-hl-blue { color: #6e9bff; }
.t8c-hl-green, .t8-hl-green { color: #3fc07a; }
.t8c-hl-accent, .t8-hl-accent { color: var(--brand-accent); }

/* Time-of-day greeting (text chosen by login-new.js) */
.t8-hero { transition: opacity .35s ease; }
.t8-greet-pending { opacity: 0; }
.t8-greeting-quip { display: block; margin-top: .12em; color: var(--brand-accent); font-size: .72em; line-height: 1.12; }
.t8-greeting-sub { margin: 18px 0 0; max-width: 36ch; text-wrap: pretty; font-size: 1.25rem; line-height: 1.45; color: var(--brand-muted); }
.t8-is-holiday .t8-greeting-sub { display: none; }

/* Live clock (bottom of the left side) */
.t8-clock { display: flex; align-items: flex-end; gap: 14px; }
.t8-clock-time { font-family: var(--font-display); font-weight: 600; font-size: 2.75rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t8-clock-colon { animation: t8-blink 2s steps(1) infinite; }
@keyframes t8-blink { 50% { opacity: .35; } }
.t8-clock-meta { display: flex; flex-direction: column; gap: 2px; padding-bottom: 3px; font-size: .875rem; line-height: 1.3; color: var(--brand-muted); }

.t8-stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; margin: 0; padding: 0; list-style: none; }
.t8-stats li { display: flex; flex-direction: column; }
.t8-stats .t8-sep { color: var(--brand-line); font-family: var(--font-display); font-size: 1.5rem; align-self: center; }
.t8-stat-num { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t8-stat-label { font-size: .8125rem; color: var(--brand-muted); }

/* ---------- Cut-corner card (used by login, logout, OTP dialog) ---------- */
.t8-card-wrap { align-self: center; display: flex; }
.t8-card {
    flex: 1;
    background: var(--brand-line);   /* 1px border that follows the cut corners */
    padding: 1px;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.t8-card-inner {
    background: var(--brand-surface);
    padding: 40px 40px 28px;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.t8-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.875rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.t8-lede { margin: 0 0 28px; color: var(--brand-muted); }

/* ---------- Form ---------- */
.t8-field { margin-bottom: 18px; }
.t8-label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 500; color: var(--brand-muted); }
.t8-input {
    display: block; width: 100%; height: 50px; padding: 0 14px;
    background: var(--brand-well); color: var(--brand-text);
    border: 1px solid var(--brand-line); border-radius: 2px;
    font: inherit; font-size: 1rem;
    -webkit-user-select: text; user-select: text;
}
.t8-input::placeholder { color: #5f6e83; }
.t8-input:focus { outline: none; border-color: var(--brand-accent); box-shadow: inset 0 0 0 1px var(--brand-accent); }
/* Username locked after the first step: reads as fixed text, not an editable box */
.t8-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.t8-change {
    padding: 0; margin: 0 0 6px; background: none; border: 0; cursor: pointer;
    font: inherit; font-size: .875rem; font-weight: 500; color: var(--brand-accent);
}
.t8-change:hover { text-decoration: underline; }
.t8-change[hidden] { display: none; }
.t8-input-wrap { position: relative; }
.t8-lock { display: none; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--brand-muted); pointer-events: none; }
.t8-field-locked .t8-lock { display: block; }
.t8-field-locked .t8-input,
.t8-field-locked .t8-input:focus {
    padding-left: 40px;
    background: rgba(255,255,255,.03);
    border: 1px dashed var(--brand-line);
    box-shadow: none;
    color: var(--brand-text);
    font-weight: 500;
    cursor: not-allowed;
}
.t8-field-locked .t8-input:-webkit-autofill,
.t8-field-locked .t8-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--brand-text);
    -webkit-box-shadow: 0 0 0 1000px #141f2e inset;
}
.t8-input:-webkit-autofill {
    -webkit-text-fill-color: var(--brand-text);
    -webkit-box-shadow: 0 0 0 1000px var(--brand-well) inset;
    caret-color: var(--brand-text);
}

.t8-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 50px; margin: 6px 0 0; padding: 0 16px;
    border: 0; border-radius: 0; cursor: pointer;
    background: var(--brand-accent); color: var(--brand-on-accent);
    font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem;
    clip-path: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm)));
}
.t8-btn:hover { background: var(--brand-accent-press); }
.t8-btn:focus-visible { outline: 2px solid var(--brand-on-accent); outline-offset: -5px; }
.t8-btn[disabled] { cursor: progress; opacity: .85; }

.t8-spinner {
    display: inline-block; width: 1em; height: 1em; flex: none;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: t8-spin .7s linear infinite;
}
@keyframes t8-spin { to { transform: rotate(360deg); } }

.t8-error {
    margin: 0 0 14px; padding: 10px 14px;
    border-left: 3px solid var(--brand-alert);
    background: rgba(255,107,97,.09);
    color: #ffb1ab; font-size: .9375rem; line-height: 1.45;
}
.t8-error:empty { display: none; }
.t8-error a { color: #ffd0cc; text-decoration: underline; }

.t8-cjis { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--brand-line); }
.t8-cjis-title { margin: 0 0 6px; font-family: var(--font-display); font-size: .9375rem; font-weight: 600; }
.t8-cjis-body { margin: 0; font-size: .75rem; line-height: 1.55; color: var(--brand-muted); }
.t8-help { margin: 18px 0 0; font-size: .8125rem; color: var(--brand-muted); }
.t8-help a { white-space: nowrap; }

/* ---------- Two-step verification (second step inside the sign-in card) ---------- */
.t8-step[hidden] { display: none; }
.t8-step-in { animation: t8-step-in .22s ease-out; }
@keyframes t8-step-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.t8-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 0 0 22px; }
.t8-otp .t8-input {
    height: 58px; padding: 0; text-align: center;
    font-family: var(--font-display); font-weight: 600; font-size: 1.625rem;
    font-variant-numeric: tabular-nums;
}
.t8-otp-resend { margin: 20px 0 0; font-size: .9375rem; color: var(--brand-muted); }
.t8-otp-resend a { color: var(--brand-accent); }
.t8-otp-back { margin: 10px 0 0; font-size: .875rem; }
.t8-otp-back a { color: var(--brand-muted); }
.t8-otp-back a:hover { color: var(--brand-text); }

/* ---------- Sign-out page (same layout as sign-in) ---------- */
.t8-signedout { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.t8-signedout .t8-title { margin: 0; }
.t8-check {
    flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: rgba(69,212,143,.14); border: 1px solid rgba(69,212,143,.45); color: #45d48f;
}
.t8-progress { height: 3px; margin: 4px 0 8px; background: var(--brand-line); overflow: hidden; }
.t8-progress span { display: block; width: 0; height: 100%; background: var(--brand-accent); transition-property: width; transition-timing-function: linear; }
.t8-progress-text { margin: 0 0 18px; font-size: .875rem; color: var(--brand-muted); }
a.t8-btn { text-decoration: none; }
a.t8-btn:hover { color: var(--brand-on-accent); }

/* ---------- Page wrapper (notices on top, layout fills the rest) ---------- */
.t8-page { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }
.t8-page > .t8-layout { flex: 1; min-height: 0; }

/* ---------- System notices ---------- */
.t8-notices { position: relative; z-index: 3; }
.t8-notice {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 11px clamp(24px, 6vw, 96px);
    border-bottom: 1px solid;
    font-size: .9375rem; line-height: 1.45;
}
.t8-notice-text { margin: 0; flex: 1; }
.t8-notice-title { margin-right: 6px; font-weight: 600; }
.t8-notice a { color: inherit; text-decoration: underline; }
.t8-notice-close {
    flex: none; margin: -4px -8px -4px 0; padding: 2px 8px;
    background: none; border: 0; cursor: pointer;
    color: inherit; opacity: .75; font-size: 1.375rem; line-height: 1;
}
.t8-notice-close:hover { opacity: 1; }
.t8-notice-info     { background: #0f2240; border-color: #23477a; color: #cfe1ff; }
.t8-notice-info .t8-notice-title { color: #ffffff; }
.t8-notice-warning  { background: #2a2412; border-color: #5c4a1c; color: #f3dd9b; }
.t8-notice-warning .t8-notice-title { color: #ffe7a3; }
.t8-notice-critical { background: #3a1214; border-color: #7a2a2c; color: #ffd0cc; }
.t8-notice-critical .t8-notice-title { color: #ffffff; }

/* ---------- Agency co-branding (top of the sign-in card) ---------- */
.t8-agency {
    display: flex; align-items: center; gap: 16px;
    margin: 0 0 26px; padding-bottom: 22px;
    border-bottom: 1px solid var(--brand-line);
}
.t8-agency-logo {
    flex: none; display: grid; place-items: center;
    width: 64px; height: 64px;
}
.t8-agency-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.t8-agency-initials {
    border-radius: 50%;
    background: #1b2b44; border: 2px solid #3a5579;
    font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: #cfe0ff;
}
.t8-agency-text { display: flex; flex-direction: column; min-width: 0; }
.t8-agency-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; line-height: 1.25; }
.t8-agency-switch { margin-top: 2px; font-size: .8125rem; color: var(--brand-muted); }

/* Agency background photo gets the lighter shade, like holiday photos */
.t8-agency-photo .t8-shade {
    background:
        linear-gradient(90deg, rgba(10,17,28,.86) 0%, rgba(10,17,28,.5) 50%, rgba(10,17,28,.3) 100%),
        linear-gradient(0deg, rgba(10,17,28,.8) 0%, rgba(10,17,28,0) 40%);
}
.t8-agency-photo .t8-hero { text-shadow: 0 2px 18px rgba(0,0,0,.6); }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
    .t8-layout { grid-template-columns: 1fr; padding: 24px 20px 32px; gap: 24px; }
    .t8-hero { margin: 28px 0 0; }
    .t8-headline, .t8-holiday-header { font-size: 1.75rem; }
    .t8-holiday-text { font-size: 1rem; margin-top: 10px; }
    .t8-stats, .t8-clock { display: none; }
    .t8-greeting-sub { font-size: 1rem; margin-top: 10px; }
    .t8-card-inner { padding: 32px 24px 24px; }
    .t8-otp { gap: 8px; }
    .t8-notice { padding: 10px 20px; font-size: .875rem; }
    .t8-agency-logo { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
    .t8-video { display: none; }
    .t8-spinner { animation-duration: 2s; }
    .t8-step-in { animation: none; }
    .t8-clock-colon { animation: none; }
    .t8-hero { transition: none; }
}
