 :root {
            /* Brand Colors */
            --primary: #2563eb;
            --primary-hover: #1d4ed8;
            --secondary: #64748b;
            --success: #10b981;
            --warning: #f59e0b;
            
            /* UI Colors */
            --bg-body: #f8fafc;
            --bg-surface: #ffffff;
            --border-color: #cbd5e1;
            --text-main: #0f172a;
            --text-muted: #64748b;
            
            /* Spacing & Radius */
            --radius-xl: 16px;
            --radius-md: 8px;
            --radius-pill: 50px;
        }

        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: var(--bg-body);
            margin: 0;
            overflow-x: hidden;
            height: 100vh;
        }

        /* --- WRAPPER --- */
        .login-wrapper {
            display: flex;
            width: 100%;
            height: 100vh;
            background: var(--bg-surface);
        }

        /* --- LEFT PANEL (IMAGE) --- */
        .login-left {
            flex: 1.2;
            position: relative;
            /* Update: Reduced opacity of the blue overlay for a "clearer" image */
            background: linear-gradient(135deg, rgba(30, 64, 175, 0.75), rgba(37, 99, 235, 0.6)), url('../images/bg-01.jpg');
            background-size: cover;
            background-position: center;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 4rem;
            color: white;
            overflow: hidden;
        }

        .login-left::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            /* Grain overlay for texture */
            background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
            pointer-events: none;
        }

        .left-content {
            position: relative;
            z-index: 2;
            max-width: 500px;
            animation: fadeIn 1s ease-out;
        }

        .hero-title {
            font-size: 3rem;
            font-weight: 800;
            line-height: 1.1;
            margin-bottom: 1.5rem;
            text-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .hero-subtitle {
            font-size: 1.15rem;
            font-weight: 400;
            opacity: 0.9;
            line-height: 1.6;
        }

        .feature-badges {
            margin-top: 2rem;
            display: flex;
            gap: 1rem;
        }
        
        .badge-glass {
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.3);
            padding: 0.5rem 1rem;
            border-radius: var(--radius-pill);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* --- RIGHT PANEL (FORM) --- */
        .login-right {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between; /* This pushes footer to bottom */
            padding: 2rem;
            background: var(--bg-surface);
            position: relative;
            overflow-y: auto; /* Allow scroll on small vertical screens */
        }

        .login-form-container {
            width: 100%;
            max-width: 440px;
            margin: auto; /* Vertically centers the form in remaining space */
            padding: 2rem 0;
        }

        /* Brand Header */
        .brand-header {
            text-align: center;
            margin-bottom: 2.5rem;
        }
        .brand-logo {
            width: 120px;
            height: auto;
            margin-bottom: 1rem;
            filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08));
        }
        .brand-name {
            font-size: 1.5rem;
            font-weight: 800;
            color: var(--text-main);
            letter-spacing: -0.5px;
            line-height: 1.2;
        }
        .brand-tag {
            color: var(--text-muted);
            font-size: 0.9rem;
            font-weight: 500;
        }

        /* Visible Toggle Switch */
        .auth-toggle-wrapper {
            background: #f1f5f9;
            padding: 5px;
            border-radius: var(--radius-pill);
            display: flex;
            position: relative;
            margin-bottom: 2rem;
            border: 1px solid #e2e8f0;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
        }

        .toggle-bg-slide {
            position: absolute;
            top: 5px; left: 5px;
            width: calc(50% - 5px);
            height: calc(100% - 10px);
            background: #ffffff;
            border-radius: var(--radius-pill);
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1;
        }
        .auth-toggle-wrapper[data-active="otp"] .toggle-bg-slide {
            transform: translateX(100%);
        }

        .auth-tab-btn {
            flex: 1;
            position: relative;
            z-index: 2;
            border: none;
            background: transparent;
            padding: 12px;
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.95rem;
            transition: color 0.3s;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .auth-tab-btn.active {
            color: var(--primary);
        }

        /* Inputs */
        .form-floating > .form-control {
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-xl);
            height: calc(3.5rem + 2px);
            line-height: 1.25;
            font-weight: 500;
            color: var(--text-main);
        }
        .form-floating > .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        }
        .form-floating > label {
            padding-left: 1.2rem;
            color: var(--text-muted);
        }

        /* OTP Specific */
        .btn-request-otp {
            width: 100%;
            background: #eff6ff;
            color: var(--primary);
            border: 1px dashed var(--primary);
            padding: 12px;
            border-radius: var(--radius-md);
            font-weight: 600;
            transition: all 0.2s;
        }
        .btn-request-otp:hover {
            background: #dbeafe;
            transform: translateY(-1px);
        }

        .otp-inputs {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 1rem;
        }
        .otp-char {
            width: 45px;
            height: 50px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 1.5rem;
            text-align: center;
            font-weight: 700;
            color: var(--text-main);
        }
        .otp-char:focus {
            border-color: var(--primary);
            outline: none;
            transform: translateY(-2px);
        }

        /* Animation Area for OTP */
        .otp-section-hidden {
            display: grid;
            grid-template-rows: 0fr;
            transition: grid-template-rows 0.4s ease-out, opacity 0.4s ease-out;
            opacity: 0;
            overflow: hidden;
        }
        .otp-section-hidden.expanded {
            grid-template-rows: 1fr;
            opacity: 1;
            margin-top: 1.5rem;
        }
        .otp-inner {
            min-height: 0; /* Required for grid transition */
        }

        /* Submit Button */
        .btn-login-action {
            width: 100%;
            background: var(--primary);
            color: white;
            font-size: 1rem;
            font-weight: 700;
            padding: 1rem;
            border-radius: var(--radius-xl);
            border: none;
            box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
            transition: all 0.3s ease;
        }
        .btn-login-action:hover {
            background: var(--primary-hover);
            transform: translateY(-2px);
            box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
        }

        /* Checkbox */
        .remember-wrap {
            display: flex;
            align-items: center;
            cursor: pointer;
            user-select: none;
            margin-bottom: 2rem;
        }
        .remember-wrap input { display: none; }
        .custom-box {
            width: 22px; height: 22px;
            background: #f1f5f9;
            border: 2px solid #cbd5e1;
            border-radius: 6px;
            margin-right: 10px;
            position: relative;
            transition: all 0.2s;
        }
        .remember-wrap input:checked + .custom-box {
            background: var(--primary);
            border-color: var(--primary);
        }
        .remember-wrap input:checked + .custom-box::after {
            content: '';
            position: absolute;
            left: 6px; top: 2px;
            width: 6px; height: 12px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
        .remember-text {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--secondary);
        }

        /* Footer */
        .login-footer {
            text-align: center;
            font-size: 0.8rem;
            color: var(--text-muted);
            padding-top: 1rem;
            border-top: 1px solid #f1f5f9;
            margin-top: auto; /* Fail-safe for flexbox */
        }
        .login-footer a {
            color: var(--secondary);
            text-decoration: none;
            transition: color 0.2s;
            font-weight: 500;
        }
        .login-footer a:hover { color: var(--primary); }
        .footer-links span { margin: 0 6px; color: #cbd5e1; }

        /* --- RESPONSIVE --- */
        @media (max-width: 992px) {
            .login-left { display: none; }
            .login-right { flex: 1; padding: 1.5rem; }
            
            .login-form-container {
                max-width: 100%;
                padding: 1rem;
            }
        }
        
        @media (max-height: 700px) {
            .brand-header { margin-bottom: 1.5rem; }
            .auth-toggle-wrapper { margin-bottom: 1.5rem; }
            .hero-title { font-size: 2.2rem; }
            .login-left { padding: 2rem; }
        }

        .shake-field { animation: shake 0.5s; border-color: #ef4444 !important; }
        @keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }