        :root {
            /* Dark Theme Variables */
            --bg-gradient-start: #0a0a0a;
            --bg-gradient-end: #222222;
            --text-color: #f0f0f0;
            --card-bg: rgba(26, 26, 26, 0.85);
            --card-border: rgba(60, 60, 60, 0.5);
            --accent: #ffd700; /* Gold/Yellow */
            --input-bg: rgba(13, 13, 13, 0.7);
            --input-border: rgba(60, 60, 60, 0.7);
            --placeholder-color: #aaaaaa;
            --link-color: #bbbbbb;
            --button-text-color: #000000;
            --card-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
            --focus-glow: 0 0 0 4px rgba(var(--accent-rgb), 0.5);
            --card-glow-start: rgba(255, 215, 0, 0.1);
            --card-glow-end: rgba(255, 215, 0, 0);
            --teacher-button-bg: #444444;
            --teacher-button-text-color: #f0f0f0;
            --teacher-button-hover-bg: #555555;
            --accent-rgb: 255, 215, 0;
            font-size: 16px;
        }

        html, body {
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        body {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
            color: var(--text-color);
            font-family: 'Cairo', sans-serif;
            transition: background 1s ease-in-out, color 0.6s ease-in-out;
            position: relative;
        }

        /* Background animation elements */
        .background-elements {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            overflow: hidden;
            z-index: 0;
        }

        .background-elements span {
            position: absolute;
            display: block;
            width: 20px;
            height: 20px;
            background: rgba(var(--accent-rgb), 0.1);
            animation: animate 15s linear infinite;
            bottom: -150px;
            border-radius: 50%;
            opacity: 0.7;
            filter: blur(2px);
        }

        .background-elements span:nth-child(1) { left: 10%; animation-duration: 10s; width: 30px; height: 30px; opacity: 0.6; }
        .background-elements span:nth-child(2) { left: 20%; animation-duration: 12s; opacity: 0.8; }
        .background-elements span:nth-child(3) { left: 25%; animation-duration: 14s; width: 40px; height: 40px; opacity: 0.5; }
        .background-elements span:nth-child(4) { left: 40%; animation-duration: 11s; opacity: 0.7; }
        .background-elements span:nth-child(5) { left: 50%; animation-duration: 13s; width: 25px; height: 25px; opacity: 0.6; }
        .background-elements span:nth-child(6) { left: 65%; animation-duration: 10s; opacity: 0.8; }
        .background-elements span:nth-child(7) { left: 70%; animation-duration: 15s; width: 35px; height: 35px; opacity: 0.5; }
        .background-elements span:nth-child(8) { left: 80%; animation-duration: 12s; opacity: 0.7; }
        .background-elements span:nth-child(9) { left: 90%; animation-duration: 14s; width: 20px; height: 20px; opacity: 0.6; }

        @keyframes animate {
            0% { transform: translateY(0) rotate(0deg); opacity: 0; border-radius: 0; }
            10% { opacity: 0.7; border-radius: 50%; }
            100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; border-radius: 50%; }
        }

        .login-container {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 700px;
            padding: 1.5rem;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            animation: fadeIn 1s ease-out forwards;
            opacity: 0;
            animation-delay: 0.5s;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .login-card {
            background: var(--card-bg);
            border: 1px solid var(--card-border);
            padding: 4rem 3rem 3rem 3rem;
            border-radius: 1.5rem;
            box-shadow: var(--card-shadow);
            width: 100%;
            box-sizing: border-box;
            text-align: center;
            backdrop-filter: blur(10px) saturate(1.2);
            -webkit-backdrop-filter: blur(10px) saturate(1.2);
            transition: background 0.6s, box-shadow 0.6s, border 0.6s;
            position: relative;
        }

        .login-card:hover {
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
        }

        .login-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 1.5rem;
            background: radial-gradient(circle at 50% 50%, var(--card-glow-start) 0%, var(--card-glow-end) 70%);
            opacity: 0;
            transition: opacity 0.5s ease-in-out;
            z-index: -1;
        }

        .login-card:hover::before {
            opacity: 1;
        }

        .login-card h1 {
            color: var(--accent);
            margin-bottom: 3.5rem;
            font-size: 2.5rem;
            font-weight: 700;
            letter-spacing: 1px;
            transition: color 0.5s;
            text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
        }

        .form-horizontal {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
            justify-content: center;
            margin-bottom: 1.5rem;
        }

        .form-group {
            flex: 1 1 45%;
            min-width: 250px;
            text-align: right;
            position: relative;
        }

        .password-input-wrapper {
            position: relative;
            width: 100%;
        }

        .form-group label {
            display: block;
            color: var(--text-color);
            font-size: 1.1rem;
            margin-bottom: 0.7rem;
            transition: color 0.5s;
        }

        .form-group input {
            width: 100%;
            padding: 1rem 1.2rem;
            border: 1px solid var(--input-border);
            border-radius: 0.6rem;
            background-color: var(--input-bg);
            color: var(--text-color);
            font-family: 'Cairo', sans-serif;
            font-size: 1.05rem;
            box-sizing: border-box;
            transition: background-color 0.5s, border-color 0.5s, color 0.5s, box-shadow 0.3s;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
            padding-left: 3rem;
        }

        .form-group input::placeholder {
            color: var(--placeholder-color);
            opacity: 0.9;
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: var(--focus-glow), 0 0 10px rgba(var(--accent-rgb), 0.6);
        }

        .toggle-password {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: var(--placeholder-color);
            font-size: 1.2rem;
            transition: color 0.3s ease;
            z-index: 2;
        }

        .toggle-password:hover {
            color: var(--accent);
        }

        .forgot-password {
            display: block;
            text-align: left;
            margin-top: -0.5rem;
            margin-bottom: 2rem;
            font-size: 0.98rem;
        }

        .forgot-password a {
            color: var(--link-color);
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .forgot-password a:hover {
            color: var(--accent);
            text-decoration: underline;
        }

        .login-button {
            background: var(--accent);
            color: var(--button-text-color);
            padding: 1.1rem 2rem;
            border: none;
            border-radius: 0.6rem;
            cursor: pointer;
            font-size: 1.3rem;
            font-weight: bold;
            width: calc(100% - 3rem);
            max-width: 400px;
            margin: 0 auto 1rem auto;
            display: block;
            transition: background 0.3s, opacity 0.3s, transform 0.3s, box-shadow 0.3s;
            opacity: 0.95;
            letter-spacing: 0.8px;
            position: relative;
            overflow: hidden;
        }

        .login-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.6s ease;
        }

        .login-button:hover {
            opacity: 1;
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(var(--accent-rgb), 0.6);
        }

        .login-button:hover::before {
            left: 100%;
        }

        .teacher-login-button {
            background: var(--teacher-button-bg);
            color: var(--teacher-button-text-color);
            padding: 1.1rem 2rem;
            border: none;
            border-radius: 0.6rem;
            cursor: pointer;
            font-size: 1.2rem;
            font-weight: bold;
            width: calc(100% - 3rem);
            max-width: 400px;
            margin: 0.5rem auto 2.5rem auto;
            display: block;
            transition: background 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s;
            opacity: 0.9;
            letter-spacing: 0.6px;
        }

        .teacher-login-button:hover {
            background: var(--teacher-button-hover-bg);
            opacity: 1;
            transform: translateY(-3px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
        }

        .signup-link {
            font-size: 1.05rem;
            color: var(--text-color);
            margin-bottom: 2.5rem;
            transition: color 0.5s;
        }
        
        .signup-link a {
            color: var(--accent);
            text-decoration: none;
            font-weight: bold;
            transition: color 0.3s ease;
        }

        .signup-link a:hover {
            text-decoration: underline;
        }

        .error {
            color: #ff6347;
            background-color: rgba(255, 99, 71, 0.1);
            border: 1px solid #ff6347;
            padding: 10px 15px;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            font-size: 0.95rem;
            font-weight: bold;
            text-align: center;
            transition: background-color 0.3s, color 0.3s, border-color 0.3s;
        }

        /* Responsive adjustments for screens up to 768px */
        @media (max-width: 768px) {
            .login-container {
                max-width: 90%;
                padding: 1rem;
            }
            .login-card {
                padding: 2.5rem 1.5rem;
                transform: rotateZ(0deg);
                box-shadow: var(--card-shadow);
            }
            .login-card:hover {
                transform: rotateZ(0deg) scale(1);
            }
            .login-card:hover::before {
                opacity: 0;
            }
            .login-card h1 {
                font-size: 2rem;
                margin-bottom: 1.8rem;
            }
            .form-horizontal {
                flex-direction: column;
                gap: 1rem;
            }
            .form-group {
                flex: 1 1 100%;
                min-width: unset;
            }
            .form-group input {
                padding: 0.8rem 1rem;
                padding-left: 2.5rem;
            }
            .toggle-password {
                left: 0.8rem;
                font-size: 1.1rem;
            }
            .login-button, .teacher-login-button {
                padding: 1rem 1.5rem;
                font-size: 1.1rem;
                width: 100%;
                max-width: none;
            }
        }
        
        /* Responsive adjustments for smaller screens up to 480px (mobile) */
        @media (max-width: 480px) {
            .login-card h1 {
                font-size: 1.5rem;
                margin-bottom: 1.5rem;
            }
            .form-group label {
                font-size: 1rem;
                margin-bottom: 0.5rem;
            }
            .form-group input {
                font-size: 0.95rem;
            }
            .login-button, .teacher-login-button {
                font-size: 1rem;
                padding: 0.8rem 1.2rem;
            }
            .signup-link {
                font-size: 0.9rem;
            }
            .forgot-password {
                font-size: 0.9rem;
            }
        }