        :root {
            --auth-primary: #2563eb;
            --auth-primary-dark: #1d4ed8;
            --auth-accent: #14b8a6;
            --auth-text: #0f172a;
            --auth-muted: #64748b;
            --auth-border: rgba(148, 163, 184, .28);
            --auth-card: rgba(255, 255, 255, .90);
        }

        body {
            min-height: 100vh;
            background:
                radial-gradient(circle at 8% 12%, rgba(37, 99, 235, .22), transparent 32%),
                radial-gradient(circle at 88% 10%, rgba(20, 184, 166, .22), transparent 28%),
                radial-gradient(circle at 78% 88%, rgba(124, 58, 237, .14), transparent 30%),
                linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #f0fdfa 100%);
            font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            color: var(--auth-text);
        }

        .admin-auth-wrapper {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 32px 14px;
            position: relative;
            overflow: hidden;
        }
        .auth-orb { position: absolute; border-radius: 999px; filter: blur(.5px); opacity: .75; pointer-events: none; }
        .auth-orb.one { width: 250px; height: 250px; left: -100px; bottom: 10%; background: rgba(37,99,235,.12); }
        .auth-orb.two { width: 220px; height: 220px; right: -70px; top: 8%; background: rgba(20,184,166,.14); }

        .admin-login-shell {
            width: min(1080px, 100%);
            position: relative;
            z-index: 1;
            display: grid;
            grid-template-columns: 1fr .98fr;
            background: var(--auth-card);
            border: 1px solid rgba(255,255,255,.78);
            border-radius: 36px;
            box-shadow: 0 34px 95px rgba(15, 23, 42, .20);
            backdrop-filter: blur(22px);
            overflow: hidden;
        }
        .admin-login-shell.single-panel { max-width: 560px; grid-template-columns: 1fr; }

        .admin-login-hero {
            padding: 48px 46px;
            color: #fff !important;
            background:
                radial-gradient(circle at 76% 18%, rgba(255,255,255,.18), transparent 20%),
                radial-gradient(circle at 96% 98%, rgba(96, 165, 250, .28), transparent 34%),
                linear-gradient(145deg, #111827 0%, #1e3a8a 52%, #3155b7 100%);
            position: relative;
            overflow: hidden;
        }
        .admin-login-hero::before,
        .admin-login-hero::after {
            content: "";
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, .10);
        }
        .admin-login-hero::before { width: 180px; height: 180px; right: 42px; top: 70px; }
        .admin-login-hero::after { width: 320px; height: 320px; right: -145px; bottom: -125px; }

        .brand-pill {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            padding: 10px 16px;
            border-radius: 999px;
            background: rgba(255, 255, 255, .18);
            border: 1px solid rgba(255, 255, 255, .30);
            box-shadow: 0 14px 34px rgba(0,0,0,.16);
            position: relative;
            z-index: 1;
        }
        .brand-pill img { width: 38px; height: 38px; display:block; object-fit: contain; object-position: center; border-radius: 13px; background: #fff; padding: 4px; }
        .brand-pill span { font-weight: 900; letter-spacing: .1px; color:#fff !important; text-shadow: 0 1px 8px rgba(0,0,0,.16); }

        .admin-login-hero h1 {
            margin: 54px 0 14px;
            font-size: clamp(23px, 2.45vw, 32px);
            line-height: 1.15;
            font-weight: 950;
            letter-spacing: -.7px;
            color: #ffffff !important;
            text-shadow: 0 8px 28px rgba(0,0,0,.28);
            position: relative;
            z-index: 1;
        }
        .admin-login-hero p {
            max-width: 430px;
            color: rgba(255,255,255,.88) !important;
            font-size: 16px;
            line-height: 1.78;
            position: relative;
            z-index: 1;
            text-shadow: 0 4px 16px rgba(0,0,0,.18);
        }
        .auth-feature-list { display: grid; gap: 14px; margin-top: 42px; position: relative; z-index: 1; }
        .auth-feature-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 15px 16px;
            border-radius: 20px;
            background: rgba(255,255,255,.14);
            border: 1px solid rgba(255,255,255,.22);
            box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
        }
        .auth-feature-item i { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; background: rgba(255,255,255,.18); color:#fff !important; font-size: 21px; }
        .auth-feature-item strong { display: block; color:#fff !important; font-size: 14px; font-weight: 900; }
        .auth-feature-item small { display: block; color: rgba(255,255,255,.76) !important; margin-top: 3px; }

        .admin-login-panel { padding: 50px 46px; background: rgba(255,255,255,.92); }
        .login-logo-mobile { display: none; text-align: center; margin-bottom: 18px; }
        .login-logo-mobile img { width: 82px; height: 82px; display:block; object-fit: contain; object-position: center; border-radius: 24px; padding: 8px; background:#fff; box-shadow: 0 14px 35px rgba(37,99,235,.16); margin: 0 auto; }
        .panel-brand { display:flex; align-items:center; gap:15px; padding: 15px 17px; margin-bottom: 24px; border-radius: 22px; background: linear-gradient(135deg, rgba(239,246,255,.98), rgba(240,253,250,.98)); border: 1px solid rgba(37,99,235,.14); box-shadow: 0 14px 34px rgba(15,23,42,.07); }
        .panel-brand img { width: 64px; height: 64px; display:block; object-fit: contain; object-position: center; border-radius: 20px; padding: 6px; background: #fff; box-shadow: 0 12px 28px rgba(15,23,42,.10); }
        .panel-brand strong { display:block; font-size: 18px; font-weight: 900; letter-spacing: -.2px; color: #0f172a; }
        .panel-brand small { display:block; margin-top: 4px; color: var(--auth-muted); font-size: 13px; }
        .panel-brand-badge { display:inline-flex; margin-top: 8px; padding: 5px 10px; border-radius:999px; background: rgba(37,99,235,.10); color: var(--auth-primary-dark); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
        .admin-login-title { margin-bottom: 28px; }
        .admin-login-title .eyebrow { color: var(--auth-primary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
        .admin-login-title h4 { font-size: 32px; font-weight: 950; letter-spacing: -.8px; margin-bottom: 9px; color: #111827; }
        .admin-login-title p { color: var(--auth-muted); margin-bottom: 0; line-height: 1.6; }
        .admin-login-panel .form-label { font-weight: 800; color: #334155; font-size: 13px; margin-bottom: 8px; }
        .admin-input-wrap { position: relative; display: block; }
        .admin-input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 20px; z-index: 2; }
        .admin-login-panel .form-control { min-height: 56px; border-radius: 18px; border: 1px solid var(--auth-border); padding-left: 50px; color: var(--auth-text); box-shadow: none !important; background: rgba(255,255,255,.96); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
        .admin-login-panel .form-control:focus { border-color: rgba(37,99,235,.62); box-shadow: 0 0 0 4px rgba(37,99,235,.10) !important; }
        .admin-login-panel .form-control.is-invalid { border-color: rgba(239,68,68,.55); }
        .admin-login-panel .input-group .form-control { border-right: 0; }
        .admin-login-panel .input-group-text { border-radius: 0 17px 17px 0; border-color: var(--auth-border); background: #fff !important; }
        .password-toggle-btn { border: 0; background: transparent; color: #64748b; min-width: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; }
        .auth-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
        .auth-row-actions .form-check-label { color: #475569; font-weight: 700; font-size: 13px; }
        .auth-link { color: var(--auth-primary); font-weight: 800; font-size: 13px; text-decoration: none; }
        .auth-link:hover { color: var(--auth-primary-dark); text-decoration: underline; }
        .admin-login-btn { min-height: 58px; border: 0; border-radius: 18px; color: #fff; font-weight: 950; letter-spacing: .2px; background: linear-gradient(135deg, #2563eb 0%, #06b6d4 52%, #14b8a6 100%); box-shadow: 0 18px 38px rgba(37,99,235,.28); transition: transform .18s ease, box-shadow .18s ease; }
        .admin-login-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 20px 40px rgba(37,99,235,.30); }
        .validation-summary, .auth-success { border-radius: 17px; padding: 13px 15px; margin-bottom: 18px; }
        .validation-summary { border: 1px solid rgba(239,68,68,.18); background: #fef2f2; color: #991b1b; }
        .auth-success { border: 1px solid rgba(20,184,166,.22); background: #f0fdfa; color: #0f766e; }
        .validation-summary strong, .auth-success strong { display: block; margin-bottom: 5px; }
        .validation-summary ul { margin: 0; padding-left: 18px; }
        .invalid-feedback { display: block; }
        .secure-note { display: flex; align-items: center; gap: 11px; margin-top: 24px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #f8fafc, #f1f5f9); color: var(--auth-muted); font-size: 13px; border: 1px solid rgba(226,232,240,.72); }
        .secure-note i { color: var(--auth-accent); font-size: 20px; }
        .back-login { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; }

        .admin-login-hero h1,
        .admin-login-hero p,
        .admin-login-hero strong,
        .admin-login-hero small,
        .admin-login-hero span {
            color: inherit;
        }
        .admin-login-hero h1 { color: #ffffff !important; }
        .admin-login-hero p { color: rgba(255,255,255,.88) !important; }

        @media (max-width: 900px) { .admin-login-shell { grid-template-columns: 1fr; max-width: 540px; } .admin-login-hero { display: none; } .admin-login-panel { padding: 36px 24px; } .login-logo-mobile { display: block; } .auth-row-actions { align-items: flex-start; flex-direction: column; } }


/* Agency entry points share the login action area. */
.agency-entry-actions { display: grid; gap: 13px; margin-top: 14px; text-align: center; }
.agency-entry-signup { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; padding: 12px 17px; border: 1px solid #cddcf7; border-radius: 16px; background: #f3f7ff; color: #1d4ed8; font-size: 14px; font-weight: 750; text-decoration: none; transition: background .18s ease, border-color .18s ease; }
.agency-entry-signup:hover { background: #e9f1ff; border-color: #98b9f2; color: #1d4ed8; }
.agency-entry-signup:focus-visible { outline: 3px solid #93b8ff; outline-offset: 3px; }
.agency-entry-signup span { margin-left: auto; }
.agency-entry-signup i { margin-right: auto; font-size: 19px; }

/* Responsive agency sign-in and registration, using the same auth shell. */
body.agency-auth-page { margin: 0; }
.agency-auth-page * { box-sizing: border-box; }
.agency-auth-page .admin-auth-wrapper { min-height: calc(100svh - 55px); padding: 36px 20px; overflow: hidden; }
.agency-auth-page .agency-registration-shell { width: min(1140px, 100%); grid-template-columns: .82fr 1.18fr; }
.agency-auth-page .admin-login-panel { min-width: 0; padding: 36px 38px; }
.agency-auth-page .agency-form { --blue: #2563eb; --ink: #0f172a; --muted: #64748b; }
.agency-auth-page .brand-pill { color: white; text-decoration: none; overflow-wrap: anywhere; }
.agency-auth-page .auth-feature-number { flex: 0 0 34px; display: grid; place-items: center; height: 34px; border-radius: 11px; background: #ffffff22; font-size: 12px; font-weight: 750; }
.agency-auth-page .panel-brand { margin-bottom: 24px; padding: 12px 14px; border-radius: 18px; }
.agency-auth-page .panel-brand img { width: 52px; height: 52px; border-radius: 15px; }
.agency-auth-page .panel-brand strong { overflow-wrap: anywhere; }
.agency-auth-page .panel-brand-badge { font-size: 10px; margin-top: 6px; padding: 3px 8px; }
.agency-auth-page .admin-login-title { margin-bottom: 24px; }
.agency-auth-page .admin-login-title h2 { font-size: clamp(23px, 2.2vw, 29px); font-weight: 800; line-height: 1.2; letter-spacing: -.7px; margin: 7px 0 10px; }
.agency-auth-page .admin-login-title p { font-size: 13px; }
.agency-auth-page .agency-section { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0 0 24px; }
.agency-auth-page .section-heading { margin-bottom: 20px; }
.agency-auth-page .section-heading > span { display: none; }
.agency-auth-page .section-heading h2 { font-size: 17px; margin: 0 0 5px; }
.agency-auth-page .section-heading h2:focus { outline: none; }
.agency-auth-page .section-heading p { font-size: 12px; line-height: 1.6; }
.agency-auth-page .agency-grid { gap: 18px; }
.agency-auth-page .agency-field input { min-height: 50px; border: 1px solid var(--auth-border); border-radius: 14px; background: #fff; padding: 12px 14px; font-size: 14px; }
.agency-auth-page .agency-field input:focus { outline: 3px solid #2563eb1a; border-color: #729df0; }
.agency-auth-page .agency-field input[aria-invalid="true"] { border-color: #d55b64; }
.agency-auth-page .agency-field label { font-weight: 700; font-size: 12px; }
.agency-auth-page .agency-field small { font-size: 11px; line-height: 1.5; }
.agency-auth-page .agency-button { min-height: 52px; border-radius: 15px; background: linear-gradient(135deg, #2563eb, #06b6d4 60%, #14b8a6); color: white; font-size: 14px; font-weight: 750; box-shadow: 0 10px 22px #2563eb22; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.agency-auth-page .agency-button:hover { background: linear-gradient(135deg, #1d4ed8, #0891b2 60%, #0d9488); }
.agency-auth-page .agency-button.secondary { background: #f4f7fc; color: #475569 !important; box-shadow: none; border: 1px solid #dce3ee; }
.agency-auth-page .agency-button:disabled { opacity: .65; cursor: wait; }
.agency-auth-page .agency-signin-form .agency-field + .agency-field { margin-top: 20px; }
.agency-auth-page .agency-approval-note { margin: 22px 0 0; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; color: #64748b; font-size: 12px; line-height: 1.7; }
.agency-auth-page .agency-entry-signup { color: #1d4ed8; }
.agency-auth-page .agency-entry-signup span { margin-left: 5px; }
.agency-auth-page .agency-progress { border-bottom: 1px solid #e5eaf3; padding-bottom: 17px; margin-bottom: 23px; }
.agency-auth-page .agency-progress ol { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin: 0; gap: 6px; }
.agency-auth-page .agency-progress li { min-width: 0; position: relative; }
.agency-auth-page .agency-progress li:not(:last-child)::after { content: ''; position: absolute; top: 16px; left: calc(50% + 24px); width: calc(100% - 42px); height: 1px; background: #e1e7f2; }
.agency-auth-page .agency-progress button { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; flex-direction: column; gap: 7px; border: 0; padding: 0 2px; background: transparent; color: #64748b; font-size: 11px; font-weight: 650; }
.agency-auth-page .agency-progress button:disabled { cursor: default; color: #8893a5; }
.agency-auth-page .step-number { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%; border: 1px solid #dce3ee; color: #64748b; background: #fff; font-size: 12px; }
.agency-auth-page .agency-progress button[aria-current="step"] { color: #1d4ed8; }
.agency-auth-page .agency-progress button[aria-current="step"] .step-number { background: #2563eb; color: white; border-color: #2563eb; box-shadow: 0 0 0 4px #2563eb10; }
.agency-auth-page .agency-progress button[data-complete] .step-number { background: #e9f8f3; color: #0f766e; border-color: #b4e3d4; }
.agency-auth-page .agency-progress [data-step-status] { margin: 14px 0 0; text-align: center; font-size: 11px; color: #64748b; }
.agency-auth-page .agency-progress button:focus-visible { outline: 2px solid #2563eb; outline-offset: 5px; border-radius: 5px; }
.agency-auth-page [hidden] { display: none !important; }
.agency-auth-page .agency-documents { grid-template-columns: 1fr; margin-top: 0; gap: 12px; }
.agency-auth-page .agency-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.agency-auth-page .agency-form-actions .agency-button:not(.secondary) { flex: 1; }
.agency-auth-page .agency-form-note { font-size: 11px; margin: 14px 0 0; line-height: 1.7; color: #64748b; }
.agency-auth-page .agency-signin-link { text-align: center; font-size: 12px; color: #64748b; margin: 23px 0 0; }
.agency-auth-page .agency-signin-link a { font-weight: 700; }
.agency-auth-page .notice { overflow-wrap: anywhere; }
.agency-auth-page .notice.error a { color: #991b1b; }
.agency-auth-page .notice.error .error-reentry-note { font-size: 11px; margin-bottom: 0; }
.agency-auth-page .auth-copyright { text-align: center; padding: 0 20px 22px; color: #64748b; font-size: 11px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .agency-auth-page .admin-auth-wrapper { padding: 24px 14px; }
    .agency-auth-page .agency-registration-shell { max-width: 620px; grid-template-columns: 1fr; }
    .agency-auth-page .admin-login-panel { padding: 30px; }
}
@media (max-width: 480px) {
    .agency-auth-page .admin-auth-wrapper { padding: 14px 10px; }
    .agency-auth-page .admin-login-shell { border-radius: 24px; }
    .agency-auth-page .admin-login-panel { padding: 24px 19px; }
    .agency-auth-page .agency-grid { grid-template-columns: 1fr; gap: 15px; }
    .agency-auth-page .panel-brand { gap: 12px; margin-bottom: 21px; }
    .agency-auth-page .panel-brand img { width: 44px; height: 44px; border-radius: 13px; }
    .agency-auth-page .panel-brand strong { font-size: 16px; }
    .agency-auth-page .panel-brand small { font-size: 11px; }
    .agency-auth-page .agency-form-actions { margin-top: 21px; }
    .agency-auth-page .agency-button.secondary { width: auto; min-width: 87px; padding: 12px 14px; }
    .agency-auth-page .agency-progress button { font-size: 10px; }
    .agency-auth-page .agency-field input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .agency-entry-signup, .admin-login-btn { transition: none; } }
