        *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
        :root {
            --ac-purple:      #6c5ce7;
            --ac-green-bright:#00e676;
            --ac-red:         #ff6b6b;
            --tx-on-dark:     #e0e8f0;
            --tx-muted-dark:  #a8b8c8;
            --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            --font-mono: 'JetBrains Mono', 'Roboto Mono', 'Consolas', monospace;
        }
        body {
            font-family: var(--font-sans);
            font-size: 15px;
            background: #0f1923;
            color: var(--tx-on-dark);
            min-height: 100vh;
            /* Vertical scroll must stay available: on tablets in landscape (and
               some phones), the TOTP-setup panel is taller than the viewport.
               overflow:hidden here previously made the submit/back buttons
               below the fold permanently unreachable — no scrollbar, no
               touch-scroll. Horizontal stays clipped for the decorative
               ::before/::after backgrounds below, which intentionally extend
               past the container's edges. */
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-font-smoothing: antialiased;
        }
        .hidden-el { display: none !important; }
        /* Login container */
        .login-container {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
            background: #0f1923;
            overflow-x: hidden;
        }
        .login-container::before {
            content: '';
            position: absolute;
            inset: -60%;
            background-image:
                linear-gradient(rgba(108,92,231,0.06) 1px, transparent 1px),
                linear-gradient(90deg, rgba(108,92,231,0.06) 1px, transparent 1px);
            background-size: 48px 48px;
            animation: gridDrift 30s linear infinite;
            pointer-events: none;
            z-index: 0;
        }
        .login-container::after {
            content: '';
            position: absolute;
            top: -5%;
            left: 50%;
            transform: translateX(-50%);
            width: 700px;
            height: 500px;
            background: radial-gradient(ellipse, rgba(108,92,231,0.12) 0%, transparent 65%);
            pointer-events: none;
            z-index: 0;
        }
        @keyframes gridDrift {
            0%   { transform: translate(0,0); }
            100% { transform: translate(48px,48px); }
        }
        .login-box {
            position: relative;
            z-index: 1;
            background: rgba(26,42,58,0.95);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(108,92,231,0.25);
            border-radius: 16px;
            padding: 40px;
            width: 100%;
            max-width: 420px;
            color: var(--tx-on-dark);
            box-shadow: 0 8px 40px rgba(0,0,0,0.5);
        }
        .login-box::before {
            content: '';
            position: absolute;
            top: 0; left: 10%; right: 10%;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--ac-purple) 35%, #a855f7 65%, transparent);
            border-radius: 0 0 3px 3px;
        }
        .login-header { text-align: center; margin-bottom: 32px; }
        .login-header h1 {
            color: #e0e8f0;
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
        }
        .header-icon { color: var(--ac-purple); }
        .login-tagline {
            color: var(--tx-muted-dark);
            font-size: 11px;
            letter-spacing: 1px;
            text-transform: uppercase;
            margin-bottom: 10px;
        }
        .login-subtitle {
            color: var(--tx-muted-dark);
            font-family: var(--font-mono);
            font-size: 12px;
            letter-spacing: 2.5px;
            text-transform: uppercase;
            display: inline-flex;
            align-items: center;
            gap: 7px;
        }
        .login-subtitle::before {
            content: '●';
            font-size: 9px;
            color: var(--ac-green-bright);
            animation: statusBlink 2s step-end infinite;
        }
        @keyframes statusBlink {
            0%, 100% { opacity: 1; }
            50%       { opacity: 0.2; }
        }
        .login-form .form-group { margin-bottom: 20px; }
        .login-form label {
            display: block;
            margin-bottom: 8px;
            color: var(--tx-on-dark);
            font-weight: 600;
            font-size: 13px;
            letter-spacing: 0.4px;
        }
        .login-form input {
            width: 100%;
            padding: 13px 16px;
            background: rgba(15,25,35,0.8);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px;
            /* 16px, not 15px: iOS Safari auto-zooms the whole page on focus of
               any input under 16px, which is jarring on phones/tablets and
               makes the below-the-fold overflow problem worse post-zoom. */
            font-size: 16px;
            font-family: var(--font-sans);
            color: #e0e8f0;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .login-form input::placeholder { color: rgba(136,153,170,0.6); }
        .login-form input:focus {
            outline: none;
            border-color: var(--ac-purple);
            box-shadow: 0 0 0 3px rgba(108,92,231,0.2);
        }
        .login-btn {
            width: 100%;
            padding: 12px;
            background: linear-gradient(135deg, #6c5ce7, #a855f7);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            font-family: var(--font-sans);
            cursor: pointer;
            letter-spacing: 0.3px;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 4px 20px rgba(108,92,231,0.40);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,92,231,0.55); }
        .login-btn:active { transform: translateY(0); }
        .login-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
        .error-message {
            display: none;
            margin-top: 16px;
            padding: 12px 14px;
            background: rgba(255,107,107,0.1);
            border: 1px solid rgba(255,107,107,0.3);
            border-radius: 8px;
            color: var(--ac-red);
            font-size: 14px;
        }
        .mfa-panel { text-align: center; }
        .mfa-icon { font-size: 40px; color: var(--ac-purple); margin-bottom: 14px; }
        .mfa-instruction {
            font-size: 14px;
            color: #a8b8c8;
            line-height: 1.55;
            margin-bottom: 20px;
        }
        .mfa-instruction strong { color: #e0e8f0; }
        .mfa-back-btn {
            background: none;
            border: none;
            color: var(--ac-purple);
            font-size: 13px;
            cursor: pointer;
            margin-top: 14px;
            padding: 4px 8px;
            opacity: 0.8;
            font-family: var(--font-sans);
        }
        .mfa-back-btn:hover { opacity: 1; text-decoration: underline; }
        .totp-qr-container { display: flex; justify-content: center; margin-bottom: 12px; }
        .totp-qr-image {
            width: 180px; height: 180px;
            border: 3px solid var(--ac-purple);
            border-radius: 10px;
            image-rendering: pixelated;
        }
        .totp-manual-key-label { font-size: 12px; color: #a8b8c8; margin: 8px 0 4px; }
        .totp-manual-key {
            font-family: monospace;
            font-size: 13px;
            letter-spacing: 2px;
            color: var(--ac-purple);
            word-break: break-all;
            padding: 6px 10px;
            background: rgba(108,92,231,0.07);
            border-radius: 6px;
            margin-bottom: 16px;
        }
        .optional-label { font-size: 11px; color: #a8b8c8; font-weight: normal; }
