:root {
    /* Light mode variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f9fe;
    --bg-tertiary: #f1f6fe;
    --text-primary: #444444;
    --text-secondary: #777777;
    --text-muted: #999999;
    --border-color: #e2eefd;
    --card-shadow: 0 0 29px 0 rgba(68, 88, 144, 0.12);
    --card-shadow-hover: 0px 0 25px 0 rgba(16, 110, 234, 0.1);
    --primary-color: #cc0000;
    --primary-hover: #990000;
    --primary-light: #fecaca;
    --navbar-bg: #ffffff;
    --topbar-bg: #cc0000;
    --hero-overlay: rgba(0, 0, 0, 0.7);
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --footer-bg: #f1f6fe;
    --gradient-primary: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    --gradient-shield: linear-gradient(135deg, #cc0000 0%, #990000 50%, #7d0000 100%);
}

[data-theme="dark"] {
    /* Dark mode variables */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #e9ecef;
    --text-muted: #adb5bd;
    --border-color: #495057;
    --card-shadow: 0 0 29px 0 rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0px 0 25px 0 rgba(255, 255, 255, 0.1);
    --primary-color: #cc0000;
    --primary-hover: #990000;
    --primary-light: #fecaca;
    --navbar-bg: #2d2d2d;
    --topbar-bg: #cc0000;
    --hero-overlay: rgba(0, 0, 0, 0.8);
    --input-bg: #404040;
    --input-border: #6c757d;
    --footer-bg: #2d2d2d;
    --gradient-primary: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    --gradient-shield: linear-gradient(135deg, #cc0000 0%, #990000 50%, #7d0000 100%);
}

* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

body {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

body.theme-loaded {
    transition: all 0.5s ease;
}

/* Login Container */
.login-container {
    padding: 20px;
}

.login-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 600px;
}

.login-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-5px);
}

/* Shield Section - Left Side */
.shield-section {
    background: var(--gradient-shield);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.shield-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.shield-container {
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
}

.shield-icon-wrapper {
    margin-bottom: 2rem;
}

.shield-icon-wrapper i {
    font-size: 8rem;
    color: white;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.shield-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.shield-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.security-features {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.feature-item i {
    font-size: 1.2rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.feature-item span {
    font-weight: 500;
}

/* Form Section - Right Side */
.form-section {
    padding: 0;
}

.form-section .card-body {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* Logo Styling */
.mobile-logo {
    height: 60px;
    width: auto;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.desktop-logo {
    height: 80px;
    width: auto;
    border-radius: 12px;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.desktop-logo:hover {
    transform: scale(1.05);
}

/* Login Title */
.login-title {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.login-title i {
    color: var(--primary-color);
}

/* Form Styling */
.form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.form-label i {
    color: var(--primary-color);
    width: 16px;
}

.form-control {
    background-color: var(--input-bg);
    border: 2px solid var(--input-border);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    height: auto;
}

.form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 38, 38, 0.25);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Button Styling */
.login-btn {
    background: var(--gradient-primary);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 1.1rem;
    height: auto;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

/* Loading Animation */
.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Links Styling */
.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    transform: translateX(2px);
}

.student-login-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.student-login-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Error Styling */
.invalid-feedback {
    color: var(--primary-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.is-invalid {
    border-color: var(--primary-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        margin-top: 20px;
        padding: 15px;
    }

    .form-section .card-body {
        padding: 2rem 1.5rem;
    }

    .shield-section {
        display: none;
    }

    .login-card {
        min-height: auto;
    }

    .mobile-logo {
        height: 50px;
    }

    .login-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .form-section .card-body {
        padding: 1.5rem 1rem;
    }

    .login-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .shield-icon-wrapper i {
        font-size: 10rem;
    }

    .shield-content h2 {
        font-size: 3rem;
    }
}

/* Focus indicators for accessibility */
.form-control:focus,
.login-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Text colors */
.text-muted {
    color: var(--text-muted) !important;
}

.border-top {
    border-color: var(--border-color) !important;
}

/* Additional animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.form-section .card-body>* {
    animation: fadeInUp 0.6s ease-out;
}

.form-section .card-body>*:nth-child(1) {
    animation-delay: 0.1s;
}

.form-section .card-body>*:nth-child(2) {
    animation-delay: 0.2s;
}

.form-section .card-body>*:nth-child(3) {
    animation-delay: 0.3s;
}

.form-section .card-body>*:nth-child(4) {
    animation-delay: 0.4s;
}

.form-section .card-body>*:nth-child(5) {
    animation-delay: 0.5s;
}

.form-section .card-body>*:nth-child(6) {
    animation-delay: 0.6s;
}