        /* ============================================================
           BESPOKE LOGIN â€” Token System
           Dark tokens (default) â€” mirrors mockup.html :root exactly
           ============================================================ */
        :root {
            --bg:             #0B0F1A;
            --surface:        #131825;
            --surface-2:      #1A2033;
            --surface-3:      #222940;
            --border:         #2A3150;
            --border-light:   #353D5C;
            --text:           #E8ECF4;
            --text-secondary: #8892B0;
            --text-muted:     #5A6380;
            --accent:         #3B82F6;
            --accent-glow:    rgba(59, 130, 246, 0.15);
            --accent-ring:    rgba(59, 130, 246, 0.28);
            --green:          #10B981;
            --green-bg:       rgba(16, 185, 129, 0.10);
            --green-border:   rgba(16, 185, 129, 0.25);
            --amber:          #F59E0B;
            --amber-bg:       rgba(245, 158, 11, 0.10);
            --amber-border:   rgba(245, 158, 11, 0.25);
            --red:            #EF4444;
            --red-bg:         rgba(239, 68, 68, 0.10);
            --red-border:     rgba(239, 68, 68, 0.25);
            --radius:         8px;
            --radius-lg:      12px;
            --font:           'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            --font-mono:      'Space Mono', 'Courier New', monospace;
        }

        /* Light theme overrides */
        [data-theme="light"] {
            --bg:             #eef2f7;
            --surface:        #ffffff;
            --surface-2:      #f8fafc;
            --surface-3:      #f1f5f9;
            --border:         #e2e8f0;
            --border-light:   #cbd5e1;
            --text:           #0f172a;
            --text-secondary: #475569;
            --text-muted:     #94a3b8;
            --accent:         #2563eb;
            --accent-glow:    rgba(37, 99, 235, 0.10);
            --accent-ring:    rgba(37, 99, 235, 0.22);
            --green:          #059669;
            --green-bg:       rgba(5, 150, 105, 0.08);
            --green-border:   rgba(5, 150, 105, 0.22);
            --amber:          #d97706;
            --amber-bg:       rgba(217, 119, 6, 0.08);
            --amber-border:   rgba(217, 119, 6, 0.20);
            --red:            #dc2626;
            --red-bg:         rgba(220, 38, 38, 0.08);
            --red-border:     rgba(220, 38, 38, 0.20);
        }

        /* ============================================================
           Reset & Base
           ============================================================ */
        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body { height: 100%; }

        body {
            font-family: var(--font);
            background-color: var(--bg);
            color: var(--text);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px 16px;
            transition: background-color 0.25s ease, color 0.25s ease;
            /* Layered background: accent glow + dark scrim + night cityscape */
            background-image:
                radial-gradient(
                    ellipse 70% 55% at 50% 48%,
                    var(--accent-glow) 0%,
                    transparent 72%
                ),
                linear-gradient(rgba(11, 15, 26, 0.40), rgba(11, 15, 26, 0.40)),
                url("/static/img/bg_login_dark.png");
            background-size: auto, auto, cover;
            background-position: center, center, center;
            background-repeat: no-repeat, no-repeat, no-repeat;
            background-attachment: fixed;
        }

        /* Light theme: daytime image + minimal scrim (card is opaque, centre is bright) */
        [data-theme="light"] body {
            background-image:
                radial-gradient(
                    ellipse 70% 55% at 50% 48%,
                    var(--accent-glow) 0%,
                    transparent 72%
                ),
                linear-gradient(rgba(238, 242, 247, 0.32), rgba(238, 242, 247, 0.32)),
                url("/static/img/bg_login_light.png");
        }

        /* ============================================================
           Theme Toggle â€” Fixed top-right floating button
           ============================================================ */
        .theme-toggle {
            position: fixed;
            top: 16px;
            right: 16px;
            width: 38px;
            height: 38px;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 14px;
            z-index: 999;
            outline: none;
            transition: background 0.2s ease, color 0.2s ease,
                        border-color 0.2s ease, box-shadow 0.2s ease;
        }
        .theme-toggle:hover {
            background: var(--surface-2);
            color: var(--accent);
            border-color: var(--accent-ring);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }
        .theme-toggle:focus-visible {
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        /* ============================================================
           Login Wrapper
           ============================================================ */
        .login-wrap {
            width: 100%;
            max-width: 440px;
            animation: fadeIn 0.4s ease both;
        }

        /* ============================================================
           Card â€” bespoke surface panel (mirrors stat-card in mockup.html)
           ============================================================ */
        .login-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            /* Top accent bar â€” identical technique to stat-card::after in mockup */
            box-shadow: 0 0 0 0 transparent;
            position: relative;
        }
        .login-card::before {
            content: '';
            display: block;
            height: 2px;
            background: var(--accent);
        }

        /* ============================================================
           Card Header
           ============================================================ */
        .login-header {
            padding: 2rem 2rem 1.75rem;
            text-align: center;
            border-bottom: 1px solid var(--border);
            background: var(--surface-2);
        }

        .logo-wrap {
            margin-bottom: 1.25rem;
            animation: fadeInDown 0.5s ease both;
        }
        .logo-wrap img {
            width: 68px;
            height: auto;
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        }
        [data-theme="dark"] .logo-wrap img {
            filter: drop-shadow(0 2px 14px rgba(59, 130, 246, 0.18)) brightness(1.05);
        }

        /* System badge pill â€” Space Mono, uppercase, accent-tinted */
        .sys-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--accent-glow);
            border: 1px solid var(--accent-ring);
            color: var(--accent);
            border-radius: 999px;
            padding: 3px 12px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
            font-family: var(--font-mono);
            margin-bottom: 1rem;
            animation: fadeInDown 0.5s ease 0.08s both;
        }

        .login-header h2 {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--text);
            letter-spacing: -0.4px;
            margin-bottom: 0.35rem;
            animation: fadeInDown 0.5s ease 0.14s both;
        }

        .login-header p {
            font-size: 11px;
            color: var(--text-secondary);
            font-family: var(--font-mono);
            letter-spacing: 0.2px;
            line-height: 1.6;
            animation: fadeInDown 0.5s ease 0.2s both;
        }

        /* ============================================================
           Card Body
           ============================================================ */
        .login-body {
            padding: 2rem;
            animation: fadeIn 0.5s ease 0.18s both;
        }

        /* ============================================================
           Alerts â€” scoped token palette for each level
           ============================================================ */
        .alert {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            border-radius: var(--radius);
            padding: 10px 14px;
            font-size: 12px;
            margin-bottom: 1.25rem;
            line-height: 1.5;
        }
        .alert > i { margin-top: 1px; flex-shrink: 0; font-size: 11px; }
        .alert > span { flex: 1; }

        /* Dismiss button */
        .alert-dismiss {
            background: none;
            border: none;
            cursor: pointer;
            color: inherit;
            opacity: 0.55;
            font-size: 15px;
            line-height: 1;
            padding: 0;
            flex-shrink: 0;
            align-self: flex-start;
            transition: opacity 0.15s;
        }
        .alert-dismiss:hover { opacity: 1; }

        /* Level variants */
        .alert-danger,
        .alert-error {
            background: var(--red-bg);
            border: 1px solid var(--red-border);
            color: var(--red);
        }
        .alert-success {
            background: var(--green-bg);
            border: 1px solid var(--green-border);
            color: var(--green);
        }
        .alert-info,
        .alert-debug {
            background: var(--accent-glow);
            border: 1px solid var(--accent-ring);
            color: var(--accent);
        }
        .alert-warning {
            background: var(--amber-bg);
            border: 1px solid var(--amber-border);
            color: var(--amber);
        }

        /* ============================================================
           Field Labels
           ============================================================ */
        .field-label {
            display: block;
            font-size: 10.5px;
            font-weight: 700;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-family: var(--font-mono);
        }
        .field-label i {
            color: var(--accent);
            margin-right: 5px;
            font-size: 9px;
        }

        /* ============================================================
           Inputs â€” bespoke override of GPPSALoginForm's form-control class
           Scoped to .login-body to avoid conflicts if CSS is cached globally
           ============================================================ */
        .login-body .form-control {
            display: block;
            width: 100%;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 10px 14px;
            color: var(--text);
            font-family: var(--font);
            font-size: 13px;
            outline: none;
            transition: border-color 0.2s ease, box-shadow 0.2s ease,
                        background 0.2s ease;
            appearance: none;
            -webkit-appearance: none;
        }
        .login-body .form-control::placeholder {
            color: var(--text-muted);
        }
        .login-body .form-control:hover:not(:focus) {
            border-color: var(--border-light);
        }
        .login-body .form-control:focus {
            border-color: var(--accent);
            background: var(--surface-3);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        /* Field spacing */
        .field-group { margin-bottom: 1.2rem; }

        /* Field-level errors */
        .field-error {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-top: 6px;
            font-size: 11px;
            color: var(--red);
        }
        .field-error i { font-size: 9px; }

        /* ============================================================
           Checkbox â€” bespoke override of form-check-input class
           ============================================================ */
        .remember-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 1.5rem;
        }
        .login-body .form-check-input {
            width: 16px;
            height: 16px;
            border: 1.5px solid var(--border-light);
            border-radius: 4px;
            background: var(--surface-2);
            cursor: pointer;
            flex-shrink: 0;
            appearance: none;
            -webkit-appearance: none;
            position: relative;
            transition: background 0.2s ease, border-color 0.2s ease,
                        box-shadow 0.2s ease;
            margin: 0;
        }
        .login-body .form-check-input:checked {
            background: var(--accent);
            border-color: var(--accent);
        }
        .login-body .form-check-input:checked::after {
            content: '';
            position: absolute;
            left: 4px;
            top: 1.5px;
            width: 5px;
            height: 9px;
            border: 2px solid #fff;
            border-top: none;
            border-left: none;
            transform: rotate(45deg);
        }
        .login-body .form-check-input:focus-visible {
            box-shadow: 0 0 0 3px var(--accent-glow);
            outline: none;
        }
        .remember-label {
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            user-select: none;
        }

        /* ============================================================
           Submit Button â€” matches mockup.html .save-btn exactly
           ============================================================ */
        .btn-login {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            background: var(--accent);
            color: #ffffff;
            border: none;
            border-radius: var(--radius);
            padding: 11px 20px;
            font-family: var(--font);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            letter-spacing: 0.2px;
            transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
            box-shadow: 0 2px 12px var(--accent-glow);
        }
        .btn-login:hover {
            filter: brightness(1.1);
            transform: translateY(-1px);
            box-shadow: 0 4px 20px var(--accent-ring);
        }
        .btn-login:active {
            transform: translateY(0);
            filter: brightness(0.95);
        }

        /* ============================================================
           Divider
           ============================================================ */
        .divider {
            border: none;
            border-top: 1px solid var(--border);
            margin: 1.5rem 0;
        }

        /* ============================================================
           Footer Note
           ============================================================ */
        .footer-note {
            text-align: center;
        }
        .security-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 5px 14px;
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            margin-bottom: 6px;
            letter-spacing: 0.3px;
        }
        .security-badge i {
            color: var(--accent);
            font-size: 10px;
        }
        .footer-note p {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* ============================================================
           Copyright (below card)
           ============================================================ */
        .copyright {
            margin-top: 20px;
            text-align: center;
            font-family: var(--font-mono);
            font-size: 10px;
            color: var(--text-muted);
            letter-spacing: 0.3px;
            animation: fadeIn 0.5s ease 0.35s both;
        }

        /* ============================================================
           Animations â€” fadeIn + fadeInDown from mockup.html
           ============================================================ */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        @keyframes fadeInDown {
            from { opacity: 0; transform: translateY(-12px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* ============================================================
           Responsive — multi-tier breakpoints (desktop-first)
           768 → 576 → 480 → 360  (aligned with base.html)
           ============================================================ */

        /* ---- Tablet portrait & large phones ---- */
        @media (max-width: 768px) {
            body {
                padding: 20px 12px;
                background-image:
                    radial-gradient(
                        ellipse 80% 50% at 50% 50%,
                        var(--accent-glow) 0%,
                        transparent 68%
                    ),
                    linear-gradient(rgba(11, 15, 26, 0.40), rgba(11, 15, 26, 0.40)),
                    url("/static/img/bg_login_dark.png");
            }
            [data-theme="light"] body {
                background-image:
                    radial-gradient(
                        ellipse 80% 50% at 50% 50%,
                        var(--accent-glow) 0%,
                        transparent 68%
                    ),
                    linear-gradient(rgba(238, 242, 247, 0.32), rgba(238, 242, 247, 0.32)),
                    url("/static/img/bg_login_light.png");
            }
            .login-wrap { max-width: 400px; }
            .login-header { padding: 1.75rem 1.75rem 1.5rem; }
            .login-body   { padding: 1.75rem; }
            .login-header h2 { font-size: 1.2rem; }
            .login-header p  { font-size: 10.5px; }
            .sys-badge { font-size: 9.5px; padding: 3px 10px; }
        }

        /* ---- Small phones ---- */
        @media (max-width: 576px) {
            body { padding: 10px 8px; overflow-y: auto; }
            .theme-toggle {
                top: 10px;
                right: 10px;
                width: 36px;
                height: 36px;
                font-size: 13px;
            }
            .login-wrap { max-width: 100%; }
            .login-header { padding: 0.875rem 1.25rem 0.75rem; }
            .login-body   { padding: 1.125rem 1.25rem; }
            .logo-wrap { margin-bottom: 0.625rem; }
            .logo-wrap img { width: 44px; }
            .sys-badge { margin-bottom: 0.625rem; font-size: 9px; padding: 2px 10px; }
            .login-header h2 { font-size: 1.05rem; margin-bottom: 0.2rem; }
            .login-header p  { font-size: 10px; line-height: 1.4; }
            .field-group { margin-bottom: 0.875rem; }
            .remember-row { margin-bottom: 1rem; gap: 10px; }
            .divider { margin: 0.875rem 0; }

            /* Touch targets */
            .login-body .form-control {
                padding: 11px 14px;
                font-size: 14px;
                min-height: 44px;
            }
            .btn-login {
                padding: 12px 20px;
                font-size: 14px;
                min-height: 44px;
            }
            .login-body .form-check-input {
                width: 20px;
                height: 20px;
            }
            .login-body .form-check-input:checked::after {
                left: 5.5px;
                top: 2px;
                width: 6px;
                height: 10px;
            }
            .remember-label { font-size: 13px; }
            .security-badge { font-size: 10px; padding: 4px 12px; }
            .footer-note p  { font-size: 10px; }
            .copyright { font-size: 9px; margin-top: 12px; }
        }

        /* ---- Extra-small phones ---- */
        @media (max-width: 480px) {
            body {
                padding: 16px 14px;
                align-items: center;
                min-height: 100svh;
                overflow-y: auto;
                background-image:
                    linear-gradient(rgba(11, 15, 26, 0.42), rgba(11, 15, 26, 0.42)),
                    url("/static/img/bg_login_dark.png");
                background-attachment: scroll;
            }
            [data-theme="light"] body {
                background-image:
                    linear-gradient(rgba(238, 242, 247, 0.30), rgba(238, 242, 247, 0.30)),
                    url("/static/img/bg_login_light.png");
            }
            .login-wrap {
                max-width: 100%;
                width: 100%;
                display: flex;
                flex-direction: column;
            }
            .login-card {
                border-radius: var(--radius-lg);
                border: 1px solid var(--border);
                display: flex;
                flex-direction: column;
            }
            .login-header { padding: 0.875rem 1.25rem 0.75rem; }
            .login-body   { padding: 1.125rem 1.25rem; }
            .logo-wrap { margin-bottom: 0.5rem; }
            .logo-wrap img { width: 40px; }
            .login-header h2 { font-size: 1rem; margin-bottom: 0.2rem; }
            .login-header p  { font-size: 9.5px; }
            .sys-badge { font-size: 9px; padding: 2px 8px; letter-spacing: 0.6px; margin-bottom: 0.5rem; }
            .field-label { font-size: 10px; }
            .field-group { margin-bottom: 0.875rem; }
            .remember-row { margin-bottom: 1rem; }
            .divider { margin: 0.875rem 0; }
            .copyright {
                margin-top: 0;
                padding: 10px 16px;
                font-size: 9px;
            }
        }

        /* ---- Narrowest devices (Galaxy Fold etc.) ---- */
        @media (max-width: 360px) {
            .login-header { padding: 1rem; }
            .login-body   { padding: 1rem; }
            .login-header h2 { font-size: 1rem; }
            .login-header p  { font-size: 9.5px; }
            .logo-wrap img { width: 42px; }
            .btn-login { font-size: 13px; }
            .security-badge { font-size: 9px; padding: 3px 10px; }
        }

        /* ---- Safe-area insets for notched phones ---- */
        @supports (padding: env(safe-area-inset-bottom)) {
            body {
                padding-left:   env(safe-area-inset-left);
                padding-right:  env(safe-area-inset-right);
                padding-bottom: env(safe-area-inset-bottom);
            }
        }
