:root {
            --primary: #EF4444;       
            --primary-hover: #dc2626;
            --secondary: #22C55E;     
            --secondary-hover: #16a34a;
            --dark: #111827;
            --gray: #6B7280;
            --glass: rgba(255, 255, 255, 0.85);
            --border: rgba(255, 255, 255, 0.5);
            --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

        body {
            background: #fdf2f2;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            overflow-x: hidden;
            position: relative;
        }

        /* --- BACKGROUND ANIMATION --- */
        .bg-shape {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            z-index: -1;
            animation: float 10s infinite alternate;
        }
        .shape-1 { width: 300px; height: 300px; background: rgba(239, 68, 68, 0.4); top: -50px; left: -50px; }
        .shape-2 { width: 400px; height: 400px; background: rgba(34, 197, 94, 0.3); bottom: -100px; right: -100px; animation-delay: -5s; }
        @keyframes float { 0% { transform: translate(0, 0); } 100% { transform: translate(30px, 50px); } }

        /* --- GLASS CARD --- */
        .login-container {
            background: var(--glass);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--border);
            border-radius: 24px;
            box-shadow: var(--shadow);
            width: 100%;
            max-width: 450px;
            padding: 2.5rem;
            position: relative;
            opacity: 0;
            animation: slideUp 0.6s ease-out forwards;
        }
        @keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

        /* Close Button */
        .close-btn {
            position: absolute;
            top: 15px; right: 15px;
            color: var(--gray); font-size: 1.2rem;
            background: rgba(255,255,255,0.6);
            width: 40px; height: 40px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            transition: 0.3s; z-index: 10; text-decoration: none;
        }
        .close-btn:hover { color: var(--primary); background: white; transform: rotate(90deg); }

        .form-header { text-align: center; margin-bottom: 2rem; transition: opacity 0.3s; }
        .form-header h2 { font-size: 1.8rem; color: var(--dark); margin-bottom: 0.5rem; }
        .form-header p { color: var(--gray); font-size: 0.9rem; }

        /* --- TOGGLE BUTTONS --- */
        .toggle-btn-container {
            display: flex; background: rgba(0,0,0,0.05);
            border-radius: 50px; padding: 5px; margin-bottom: 2rem; position: relative;
        }
        .toggle-btn {
            flex: 1; border: none; background: transparent;
            padding: 10px; border-radius: 50px; cursor: pointer;
            font-weight: 600; color: var(--gray); transition: 0.3s; z-index: 1;
        }
        .toggle-btn.active { color: white; }
        
        .slider {
            position: absolute; top: 5px; left: 5px;
            height: calc(100% - 10px); width: calc(50% - 5px);
            background: var(--primary); border-radius: 50px;
            transition: 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
            z-index: 0; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
        }
        .toggle-btn-container.register-mode .slider {
            transform: translateX(100%);
            background: var(--secondary);
            box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
        }

        /* --- INPUTS --- */
        .input-group { margin-bottom: 1.2rem; }
        .input-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--dark); }
        .input-group input, .input-group select {
            width: 100%; padding: 12px 15px;
            border: 2px solid transparent; background: rgba(255, 255, 255, 0.6);
            border-radius: 12px; font-size: 0.95rem; outline: none; transition: 0.3s;
        }
        .input-group input:focus, .input-group select:focus {
            background: white; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
        }

        /* Error States */
        .input-group input.error { border-color: var(--primary); animation: shake 0.3s; }
        .error-msg { color: var(--primary); font-size: 0.75rem; margin-top: 4px; display: none; }
        .input-group input.error + .error-msg { display: block; }
        @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

        /* --- BUTTONS --- */
        .btn-primary {
            width: 100%; padding: 14px;
            background: var(--primary); color: white;
            border: none; border-radius: 12px;
            font-size: 1rem; font-weight: 600;
            cursor: pointer; transition: 0.3s; margin-top: 1rem;
            box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
            display: flex; justify-content: center; align-items: center; gap: 10px;
        }
        .btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
        .btn-primary:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

        .btn-success { background-color: var(--secondary) !important; box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3) !important; }
        .btn-success:hover { background-color: var(--secondary-hover) !important; }

        /* --- SUCCESS POPUP OVERLAY --- */
        .success-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 24px;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            z-index: 20;
            opacity: 0; pointer-events: none; transition: 0.4s;
            transform: scale(0.9);
        }
        .success-overlay.active { opacity: 1; pointer-events: all; transform: scale(1); }

        /* Checkmark Animation */
        .checkmark-circle { width: 80px; height: 80px; background: var(--secondary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3); animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
        .checkmark-circle i { font-size: 40px; color: white; }
        @keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

        .success-text { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin-bottom: 5px; }
        .success-sub { color: var(--gray); font-size: 0.9rem; }

        /* Helper Classes */
        .hidden { display: none; }
        .auth-form { animation: fadeIn 0.4s ease-in-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        @media (max-width: 480px) { .login-container { padding: 1.5rem; margin: 10px; } }


        /* --- PRIVACY CONSENT TOGGLE --- */
.consent-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 1.5rem 0;
    padding: 15px;
    background: rgba(34, 197, 94, 0.05); /* Soft green tint matching your success color */
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1; /* Gray off state */
    transition: .4s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy smooth animation */
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--secondary); /* Turns green when active */
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.consent-text {
    font-size: 0.8rem;
    color: var(--gray);
    line-height: 1.4;
    margin-top: 2px;
}

.consent-text a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.consent-text a:hover {
    text-decoration: underline;
}

/* Force pure grey for disabled state to override original styles */
.btn-primary:disabled, .btn-success:disabled {
    background: #e2e8f0 !important; 
    color: #94a3b8 !important; 
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}