/* =============================================================================
   FlexHubs Admin — sign-in / password-reset screen styling.

   PURPOSE: an enterprise-grade, client-facing sign-in that carries the legacy
   admin's brand language (deep navy #143f72 + gold #ffb100, logo, welcome card)
   modernized into a split-panel layout. Self-contained (no external
   fonts/CDNs) so it works offline and under the portal's strict hosting model.

   WHITE-LABEL: every colour, the logo geometry and the logo position resolve
   from an --admin-* CSS variable, and the logo marks carry the ids the legacy
   BrandingCssGenerator already emits rules for (#admin-login-logo,
   #admin-company-login-logo). A tenant branding.css is linked AFTER this file
   by _LoginLayout, so its :root values and its id rules win the cascade with
   no code change here. See docs/admin-rewrite/WHITELABEL-PORT-PLAN.md §2.

   MOBILE-FIRST: the rules below build the small-screen single-column screen
   FIRST; the split panel is ADDED at (min-width: 821px). Nothing is stripped
   back for phones, so a long translation (el) wraps instead of overflowing.
   ============================================================================= */

:root {
    /* ── Brand palette ─────────────────────────────────────────────────── */
    --admin-primary: #143f72;      /* FlexLearn navy */
    --admin-primary-600: #10345d;
    --admin-primary-800: #0a1e36;
    --admin-accent: #ffb100;       /* FlexLearn gold */
    --admin-accent-600: #e39f00;
    --admin-danger: #dd1d21;
    --admin-success: #146c43;
    --admin-ink: #2d2f33;
    --admin-muted: #6b7280;
    --admin-line: #e4e7ec;
    --admin-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* ── Login surfaces (white-label overridable) ──────────────────────── */
    --admin-login-canvas: radial-gradient(1200px 600px at 10% -10%, #eef3fb 0%, #f6f8fc 40%, #eef1f6 100%);
    --admin-login-card-bg: #fff;
    --admin-login-card-radius: 18px;
    --admin-login-field-bg: #fbfcfe;
    --admin-login-field-bg-focus: #fff;
    --admin-login-focus-ring: rgba(20, 63, 114, 0.12);
    --admin-login-shadow: 0 24px 60px rgba(11, 36, 64, 0.18), 0 2px 8px rgba(11, 36, 64, 0.08);
    /* Corner glow and halo: their own tokens so the panel background carries NO
       literal colour of its own — a tenant restyles the whole surface from here. */
    --admin-login-panel-glow: rgba(255, 177, 0, 0.28);
    --admin-login-panel-glow-fade: rgba(255, 177, 0, 0);
    --admin-login-panel-halo: rgba(183, 235, 251, 0.22);
    --admin-login-panel-halo-fade: rgba(183, 235, 251, 0);
    /* Darkest stop first: the panel deepens at the top and resolves to the plain
       brand primary at the bottom, which is where the headline sits. The LIGHTEST
       stop is therefore --admin-primary, and that is the colour the hero copy is
       measured against (see .login-brand__hero p). */
    --admin-login-panel-bg:
        radial-gradient(680px 340px at 120% -10%, var(--admin-login-panel-glow) 0%, var(--admin-login-panel-glow-fade) 55%),
        linear-gradient(160deg, var(--admin-primary-800) 0%, var(--admin-primary-600) 55%, var(--admin-primary) 100%);
    --admin-login-panel-ink: #fff;
    --admin-login-panel-ink-soft: rgba(255, 255, 255, 0.82);
    --admin-login-panel-ink-faint: rgba(255, 255, 255, 0.7);

    /* ── Logo geometry + position (white-label overridable) ────────────── */
    --admin-login-logo-size: 46px;      /* height of the login-card logo mark */
    --admin-login-logo-width: 46px;     /* width; a wordmark asset sets this wider */
    --admin-login-logo-align: flex-start; /* flex-start | center | flex-end */
    --admin-login-logo-offset-x: 0px;
    --admin-login-logo-offset-y: 0px;
    --admin-login-logo-image: url("../img/flexlearn-logo.svg");
    /* The mark now sits on the white form panel, so it needs no plate; a tenant
       whose artwork is light can still set one here. */
    --admin-login-logo-plate: transparent;

    /* ── Chrome band at the top of the form panel ──────────────────────── */
    /* The chrome row is out of flow, so the form panel cannot learn how tall it
       is and has to RESERVE its band explicitly. The band therefore reads the
       tenant's OWN mark height — a tenant that ships an 88px wordmark grows the
       reserve with it — or the 44px selector, whichever is taller, and the row's
       offset and the form's top padding are both derived from these three
       values so they can never drift apart and drop the mark on the title. */
    --admin-login-chrome-top: 1rem;
    --admin-login-chrome-band: max(var(--admin-login-logo-size), 44px);
    --admin-login-chrome-gap: 1.25rem;   /* clear air below the band, incl. the selector's focus ring */
    /* The reserve itself is composed on .login-card, NOT here — see that rule. */

    /* ── Company mark in the form footer (white-label overridable) ─────── */
    /* The slot itself is #admin-company-login-logo, which the white-label
       generator already emits rules for; these are only the shipped defaults. */
    --admin-login-company-size: 28px;
    --admin-login-company-width: 28px;
    --admin-login-company-image: url("../img/flexlearn-logo.svg");

    /* ── Background illustration (white-label overridable) ─────────────── */
    --admin-login-graph-color: rgba(255, 255, 255, 0.55);
    --admin-login-graph-fill: rgba(255, 255, 255, 0.07);
    --admin-login-graph-grid: rgba(255, 255, 255, 0.12);
    --admin-login-graph-node: rgba(255, 255, 255, 0.85);
    /* The illustration's figure discs. A LIGHT disc on a dark brand panel is the
       artwork's own device and reads correctly on every palette, so the shipped
       default is plain panel ink rather than a brand colour; the token exists so
       a tenant whose panel is light can still restyle it. */
    --admin-login-figure-fill: #fff;

    /* ── Split sign-in layout defaults (white-label overridable) ───────── */
    /* Text colour on the gold sign-in button; the navy keeps it readable on gold. */
    --admin-login-cta-ink: #10345d;
    /* Light grey field outline on the white form panel. */
    --admin-login-field-border: #d7dde6;
    /* Width of the white form column beside the navy brand panel. */
    --admin-login-form-width: 470px;
    /* Translucent tile behind each feature icon on the brand panel. */
    --admin-login-feature-tile: rgba(255, 255, 255, 0.1);
    /* Outline of the language pills on the brand panel. */
    --admin-login-pill-border: rgba(255, 255, 255, 0.35);
    /* Plate behind the brand mark on the navy panel. The default mark is navy and
       gold and would vanish on navy, so it sits on white; a tenant whose artwork is
       light sets this to transparent in its own file. */
    --admin-login-brand-plate: #ffffff;
    /* ── Photo backdrop, fine dots and auras (owner rulings R5, 12/11/2026) ── */
    /* The sign-in photo, and the ONLY place the page reads it from. Three values are valid: this default
       (shipped in the build, never from a CDN; source and licence in img/login/LICENCE.md), a tenant's own
       url(...), or none for a plain panel. Nothing else names the photo file, so a later setting only has
       to override this one token. A tenant that sets none and wants its exact panel colour also sets the
       two scrim tokens below to none. */
    --admin-login-photo-image: url("../img/login/signin-default.webp");
    /* Wide screens: dark across the whole brand column (never lighter than 0.78 there, which is what the
       text contrast is measured on), then fading only under the form column, where the white card sits. */
    --admin-login-photo-scrim: linear-gradient(90deg, rgba(10, 28, 52, 0.9) 0%, rgba(10, 28, 52, 0.78) calc(100% - var(--admin-login-form-width)), rgba(10, 28, 52, 0.3) calc(100% - var(--admin-login-form-width) * 0.5), rgba(10, 28, 52, 0.1) 100%);
    /* Phones: the photo is only the header band, under one flat scrim. */
    --admin-login-photo-scrim-phone: linear-gradient(rgba(10, 28, 52, 0.72), rgba(10, 28, 52, 0.72));
    /* A photo is never painted without its scrim (owner rule 12/11/2026). These two are the scrims for a tenant's
       OWN photo: the photo setting points the two scrim tokens above at them whenever it shows a custom photo, so a
       custom photo can never appear bare. A theme sets them in its own colour; they must never be none. */
    --admin-login-photo-scrim-custom: linear-gradient(90deg, rgba(10, 28, 52, 0.9) 0%, rgba(10, 28, 52, 0.78) calc(100% - var(--admin-login-form-width)), rgba(10, 28, 52, 0.3) calc(100% - var(--admin-login-form-width) * 0.5), rgba(10, 28, 52, 0.1) 100%);
    --admin-login-photo-scrim-phone-custom: linear-gradient(rgba(10, 28, 52, 0.72), rgba(10, 28, 52, 0.72));
    /* Fine dots on the message side. 6%, not the board's 10%: 10% drops white text to 4.33:1 at an aura's brightest point. */
    --admin-login-dots: radial-gradient(rgba(255, 255, 255, 0.06) 1.4px, transparent 1.5px);
    /* The two aura colours at their centre and their transparent edge. */
    --admin-login-aura-1: rgba(183, 235, 251, 0.2);
    --admin-login-aura-1-fade: rgba(183, 235, 251, 0);
    --admin-login-aura-2: rgba(255, 177, 0, 0.12);
    --admin-login-aura-2-fade: rgba(255, 177, 0, 0);
    /* The form as a solid white card on wide screens; a tenant that keeps the full-height column sets
       inset 0, radius 0, shadow none and align stretch. */
    --admin-login-form-inset: 1.5rem;
    --admin-login-form-radius: 16px;
    --admin-login-form-shadow: 0 18px 40px rgba(6, 18, 36, 0.35);
    --admin-login-form-pad-inline: 1.875rem;
    --admin-login-form-align: center;
    /* The chosen language: a gold fill with navy ink, whatever lies behind it (gold text fails on a bright photo). */
    --admin-login-pill-active-bg: var(--admin-accent);
    --admin-login-pill-active-ink: #10345d;
}

/* ── Page canvas (mobile-first base) ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    min-height: 100dvh; /* phone browsers: excludes the collapsing URL bar */
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    /* Never let the on-screen keyboard / home indicator sit over the form. */
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    font-family: var(--admin-font);
    color: var(--admin-ink);
    /* Soft neutral canvas so the branded card carries the color. */
    background: var(--admin-login-canvas);
}

.login-card {
    /* The band the form panel keeps clear for the out-of-flow chrome row, and
       the single source both that row and the form's top padding read.
       It is composed HERE rather than in :root on purpose: a var() inside a
       custom property is substituted on the element that DECLARES it, so a
       reserve declared in :root would freeze the phone-size offsets and ignore
       the two the breakpoint re-declares on this element. */
    --admin-login-chrome-reserve:
        calc(var(--admin-login-chrome-top) + var(--admin-login-chrome-band) + var(--admin-login-chrome-gap));
    position: relative;
    display: grid;
    grid-template-columns: 1fr;   /* single column first; the panel is added below */
    width: min(960px, 100%);
    background: var(--admin-login-card-bg);
    border-radius: var(--admin-login-card-radius);
    overflow: hidden;
    box-shadow: var(--admin-login-shadow);
}

/* ── Language selector ────────────────────────────────────────────────── */
/* Top-RIGHT of the form panel: it is placed by .login-form__chrome, which is
   the row it shares with the tenant mark, so it carries no position of its own. */
.login-lang {
    flex: none;
}

.login-lang select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--admin-line);
    border-radius: 8px;
    /* >=44px tall so it is a comfortable touch target on a phone. */
    min-height: 44px;
    padding: 0.35rem 1.9rem 0.35rem 0.7rem;
    font-size: 0.85rem;
    color: var(--admin-ink);
    cursor: pointer;
    /* chevron */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.login-lang select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-login-focus-ring);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Branded story panel ──────────────────────────────────────────────── */
.login-brand {
    position: relative;
    /* The language selector no longer overlays this panel (it belongs to the
       form panel now), so the right side takes the same inset as the left. */
    padding: 1.75rem 1.5rem;
    color: var(--admin-login-panel-ink);
    background: var(--admin-login-panel-bg);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow: hidden;
}

/* Static corner glow. The promise stage is the one moving element on this
   screen, and it only fades opacity (low-CPU budget, task #84). */
.login-brand::after {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, var(--admin-login-panel-halo) 0%, var(--admin-login-panel-halo-fade) 60%);
    pointer-events: none;
}

/* The tenant brand row. It now lives at the TOP-LEFT of the FORM panel (it used
   to head the brand panel); the class name is kept because a tenant branding.css
   and the white-label plan both reference this row's geometry variables. */
.login-brand__logo {
    display: flex;
    align-items: center;
    justify-content: var(--admin-login-logo-align);
    gap: 0.85rem;
    position: relative;
    z-index: 1;
    min-width: 0;
    transform: translate(var(--admin-login-logo-offset-x), var(--admin-login-logo-offset-y));
}

/* The logo MARK. Rendered as a background image on an element carrying the id
   #admin-login-logo so a tenant branding.css replaces the artwork, the size and
   (via the vars above) the position without touching this file. role="img" +
   aria-label in the markup keep it announced. */
.login-brand__mark {
    flex: none;
    width: var(--admin-login-logo-width);
    height: var(--admin-login-logo-size);
    max-width: 100%;
    background-image: var(--admin-login-logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--admin-login-logo-plate);
    border-radius: 12px;
    /* No inset by default — the mark sits on the white form panel. A tenant that
       sets --admin-login-logo-plate can give the plate room back from here. */
    padding: 0;
    box-sizing: border-box;
}

.login-brand__name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--admin-primary);
    overflow-wrap: anywhere;
    /* The row this sits in is out of flow ABOVE the sign-in title, so the name
       may wrap (a long tenant name must not run off the side) but it may not
       make the row taller than the band the form panel reserves — that is the
       second way the mark used to land on the heading. The mark's own height is
       what the band is derived from, so it is inside it by construction. */
    max-height: var(--admin-login-chrome-band);
    overflow: hidden;
}

/* The hero copy is the part that only earns its space on a wide screen. It is
   anchored to the BOTTOM of the brand panel (margin-top: auto), above the
   product attribution line. */
.login-brand__hero {
    position: relative;
    z-index: 1;
    margin-top: auto;
    display: none;
}

.login-brand__hero h1 {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--admin-login-panel-ink);
    overflow-wrap: break-word;
}

/* CONTRAST, and the reason this rule looks under-designed: the subtitle is FULL
   panel ink with no alpha and no transparency of any kind. Measured against the
   LIGHTEST stop of the gradient (--admin-primary), 85% white composites to
   3.85:1 on the Coral palette — under the 4.5:1 floor — while full white
   measures 4.92:1. The translucent version is the natural way to build this
   panel and would ship a failure nobody catches by eye. */
.login-brand__hero p {
    margin: 0;
    color: var(--admin-login-panel-ink);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 34ch;
}

.login-brand__accent {
    height: 4px;
    width: 64px;
    background: var(--admin-accent);
    border-radius: 2px;
    margin-bottom: 1.25rem;
}

/* Full panel ink, for the same reason the subtitle is: reversing the gradient
   put this line on the LIGHTEST stop, where 70% white composites to 2.98:1 on
   the Coral palette — it used to sit on the darkest stop and get away with it. */
.login-brand__foot {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--admin-login-panel-ink);
    overflow-wrap: anywhere;
}

/* ── Credential form panel ────────────────────────────────────────────── */
.login-form {
    position: relative;               /* the chrome row below anchors to this */
    /* Top inset leaves the chrome row its own band. It is the SAME reserve the
       row is placed and sized by, not a hand-picked figure: the old 5rem/6rem
       guess was shorter than a tenant mark taller than ~64px, which is how the
       sign-in heading ended up underneath one. */
    padding: var(--admin-login-chrome-reserve) 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* The tenant mark (top-left) and the language selector (top-right) share one
   row across the top of the FORM panel. It is chrome, not form content, so it
   sits outside the measure rule below. */
.login-form__chrome {
    position: absolute;
    top: var(--admin-login-chrome-top);
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 3;
}

/* Constrain the form content to a comfortable measure and center it, so the
   inputs never stretch edge-to-edge on a wide panel. */
.login-form > *:not(.login-form__chrome) {
    width: 100%;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.login-form__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--admin-primary);
    overflow-wrap: break-word;
}

.login-form__subtitle {
    color: var(--admin-muted);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* The PIN rule list on the set-PIN step: same colour, size and spacing as the subtitle it
   replaces, with room on the left for the bullets. */
.login-pin-rules {
    color: var(--admin-muted);
    margin: 0 0 1.5rem;
    padding-left: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Fields ───────────────────────────────────────────────────────────── */
.login-field { margin-bottom: 1.15rem; }

.login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-ink);
    margin-bottom: 0.4rem;
}

.login-input-wrap { position: relative; }

/* ONE padding rule for every field, so username and password are the same
   shape. Only a wrap that actually carries an icon adds room for it — the
   previous rule padded BOTH inputs for an icon only the password field has. */
.login-field input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;               /* comfortable touch target */
    padding: 0.8rem 0.9rem;
    /* 16px: anything smaller makes iOS Safari zoom the page on focus. */
    font-size: 1rem;
    font-family: inherit;
    color: var(--admin-ink);
    border: 1.5px solid var(--admin-login-field-border);
    border-radius: 10px;
    background: var(--admin-login-field-bg);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-input-wrap--icon input {
    padding-right: 2.9rem;
}

.login-field input:focus {
    outline: none;
    background: var(--admin-login-field-bg-focus);
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-login-focus-ring);
}

.login-field__icon {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    /* >=44px square: the eye toggle is a real touch target, not a glyph. */
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    color: var(--admin-muted);
    line-height: 0;
}

.login-field__icon:hover { color: var(--admin-primary); }

.login-field__icon:focus-visible {
    outline: none;
    color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-login-focus-ring);
}

/* ── Buttons and links ────────────────────────────────────────────────── */
.login-btn {
    width: 100%;
    margin-top: 0.5rem;
    min-height: 48px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--admin-login-cta-ink);
    background: var(--admin-accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 18px rgba(255, 177, 0, 0.35);
    transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.login-btn:hover { filter: brightness(1.03); box-shadow: 0 10px 22px rgba(255, 177, 0, 0.45); }
.login-btn:active { transform: translateY(1px); }

.login-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--admin-login-focus-ring), 0 8px 18px rgba(255, 177, 0, 0.35);
}

/* Password reset entry point (the legacy "Forgot my password!" link). */
.login-links {
    margin-top: 1rem;
    text-align: center;
}

.login-link {
    display: inline-block;
    padding: 0.5rem 0.25rem;   /* keeps the tap target >=44px tall with the line box */
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--admin-primary);
    text-decoration: none;
}

.login-link:hover { text-decoration: underline; }

.login-link:focus-visible {
    outline: none;
    border-radius: 6px;
    box-shadow: 0 0 0 3px var(--admin-login-focus-ring);
}

/* PIN-step controls that must POST (ledger rows G3 "Forgot your PIN?" and G5 "Resend") rather
   than be a plain <a> — a <button> needs its native chrome reset to read as a .login-link. */
.login-link--button {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

/* ── Messages ─────────────────────────────────────────────────────────── */
.login-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fdecea;
    color: var(--admin-danger);
    border: 1px solid #f6c9c8;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.login-alert svg { flex: none; }

/* Neutral confirmation panel (password reset). Deliberately the SAME message
   for every outcome — see LEDGER-Login.md C8 (no account-enumeration oracle). */
.login-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #eaf6ef;
    color: var(--admin-success);
    border: 1px solid #bfe3cd;
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.login-notice svg { flex: none; margin-top: 0.15rem; }

.login-form__foot {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--admin-muted);
}

/* Tenant company mark in the form footer — the EXISTING #admin-company-login-logo
   slot, moved here from the brand panel. No new slot and no new endpoint: the
   white-label generator already emits rules for this id, so a configured company
   logo replaces the artwork (and a GENERATED branding.css that configures none
   emits `display: none` for the id, which outranks this rule). The shipped
   default below is what an install with no tenant branding.css renders.
   A HAND-WRITTEN tenant file carries no rule for the id and suppresses the mark
   on `.login-brand__company` instead, which is why the markup still carries that
   class — see Pages/Auth/Login.cshtml. */
.login-form__mark {
    width: var(--admin-login-company-width);
    height: var(--admin-login-company-size);
    max-width: 100%;
    margin: 0 auto 0.6rem;
    background-image: var(--admin-login-company-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.field-validation-error, .text-danger {
    color: var(--admin-danger);
    font-size: 0.82rem;
    display: block;
    margin-top: 0.35rem;
}

/* ── Footer on the login screen ───────────────────────────────────────── */
/* In normal flow on small screens so it can never sit over the card. */
.login-footer {
    width: 100%;
    text-align: center;
    color: var(--admin-muted);
}

.login-footer .app-footer {
    background: transparent;
    border: none !important;
}

.login-footer .container {
    justify-content: center !important;
}

/* ── Split sign-in layout (sign-in and password-reset pages) ───────────── */
/* Every rule in this section is scoped to the split card, so the set-password
   page, which has no brand panel, keeps its own layout. They come after the base
   rules above on purpose: the contract tests read the first match of each base
   selector, and a rule placed earlier would be the one they read. */

/* The card runs edge to edge and takes whatever height the footer leaves. The
   page is already a column flex container at full viewport height, so growing the
   card fills the window without knowing how tall the footer is. Only size, shape
   and fill are set here: position, stacking and overflow stay with the base rule
   and with tenant files that animate the page behind the card. */
.login-card.login-card--split {
    flex: 1 0 auto;
    width: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}

/* No gutter around a full-bleed card; the bottom inset keeps the footer clear of
   a phone's home indicator, as the base page rule does. */
.login-page:has(.login-card--split) {
    padding: 0 0 env(safe-area-inset-bottom, 0px);
}

/* The mark and name now sit on the navy panel. These are skin defaults at the
   weight of a bare class, so a tenant file loaded later still wins. The name was
   navy on navy; the default mark is navy and gold, so it gets a white plate with
   room around the artwork. */
:where(.login-card--split) .login-brand__name {
    color: var(--admin-login-panel-ink);
}

:where(.login-card--split) .login-brand__mark {
    background-color: var(--admin-login-brand-plate);
    background-origin: content-box;
    padding: 0.3rem;
}

/* The brand panel on the split pages: the photo under a flat scrim on phones, with the panel colours as
   the layer below, so the navy (or a tenant's colour) still shows when the image fails to load. On wide
   screens the card carries the photo instead (see the wide block). */
:where(.login-card--split) .login-brand {
    background: var(--admin-login-photo-scrim-phone), var(--admin-login-photo-image) center / cover no-repeat, var(--admin-login-panel-bg);
}

/* The two auras replace the static corner halo on the split pages. */
:where(.login-card--split) .login-brand::after {
    content: none;
}

/* Two soft auras under the text (owner ruling 12/11/2026). Only transform moves: opacity is constant,
   there is no blur filter, and they sit on layer 0 under the text blocks on layer 1. So they never repaint
   or shift the promise, never fight its 2 s swap or its 440 ms scan line, and never change its contrast
   beyond what the contrast test already measures at their brightest point. They are real elements, not
   pseudo-elements, because a tenant file uses the panel's ::before for its own mark. Hidden on phones. */
.login-brand__aura {
    display: none;
    position: absolute;
    z-index: 0;
    left: -160px;
    top: -180px;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, var(--admin-login-aura-1) 0%, var(--admin-login-aura-1-fade) 62%);
    will-change: transform;
    animation: login-aura-drift 26s ease-in-out infinite alternate;
}

/* The second aura: lower and to the right, slower, and out of step with the first. A circle gradient reaches
   its box's farthest corner, so at full drift scale the two fade out within about 251 px and 234 px of their
   centres; even on the shortest panel (560 px) their centres stay at least about 538 px apart, so they never add up. */
.login-brand__aura--two {
    left: 220px;
    top: auto;
    bottom: -240px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, var(--admin-login-aura-2) 0%, var(--admin-login-aura-2-fade) 60%);
    animation-duration: 34s;
    animation-delay: -12s;
}

@keyframes login-aura-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(36px, 28px, 0) scale(1.06); }
}

/* The headline block sits in the middle of the panel, between the mark row above
   and the language block below. The auto margins share the free height equally;
   the base rule pushed it to the bottom instead. */
:where(.login-card--split) .login-brand__hero {
    margin: auto 0;
}

/* The four product promises under the headline. The block is part of the hero,
   so it is hidden on phones together with it. */
.login-brand__features {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.login-brand__feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--admin-login-panel-ink);
    font-size: 0.95rem;
    line-height: 1.4;
}

.login-brand__feature-icon {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--admin-login-feature-tile);
    color: var(--admin-accent);
}

/* ── Promise stage (progressive enhancement) ──────────────────────────── */
/* login-promises.js adds --stage only after it has built the dots, so with no
   script the four promises above stay a plain stacked list. In stage mode every
   promise sits in the SAME grid cell: the stage is as tall as the tallest promise
   in the visitor's language (a tenant may write any length), so nothing jumps when
   the promise changes. A hidden promise uses visibility as well as opacity, which
   also takes it out of the accessibility tree and the tab order. The fade is
   150 ms because a new promise appears every 2 seconds; a longer fade would eat
   the time a visitor has to read. The outgoing promise is hidden only after its
   fade, hence the delayed visibility transition. */
.login-brand__features--stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.login-brand__features--stage .login-brand__feature {
    grid-area: 1 / 1;
    visibility: hidden;
    opacity: 0;
    font-size: 1.2rem;
    line-height: 1.35;
    position: relative;
    transition: opacity 150ms ease, visibility 0s linear 150ms;
}

/* Scan-line reveal (owner ruling 10/11/2026, option C). The new promise is wiped in
   left to right while a thin accent beam with a glowing tail rides the wipe edge;
   the outgoing promise keeps its 150 ms fade underneath. Wipe and beam share one
   duration and easing so the beam stays on the edge, and 440 ms leaves about 1.5 s
   of the 2 s cycle to read a still line. The fill mode is "backwards" so the clip is
   removed once the wipe ends. Reduced motion turns both off (see the media block). */
.login-brand__features--stage .login-brand__feature.is-active {
    visibility: visible;
    opacity: 1;
    transition: opacity 150ms ease, visibility 0s;
    animation: login-promise-wipe 440ms cubic-bezier(0.6, 0, 0.2, 1) backwards;
}

.login-brand__features--stage .login-brand__feature::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7rem;
    transform: translateX(-100%);
    border-right: 2px solid var(--admin-accent);
    background: linear-gradient(90deg, var(--admin-login-panel-glow-fade), var(--admin-login-panel-glow));
    opacity: 0;
    pointer-events: none;
}

.login-brand__features--stage .login-brand__feature.is-active::after {
    animation: login-promise-scan 440ms cubic-bezier(0.6, 0, 0.2, 1);
}

@keyframes login-promise-wipe {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes login-promise-scan {
    0% { left: 0; opacity: 1; }
    85% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* The dots sit under the stage. Each is a 44px square so it is easy to hit, and the
   visible mark is a 12px ring (filled for the current promise) drawn in the panel
   ink, so it clears the same contrast as the promise text on every tenant palette.
   The negative left margin cancels the button's own padding so the first mark lines
   up with the text above it. */
.login-brand__dots {
    display: flex;
    margin: 0.5rem 0 0 -16px;
}

.login-brand__dot {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.login-brand__dot::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border: 2px solid var(--admin-login-panel-ink);
    border-radius: 50%;
}

.login-brand__dot[aria-current="true"]::before {
    background: var(--admin-login-panel-ink);
}

.login-brand__dot:focus-visible {
    outline: 2px solid var(--admin-login-panel-ink);
    outline-offset: -6px;
}

/* The language choice stays visible on phones so a language can still be picked
   there. It is the last block in the panel, so it rests at the bottom. */
.login-brand__lang {
    position: relative;
    z-index: 1;
}

.login-brand__lang-label {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-login-panel-ink);
}

.login-lang__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Each pill is a plain link to the culture handler. The link itself is the 44px touch target and stays transparent; the visible 26px pill is drawn inside it (owner ruling 12/11/2026), so the hit area never shrinks with the look. */
.login-lang__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    color: var(--admin-login-panel-ink);
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    isolation: isolate;
}

/* The visible pill: 26px tall, centred in the 44px link, behind the link's text (isolation on the link keeps
   the -1 layer inside it). Its outline is the panel's pill border; the chosen one is filled (below). */
.login-lang__pill::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    top: 50%;
    height: 26px;
    transform: translateY(-50%);
    box-sizing: border-box;
    border: 1px solid var(--admin-login-pill-border);
    border-radius: 999px;
    pointer-events: none;
}

/* The chosen language is a gold pill with navy ink, readable on any photo; only that pill carries the attribute. */
.login-lang__pill[aria-current="true"] {
    color: var(--admin-login-pill-active-ink);
}

.login-lang__pill[aria-current="true"]::before {
    background: var(--admin-login-pill-active-bg);
    border-color: var(--admin-login-pill-active-bg);
}

.login-lang__pill:focus-visible {
    outline: 2px solid var(--admin-accent);
    outline-offset: 2px;
}

/* The reassurance line and the copyright line under the form. Muted grey on the
   white panel clears the 4.5:1 text floor. */
.login-form__secure {
    display: block;
    text-align: center;
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--admin-muted);
}

/* The lock is drawn inside the first line of the sentence, not as a flex item beside
   it. As a flex item it sat alone at the left edge of a wrapped two-line sentence;
   inline it stays with the first word on every width. */
.login-form__secure svg {
    display: inline-block;
    vertical-align: -2px;
    margin-inline-end: 0.4rem;
}

.login-form__copyright {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--admin-muted);
}

/* The split pages have no chrome row, so the form panel needs the same space above
   as below instead of the band reserved for that row. This rule covers phones; the
   wide-screen block repeats it after the base padding rule, which would otherwise
   win by coming later at the same weight. */
:where(.login-card--split) .login-form {
    padding-top: 2rem;
}

/* ── Wide screens: add the split panel ────────────────────────────────── */
@media (min-width: 821px) {
    .login-page {
        padding: 2rem 1rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    }

    .login-card {
        grid-template-columns: 1.05fr 1fr;
        min-height: 560px;
    }

    /* The band's own two figures open up at this size. They are set on the CARD
       so the row's offset and the form's top padding keep reading one source. */
    .login-card {
        --admin-login-chrome-top: 1.75rem;
        --admin-login-chrome-gap: 1.5rem;
    }

    .login-form__chrome {
        left: 3.5rem;
        right: 3.5rem;
    }

    .login-brand {
        padding: 3rem 2.75rem;
        gap: 2rem;
    }

    .login-brand__name { font-size: 1.15rem; }

    .login-brand__hero { display: block; }

    /* Same reserve, wider gutters: the inset still cannot drift from the row. */
    .login-form { padding: var(--admin-login-chrome-reserve) 3.5rem 3.25rem; }

    .login-form__title { font-size: 1.55rem; }

    /* The split card is the brand panel plus a fixed-width white form column.
       Naming the page as well keeps this ahead of the two-column rule above and of
       any tenant rule on the card, without touching position or overflow. */
    .login-page .login-card.login-card--split {
        grid-template-columns: minmax(0, 1fr) var(--admin-login-form-width);
        /* The photo fills the whole card behind the scrim; the panel colours stay underneath for a failed image. */
        background: var(--admin-login-photo-scrim), var(--admin-login-photo-image) center / cover no-repeat, var(--admin-login-panel-bg);
    }

    /* Same top padding as bottom on the split pages. It sits after the base padding
       rule on purpose: both have the same weight, so the later one wins and an
       earlier placement would bring the empty band back. */
    :where(.login-card--split) .login-form {
        padding-top: 3.25rem;
    }

    /* The brand panel turns clear so the card's photo shows through, carrying only the fine dots. */
    :where(.login-card--split) .login-brand {
        background: var(--admin-login-dots) 0 0 / 22px 22px repeat;
    }

    .login-brand__aura {
        display: block;
    }

    /* The form becomes a solid white card over the photo: never translucent, so the fields' contrast
       never depends on the picture. */
    .login-page .login-card--split .login-form {
        align-self: var(--admin-login-form-align);
        margin: var(--admin-login-form-inset);
        padding-left: var(--admin-login-form-pad-inline);
        padding-right: var(--admin-login-form-pad-inline);
        background: var(--admin-login-card-bg);
        border-radius: var(--admin-login-form-radius);
        box-shadow: var(--admin-login-form-shadow);
    }

    /* The footer stays in normal flow under the card on the split pages, so it
       never lies over the navy panel. The longer selector outranks the fixed
       footer rule below whatever the order. */
    .login-page:has(.login-card--split) .login-footer {
        position: static;
    }

    /* Pinned out of the card's way once there is vertical room for it. */
    .login-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

/* ── Reduced motion: nothing moves ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .login-btn,
    .login-field input {
        transition: none;
    }

    /* Slide changes are instant for visitors who asked for less motion. */
    .login-brand__features--stage .login-brand__feature,
    .login-brand__features--stage .login-brand__feature.is-active {
        transition: none;
        animation: none;
    }

    .login-brand__features--stage .login-brand__feature::after {
        display: none;
    }

    /* The auras stand still; the promises keep changing every two seconds (owner ruling 10/11/2026). */
    .login-brand__aura { animation: none; }
}
