        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --navy: #0c1a3a;
            --navy-light: #162550;
            --blue: #3b82f6;
            --sky: #38bdf8;
            --emerald: #10b981;
            --red: #ef4444;
            --white: #ffffff;
            --gray-100: #f1f5f9;
            --gray-200: #e2e8f0;
            --gray-300: #cbd5e1;
            --gray-400: #94a3b8;
            --gray-500: #64748b;
            --gray-700: #334155;
        }

        body {
            font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: var(--navy);
            position: relative;
            overflow-x: hidden;
            overflow-y: auto;
        }

        /* Animated background */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background:
                radial-gradient(ellipse 80% 60% at 20% 80%, rgba(59,130,246,0.15), transparent),
                radial-gradient(ellipse 60% 50% at 80% 20%, rgba(56,189,248,0.1), transparent),
                radial-gradient(ellipse 50% 40% at 50% 50%, rgba(16,185,129,0.05), transparent);
            z-index: 0;
        }

        .auth-box {
            background: var(--white);
            padding: 40px 36px;
            border-radius: 18px;
            box-shadow: 0 25px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
            width: 100%;
            max-width: 504px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            z-index: 1;
            animation: boxIn 0.5s ease;
        }

        @keyframes boxIn {
            from { opacity: 0; transform: translateY(20px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .brand {
            text-align: center;
            margin-bottom: 29px;
        }

        /* Override inline logo sizing in login.html */
        .brand img {
            width: 120px !important;
            height: 120px !important;
            margin-bottom: 4px !important;
        }

        .brand .logo-icon {
            width: 81px; height: 81px;
            background: linear-gradient(135deg, var(--blue), var(--sky));
            border-radius: 14px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 25px;
            margin-bottom: 13px;
            box-shadow: 0 8px 24px rgba(59,130,246,0.3);
        }

        .brand h1 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.98rem;
            font-weight: 800;
            color: var(--navy);
            letter-spacing: -1px;
        }

        .brand p {
            color: var(--gray-500);
            font-size: 0.83rem;
            margin-top: 4px;
        }

        /* Role tabs */
        .role-tabs {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 5px;
            margin-bottom: 25px;
            background: var(--gray-100);
            padding: 4px;
            border-radius: 11px;
        }

        .role-tabs button {
            padding: 9px 4px;
            border: none;
            background: transparent;
            color: var(--gray-500);
            font-family: 'DM Sans', sans-serif;
            font-weight: 600;
            font-size: 0.74rem;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.2s;
        }

        .role-tabs button:hover {
            color: var(--gray-700);
        }

        .role-tabs button.active {
            background: var(--white);
            color: var(--navy);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        /* Content panels */
        .role-content { display: none; }
        .role-content.active {
            display: block;
            animation: fadeSlide 0.3s ease;
        }

        @keyframes fadeSlide {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Lockout banner */
        .lockout-banner {
            display: none;
            position: fixed; top: 0; left: 0; right: 0;
            padding: 16px 20px;
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: #fff;
            text-align: center;
            font-weight: 600;
            font-size: 14px;
            z-index: 9999;
            box-shadow: 0 4px 20px rgba(239,68,68,0.4);
            letter-spacing: 0.3px;
        }
        .lockout-banner.show { display: block; }
        .lockout-banner .lockout-timer {
            display: inline-block;
            background: rgba(0,0,0,0.2);
            border-radius: 6px;
            padding: 2px 10px;
            margin-left: 8px;
            font-variant-numeric: tabular-nums;
        }
        form.locked-out input,
        form.locked-out button[type="submit"] {
            opacity: 0.5;
            pointer-events: none;
        }

        h2 {
            font-family: 'Outfit', sans-serif;
            color: var(--navy);
            margin-bottom: 18px;
            font-size: 1.17rem;
            font-weight: 700;
        }

        .form-group {
            margin-bottom: 14px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            color: var(--gray-700);
            font-weight: 600;
            font-size: 0.77rem;
        }

        input[type="text"],
        input[type="email"],
        input[type="password"],
        input[type="tel"] {
            width: 100%;
            padding: 11px 14px;
            border: 2px solid var(--gray-200);
            border-radius: 9px;
            font-size: 0.83rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }

        input:focus {
            border-color: var(--blue);
        }

        .btn-primary {
            width: 100%;
            padding: 13px;
            background: linear-gradient(135deg, var(--blue), var(--sky));
            color: white;
            border: none;
            border-radius: 11px;
            font-family: 'DM Sans', sans-serif;
            font-size: 0.86rem;
            font-weight: 700;
            cursor: pointer;
            letter-spacing: 0.3px;
            box-shadow: 0 4px 16px rgba(59,130,246,0.3);
            transition: all 0.2s;
            margin-top: 7px;
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(59,130,246,0.4);
        }

        .message {
            padding: 11px 14px;
            border-radius: 9px;
            margin-top: 14px;
            font-size: 0.77rem;
            font-weight: 600;
            animation: fadeSlide 0.3s ease;
        }
        .message.success { background: rgba(16,185,129,0.1); color: #059669; }
        .message.error { background: rgba(239,68,68,0.1); color: #dc2626; }

        .info-text {
            margin-top: 16px;
            color: var(--gray-400);
            font-size: 0.74rem;
        }

        .register-link {
            text-align: center;
            margin-top: 22px;
            padding-top: 18px;
            border-top: 1px solid var(--gray-200);
        }
        .register-link a {
            color: var(--blue);
            font-weight: 600;
            font-size: 0.79rem;
            text-decoration: none;
            transition: color 0.2s;
        }
        .register-link a:hover {
            color: var(--sky);
            text-decoration: underline;
        }

        /* Logout toast */
        .logout-toast {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: var(--navy);
            color: white;
            padding: 14px 28px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.9rem;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 9999;
            opacity: 0;
            transition: all 0.4s ease;
        }
        .logout-toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
        .logout-toast-close {
            background: none;
            border: none;
            color: rgba(255,255,255,0.6);
            font-size: 1.2rem;
            cursor: pointer;
            line-height: 1;
        }

        /* Legal footer (S31: visible for Twilio 10DLC vetting) */
        .legal-footer {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0;
            margin-top: 23px;
            font-size: 0.70rem;
        }
        .legal-footer a {
            color: var(--gray-400);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s;
        }
        .legal-footer a:hover {
            color: var(--blue);
            text-decoration: underline;
        }
        .legal-sep {
            color: var(--gray-300);
            margin: 0 6px;
        }

        /* MFA verification digit inputs (S82) */
        .mfa-digit {
            width: 44px;
            height: 52px;
            text-align: center;
            font-size: 1.4rem;
            font-weight: 700;
            font-family: 'DM Sans', monospace;
            border: 2px solid var(--gray-200);
            border-radius: 10px;
            outline: none;
            transition: border-color 0.2s, box-shadow 0.2s;
            color: var(--navy);
            padding: 0;
        }
        .mfa-digit:focus {
            border-color: var(--blue);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
        }

        /* S83: Forgot username/password links */
        .forgot-links {
            text-align: center;
            margin-top: 12px;
        }
        .forgot-links a {
            color: var(--gray-400);
            font-weight: 600;
            font-size: 0.74rem;
            text-decoration: none;
            transition: color 0.2s;
        }
        .forgot-links a:hover {
            color: var(--blue);
            text-decoration: underline;
        }
        .forgot-sep {
            color: var(--gray-300);
            margin: 0 6px;
        }

        /* S83: Password requirements hint */
        .pw-requirements {
            color: var(--gray-400);
            font-size: 0.72rem;
            margin-bottom: 14px;
            font-weight: 500;
        }

        /* S83: Forgot modal account results */
        .fu-account {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--gray-100);
            border-radius: 10px;
            margin-bottom: 8px;
            text-align: left;
        }
        .fu-account-role {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            color: var(--blue);
            letter-spacing: 0.5px;
        }
        .fu-account-id {
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--navy);
            word-break: break-all;
        }

        @media (max-width: 500px) {
            .auth-box { padding: 29px 22px; }
            .brand h1 { font-size: 1.62rem; }
            .role-tabs { grid-template-columns: repeat(2, 1fr); }
        }
