/* Shared chrome of the two sign-in pages (trainee-login.html, admin-login.html): the split card,
   the visual panel and the form styles. The blocks were byte-identical copies in each page's <style>.
   registration.html keeps its own tuned variant (wider card, selects, field rows). Loads AFTER
   styles.css: the body rules below undo its app-shell height lock. */
    :root {
        --navy: #0f2148; --navy-deep: #081226; --navy-mid: #132a5c;
        --orange: #f97316; --orange-soft: #fb923c; --slate: #334155; --paper: #faf8f4;
    }
    * { box-sizing: border-box; }
    body {
        margin: 0; font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
        background: var(--paper); color: var(--navy); -webkit-font-smoothing: antialiased;
        /* styles.css (shared with core.html) sets body to height:100vh +
           overflow:hidden for its own fixed "app shell" layout — this page
           has no matching inner scroll container, so left as-is, this
           silently blocks the page from scrolling if content ever exceeds
           the viewport height. */
        height: auto; overflow: visible;
    }
    /* The sign-in card is small and sits in the lower left; the navy panel with the rings fills the rest. */
    .auth-shell {
        min-height: 100vh; display: grid; grid-template-columns: minmax(0, 430px) 1fr;
    }
    .auth-form-side { order: -1; }

    .auth-visual {
        position: relative; background: var(--navy-deep); overflow: hidden;
        display: flex; flex-direction: column; justify-content: space-between; padding: 40px;
    }
    .auth-rings { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 520px; height: 520px; opacity: 0.85; pointer-events: none; }
    .back-link {
        position: relative; z-index: 1; color: rgba(255,255,255,0.6); font-size: 13px; font-weight: 600;
        text-decoration: none; display: inline-flex; align-items: center; gap: 6px; width: fit-content;
        transition: color 0.15s ease;
    }
    .back-link:hover { color: #fff; }
    .visual-copy { position: relative; z-index: 1; }
    .visual-copy .badge {
        display: inline-flex; align-items: center; gap: 8px; background: rgba(249,115,22,0.15);
        color: #fdba74; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
        text-transform: uppercase; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
    }
    .visual-copy h1 { color: #fff; font-size: 32px; font-weight: 800; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
    .visual-copy p { color: rgba(255,255,255,0.55); font-size: 14px; line-height: 1.6; max-width: 340px; margin: 0; }
    /* 35% white on the navy panel is 3.19:1; 60% is 7.14:1 and still reads
       as fine print rather than body copy. */
    .visual-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,0.6); }

    /* Under 860px the rings panel is dropped and the card gets the full width.
       This block has to sit BELOW the .auth-visual rules above: it used to be
       declared before them, and `display:flex` on the same specificity won on
       source order alone, so the panel never actually hid on a phone. */
    @media (max-width: 860px) { .auth-shell { grid-template-columns: 1fr; } .auth-visual { display: none; } }

    .auth-form-side { display: flex; align-items: flex-end; justify-content: flex-start; padding: 40px 32px 48px; }
    .auth-card { width: 100%; max-width: 340px; }
    .auth-card-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
    @media (max-width: 860px) { .auth-form-side { align-items: center; justify-content: center; padding: 32px 20px; } }
    .auth-card-mark {
        width: auto; height: auto; border-radius: 10px; background: #c3cfe0; padding: 6px 12px; box-sizing: border-box;
        display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
    }
    /* Slate, the same colour the top bars' panel is at full strength. The navy chip that
       used to be here swallowed the logo's navy half and its wordmark; the white card
       behind it would swallow the logo's white lining instead. It does not fade out the
       way the bars' panel does: a chip is only as wide as the logo, so there is no run of
       bar for it to fade into, and fading would drop the lining at the logo's right. The
       height matches the bars, so the wordmark is as legible here as it is there. */
    .auth-card-mark img { height: 54px; width: auto; display: block; }
    .auth-card-brand span { font-weight: 800; font-size: 14px; color: var(--navy); }
    .auth-card h2 { font-size: 20px; font-weight: 800; margin: 0 0 5px; color: var(--navy); }
    .auth-card .sub { font-size: 12.5px; line-height: 1.5; color: var(--slate); margin: 0 0 18px; }

    .auth-msg {
        font-size: 12px; font-weight: 700; padding: 10px 14px; border-radius: 10px;
        margin-bottom: 16px; display: none;
    }
    .auth-msg.error { display: block; background: #fef2f2; color: #b91c1c; }
    .auth-msg.success { display: block; background: #f0fdf4; color: #166534; }
    .auth-msg.info { display: block; background: #eff6ff; color: #1d4ed8; }

    .field { margin-bottom: 12px; }
    .field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--navy); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
    .field input {
        width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 10px;
        font-size: 13.5px; font-family: 'IBM Plex Sans', sans-serif; outline: none; color: var(--navy);
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }
    .field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,0.12); }
    .field input::placeholder { color: #cbd5e1; }

    .auth-submit {
        width: 100%; padding: 11px; border-radius: 999px; border: none; background: var(--navy);
        color: var(--orange); font-weight: 800; font-size: 13px; text-transform: uppercase;
        letter-spacing: 0.04em; cursor: pointer; margin-top: 6px;
        transition: background 0.2s ease, transform 0.12s ease;
    }
    .auth-submit:hover { background: var(--navy-mid); transform: translateY(-1px); }
    .auth-submit:active { transform: translateY(0) scale(0.98); }
    .auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

    .auth-switch { text-align: center; font-size: 12px; color: var(--slate); margin-top: 14px; }
    .auth-forgot { text-align: right; font-size: 12px; margin: -4px 0 12px; }
    .auth-forgot a { color: var(--slate); font-weight: 600; text-decoration: underline; }
    .auth-forgot a:hover { color: var(--orange); }
    .auth-pw-lead { font-size: 12.5px; color: var(--slate); line-height: 1.5; margin: 0 0 12px; }
    /* A link on the white sign-in card, not on navy: --orange is 2.80:1 on
       white. This is the brand's orange darkened to clear AA (5.18:1). */
    .auth-switch a { color: #c2410c; font-weight: 700; text-decoration: none; cursor: pointer; }
    .auth-switch a:hover { text-decoration: underline; }
    .role-switch { text-align: center; margin-top: 10px; }
    .role-switch a { font-size: 12px; color: var(--slate); text-decoration: none; }
    .role-switch a:hover { color: var(--navy); }
    /* Log in as: Trainee | Admin. Each half is a link to that sign-in page. */
    .role-tabs { display: flex; gap: 4px; padding: 3px; margin-bottom: 14px; background: #f1f5f9; border-radius: 999px; }
    .role-tabs a { flex: 1; text-align: center; padding: 6px 0; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--slate); text-decoration: none; }
    .role-tabs a:hover { color: var(--navy); }
    .role-tabs a.on { background: var(--navy); color: #fff; cursor: default; }

/* ---------------------------------------------------------------------------
   Both sign-in pages (<body class="auth-compact-right">): a small card in the
   lower RIGHT corner, over the navy rings panel.

   The panel is the page here, not a column beside one. The two-column version
   of this gave the card its own full-height paper column, and a 250px card at
   the bottom of it left most of that column empty — the blank space above the
   box. Letting the panel fill the viewport and floating the card over its
   corner removes the empty column rather than trying to shrink it, and it
   behaves the same at every width, so there is no breakpoint at which the box
   moves somewhere else.
   --------------------------------------------------------------------------- */
    body.auth-compact-right .auth-shell {
        display: block; position: relative; min-height: 100vh;
    }
    /* Full bleed, behind everything, at every width — this is the background now. */
    body.auth-compact-right .auth-visual {
        display: flex; position: absolute; inset: 0; z-index: 0;
    }
    body.auth-compact-right .auth-form-side {
        position: relative; z-index: 1; order: 0; min-height: 100vh;
        display: flex; align-items: flex-end; justify-content: flex-end;
        padding: 40px 32px 44px;
        /* This column covers the whole viewport over the panel, so it must let
           clicks through — otherwise it swallows "Go to Main Portal". */
        pointer-events: none;
    }
    /* The card floats on the panel now, so it has to bring its own surface:
       on paper it needed none. */
    body.auth-compact-right .auth-card {
        pointer-events: auto;
        max-width: 250px; background: #fff; border-radius: 16px;
        padding: 22px 20px; box-shadow: 0 24px 60px -20px rgba(8, 18, 38, .65);
    }

    /* ~25-30% smaller throughout, so the card reads as compact rather than
       just narrow: a 250px card with full-size type would look cramped. */
    body.auth-compact-right .auth-card-brand { gap: 8px; margin-bottom: 14px; }
    body.auth-compact-right .auth-card-mark { border-radius: 8px; padding: 5px 9px; }
    body.auth-compact-right .auth-card-mark img { height: 44px; }
    body.auth-compact-right .auth-card-brand span { font-size: 12px; }
    body.auth-compact-right .auth-card h2 { font-size: 15.5px; margin-bottom: 4px; }
    body.auth-compact-right .auth-card .sub { font-size: 10.5px; margin-bottom: 13px; }
    body.auth-compact-right .auth-msg { font-size: 10.5px; padding: 8px 11px; border-radius: 8px; margin-bottom: 12px; }
    body.auth-compact-right .field { margin-bottom: 9px; }
    body.auth-compact-right .field label { font-size: 9.5px; margin-bottom: 4px; }
    body.auth-compact-right .field input { padding: 8px 10px; border-radius: 8px; font-size: 11.5px; }
    body.auth-compact-right .auth-submit { padding: 9px; font-size: 11px; margin-top: 4px; }
    body.auth-compact-right .auth-switch { font-size: 10.5px; margin-top: 11px; }
    body.auth-compact-right .role-switch { margin-top: 8px; }
    body.auth-compact-right .role-switch a { font-size: 10.5px; }
    body.auth-compact-right .role-tabs { margin-bottom: 12px; }
    body.auth-compact-right .role-tabs a { font-size: 10.5px; padding: 5px 0; }
    /* The unlock form shown when the site is locked uses its own inline error
       box, so match it to the compact scale here too. */
    body.auth-compact-right #unlock-error { font-size: 10.5px; padding: 8px 11px; border-radius: 8px; margin-bottom: 12px; }

    /* Narrow: the headline and the footer line would wrap into a wall of text
       behind the card, so the panel keeps only its rings and the way back. The
       card itself stays exactly where it is — same corner, every width. */
    @media (max-width: 860px) {
        body.auth-compact-right .auth-visual { padding: 20px; }
        body.auth-compact-right .visual-copy,
        body.auth-compact-right .visual-foot { display: none; }
        body.auth-compact-right .auth-form-side {
            align-items: flex-end; justify-content: flex-end; padding: 24px 18px 28px;
        }
    }
    /* A short window (a laptop with the browser half-height, or landscape on a
       phone) is the one case where the card can be taller than the viewport.
       Let the page scroll then instead of clipping the Log in button. */
    @media (max-height: 520px) {
        body.auth-compact-right .auth-shell,
        body.auth-compact-right .auth-form-side { min-height: 0; }
        body.auth-compact-right .auth-visual { position: fixed; }
    }

    /* show-password.js wraps each password box and drops an inline-styled
       "Show" button into it. Inline styles win on specificity alone, hence
       !important: at the compact scale the stock 12px button and its 64px of
       reserved padding crowd the field. The input is matched through its
       injected wrapper rather than [type="password"], which stops applying
       the moment the button toggles the box to type="text". */
    body.auth-compact-right .field > span > input { padding-right: 50px !important; }
    body.auth-compact-right .field > span > button { font-size: 10px !important; padding: 3px 7px !important; right: 5px !important; }
