/*
 * Sign-in, request-reset and reset-password pages.
 * The right-hand panel (authAside.jspf) is roadstream.io only; other resellers keep their image.
 *
 * These three pages used to pull in the Tailwind browser runtime (257 KB of JavaScript that generates
 * CSS after load) to lay out a logo and a form. This file replaces it: everything the pages need is
 * here, cached, and applied before the first paint. Class names below mirror what the utilities did.
 */

/* ---------- Reset (only what the pages relied on Tailwind's preflight for) ---------- */

.auth-body,
.auth-body * { box-sizing: border-box; }
.auth-body {
    margin: 0;
    min-height: 100%;
    background: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--auth-ink);
}
/* :where() keeps these at zero specificity, so the component rules below always win */
.auth-body :where(img) { display: block; max-width: 100%; }
.auth-body :where(h1) { margin: 0; font-size: 24px; line-height: 36px; font-weight: 400; }
.auth-body :where(p, ul) { margin: 0; }
/* login.js toggles this class on the error box and on the password field's wrapper */
.auth-body .hidden { display: none !important; }

/* ---------- Page shell ---------- */

.auth-page { display: flex; min-height: 100vh; }
.auth-column {
    display: flex; flex-direction: column; flex-basis: 100%;
    padding: 40px 24px; background: #fff;
}
@media (min-width: 640px) { .auth-column { padding: 48px; } }
@media (min-width: 1024px) { .auth-column { flex-basis: 40%; min-width: 600px; } }

.auth-centre { width: 100%; margin: auto 0; }
/* the logo is lifted on its own; the matching bottom margin keeps the block's height, so the form stays put */
.auth-logo { margin: -64px 0 64px; }
.auth-logo img { width: 150px; margin: 0 auto; }
.auth-logo img.is-reseller { width: 160px; }

.auth-block { width: 100%; max-width: 350px; margin: 32px auto 0; text-align: center; }
.auth-title-block { margin-bottom: 56px; }

/* ---------- Alerts ---------- */

.auth-alert { display: flex; gap: 8px; margin: 8px 0 16px; padding: 8px; border-radius: 12px; }
.auth-alert-error { background: #fdeceb; }
.auth-alert-info { background: #e7f5ef; }
.auth-alert svg { width: 24px; height: 24px; flex: none; }
.auth-alert-error svg { color: var(--auth-alert); }
.auth-alert-info svg { color: var(--auth-moving); }
.auth-alert .error-text { text-align: left; font-weight: 300; color: var(--auth-ink); }

/* ---------- Form ---------- */

.auth-form { margin: 24px 0; }
.auth-field { display: flex; flex-direction: column; margin-bottom: 24px; }
.auth-input {
    display: block; width: 100%; padding: 6px 12px; border: 0; border-radius: 6px; background: #fff;
    font: inherit; font-size: 16px; color: var(--auth-ink); outline: 1px solid #b6c8d5; outline-offset: -1px;
}
.auth-input::placeholder { color: var(--auth-muted); }
.auth-input:focus { outline: 2px solid var(--auth-blue); outline-offset: -2px; }

.auth-button {
    display: flex; width: 100%; justify-content: center; padding: 6px 12px; border: 0; border-radius: 6px;
    background: var(--auth-deep-blue); box-shadow: 0 1px 2px rgb(0 0 0 / .05);
    font-family: inherit; font-size: 14px; line-height: 24px; font-weight: 600; color: #fff;
    text-decoration: none; cursor: pointer;
}
.auth-button:hover { background: var(--auth-blue); }
.auth-button:focus-visible { outline: 2px solid var(--auth-blue); outline-offset: 2px; }
.auth-button-link { margin: 24px 0; }

.auth-link { font-weight: 300; color: var(--auth-deep-blue); text-decoration: underline; }
.auth-link:hover { color: var(--auth-blue); }

/* ---------- Footer ---------- */

.auth-footer { min-height: 26px; text-align: center; font-size: 12px; line-height: 16px; color: var(--auth-muted); }
.auth-footer-nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-footer-nav a { color: inherit; text-decoration: none; }
.auth-footer-nav a:hover { color: var(--auth-deep-blue); }
.auth-copyright { margin-top: 12px; font-size: 10px; letter-spacing: .025em; text-transform: uppercase; color: var(--auth-muted); }

/* ---------- Reseller image (everyone except roadstream) ---------- */

.auth-image { display: none; flex-grow: 1; border-left: 1px solid var(--auth-line); background: var(--auth-navy) center / cover no-repeat; }
@media (min-width: 1024px) { .auth-image { display: block; } }

@font-face {
    font-family: "Inter";
    src: url(/fonts/inter/inter-latin-var.woff2) format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --auth-navy: #102b42;
    --auth-blue: #0878dd;
    --auth-deep-blue: #0067c2;
    --auth-ink: #163044;
    --auth-muted: #566875;
    --auth-light: #f1f6fa;
    --auth-line: #dce5ed;
    /* Fleet-panel status colours, so the illustration uses the same marker language as the app */
    --auth-moving: #1d9e75;
    --auth-idle: #ef9f27;
    --auth-parked: #888780;
    --auth-alert: #e24b4a;
}

/* ---------- Mobile app badges (left column, so they still show on phones) ---------- */

.auth-apps { display: grid; justify-items: center; gap: 10px; margin-bottom: 28px; }
.auth-apps-label { margin: 0; font-size: 12px; color: var(--auth-muted); }
.auth-apps-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.auth-store {
    display: inline-flex; align-items: center; gap: 8px; width: 138px; height: 42px; padding: 0 12px;
    background: #0b1520; color: #fff; border-radius: 8px; text-decoration: none; text-align: left;
    transition: background-color .15s ease;
}
.auth-store:hover { background: var(--auth-navy); }
.auth-store:focus-visible { outline: 2px solid var(--auth-blue); outline-offset: 2px; }
.auth-store svg { width: 20px; height: 20px; flex: none; }
.auth-store span {
    display: grid; font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 15px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em;
}
.auth-store small { font-size: 9.5px; font-weight: 400; letter-spacing: .01em; opacity: .85; }

/* ---------- Right panel ---------- */

.auth-aside {
    display: none;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px clamp(40px, 6vw, 96px);
    background: var(--auth-light);
    border-left: 1px solid var(--auth-line);
    color: var(--auth-ink);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    letter-spacing: -.01em;
    container-type: inline-size;
}
@media (min-width: 1024px) { .auth-aside { display: flex; } }
@media (min-width: 1024px) and (max-width: 1279px) { .auth-aside { padding-inline: 32px; } }
.auth-aside-inner { width: 100%; max-width: 620px; }

.auth-eyebrow {
    display: flex; align-items: center; gap: 12px; margin: 0 0 20px;
    font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
    color: var(--auth-deep-blue);
}
.auth-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--auth-blue); }

.auth-headline {
    max-width: 16ch; margin: 0;
    font-size: clamp(28px, 2.7vw, 40px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600;
    color: var(--auth-navy);
}
.auth-headline em { font-style: normal; color: var(--auth-blue); }

.auth-bullets { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.auth-bullets li { position: relative; padding-left: 30px; font-size: 15px; line-height: 1.4; color: var(--auth-muted); }
.auth-bullets li::before {
    content: ""; position: absolute; left: 2px; top: 7px; width: 12px; height: 7px;
    border-left: 2.5px solid var(--auth-blue); border-bottom: 2.5px solid var(--auth-blue); transform: rotate(-45deg);
}
.auth-note { max-width: 46ch; margin: 18px 0 0; font-size: 14px; line-height: 1.55; color: var(--auth-muted); }

/* Illustration: product mock on a tilted blue panel, same construction as the LinkedIn promo cards */
.auth-stage { position: relative; margin-top: 44px; aspect-ratio: 620 / 380; }
.auth-tilt { position: absolute; inset: 6px 8px; background: var(--auth-blue); border-radius: 8px; transform: rotate(2.5deg); }
.auth-mock {
    position: absolute; inset: 14px 18px; display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--auth-line); border-radius: 10px;
}
.auth-mock-bar {
    flex: none; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px;
    background: #f7fafc; border-bottom: 1px solid var(--auth-line);
    font-size: 12.5px; font-weight: 500; color: var(--auth-muted);
}
.auth-mock-bar .dots i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--auth-line); }
.auth-mock-bar .live { display: inline-flex; align-items: center; gap: 6px; color: var(--auth-ink); font-weight: 500; }
.auth-mock-bar .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--auth-moving); }
.auth-mock-bar .search {
    display: flex; align-items: center; gap: 6px; height: 24px; margin-left: auto; padding: 0 10px;
    background: #fff; border: 1px solid var(--auth-line); border-radius: 6px;
    font-size: 12px; font-weight: 400; color: #98a4b0;
}

.auth-mock-map { position: relative; flex: 1; background: #eef3f7; }
.auth-mock-map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-mock-map .block { fill: #e3e9ef; }
.auth-mock-map .roads-edge path { fill: none; stroke: #d5dfe8; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.auth-mock-map .roads path { fill: none; stroke: #fff; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.auth-mock-map .roads-minor path { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; }
.auth-mock-map .route { fill: none; stroke: var(--auth-blue); stroke-width: 3; stroke-dasharray: 6 5; }

.auth-mk {
    position: absolute; display: grid; place-items: center; width: 24px; height: 24px;
    border: 2px solid #fff; border-radius: 50%; transform: translate(-50%, -50%);
}
.auth-mk svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.auth-mk-moving { background: var(--auth-moving); }
.auth-mk-idle { background: var(--auth-idle); }
.auth-mk-parked { background: var(--auth-parked); color: #fff; font-size: 12px; font-weight: 500; line-height: 1; }
.auth-mk-alert { background: var(--auth-alert); }
.auth-mk-cluster { width: 32px; height: 32px; background: #fff; }
.auth-mk-cluster svg { width: 100%; height: 100%; stroke: none; }
.auth-mk-cluster b { position: absolute; font-size: 11px; font-weight: 500; color: var(--auth-navy); }

.auth-incident {
    position: absolute; right: 12px; bottom: 12px; width: 236px; overflow: hidden;
    background: #fff; border: 1px solid var(--auth-line); border-radius: 8px; font-size: 12px;
}
.auth-thumb { position: relative; height: 94px; background: #0b1a2b; }
.auth-thumb .hud {
    position: absolute; left: 8px; top: 7px;
    font-family: ui-monospace, Menlo, monospace; font-size: 9.5px; letter-spacing: .06em; color: rgba(255, 255, 255, .78);
}
.auth-thumb .tag {
    position: absolute; right: 8px; top: 7px; padding: 2px 6px; border-radius: 3px; background: var(--auth-alert);
    font-size: 9.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #fff;
}
.auth-thumb .horizon { position: absolute; left: 0; right: 0; bottom: 26px; height: 1px; background: rgba(255, 255, 255, .14); }
.auth-thumb .lane { position: absolute; left: 50%; bottom: 0; width: 2px; height: 26px; background: rgba(255, 255, 255, .35); transform: translateX(-50%); }
.auth-thumb .play {
    position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255, 255, 255, .92); transform: translate(-50%, -50%);
}
.auth-thumb .play::after {
    content: ""; position: absolute; left: 12px; top: 9px;
    border-left: 10px solid var(--auth-navy); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.auth-incident .body { padding: 9px 11px 10px; }
.auth-incident .title { font-size: 13px; font-weight: 500; color: var(--auth-ink); }
.auth-incident .meta { margin-top: 2px; color: var(--auth-muted); }
.auth-incident .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.auth-incident .link { font-weight: 500; color: var(--auth-blue); }
.auth-incident .score {
    padding: 2px 8px; border: 1px solid #cfe6fb; border-radius: 999px; background: #e8f4ff;
    font-size: 11px; font-weight: 500; color: var(--auth-deep-blue);
}

/* The panel measures itself: under ~560px of content width (viewports ~1024-1240px) the illustration simplifies */
@container (max-width: 560px) {
    .auth-stage { aspect-ratio: 620 / 420; margin-top: 32px; }
    .auth-mock-bar .search { display: none; }
    .auth-incident { width: 184px; }
    .auth-thumb { height: 68px; }
    .auth-thumb .hud { font-size: 8.5px; }
    .auth-thumb .hud-veh { display: none; }
    .auth-incident .score { display: none; }
    .auth-incident .meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) { .auth-store { transition: none; } }
