:root {
    /* Enhanced Color Palette with Better Contrast */
    --white: #ffffff;
    --black: #000000;

    /* Brand Primary (Teal) - Enhanced for better contrast */
    --primary: #1E8A88;
    --primary-light: #2CA6A4;
    --primary-lighter: #4FC1BF;
    --primary-dark: #176E6C;

    /* Brand Secondary (Green) - Enhanced */
    --secondary: #6AAD3B;
    --secondary-light: #7BC043;
    --secondary-lighter: #9EDB6B;
    --secondary-dark: #5B9432;

    /* Accent Colors */
    --accent-navy: #1F2D3D;
    --accent-navy-light: #2A3B4F;
    --accent-navy-dark: #141E2B;

    /* Neutral Grays - Improved contrast */
    --light-gray: #F8FAFC;
    --medium-gray: #E2E8F0;
    --dark-gray: #4A5568;

    /* Text Colors - AAA compliant contrast */
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-light: #718096;

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    --secondary-gradient: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-light) 100%);
    --accent-gradient: linear-gradient(135deg, var(--accent-navy-dark) 0%, var(--accent-navy-light) 100%);
    --logo-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary) 50%, var(--accent-navy) 100%);
    --green-gradient: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-light) 100%);

    /* Glow Effects */
    --primary-glow: 0 0 25px rgba(44, 166, 164, 0.5);
    --secondary-glow: 0 0 25px rgba(123, 192, 67, 0.5);
    --accent-glow: 0 0 25px rgba(31, 45, 61, 0.5);

    /* Shadows */
    --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 15px 40px rgba(0, 0, 0, 0.2);

    /* Animation Variables */
    --bg-size: 200% 200%;
}

.login-section {
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.login-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%231E8A88' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-100px) translateY(-100px); }
}

.login-container {
    max-width:1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-heavy);
    border: none;
    overflow: hidden;
}

.login-header {
    background: var(--primary-gradient);
    background-size: var(--bg-size);
    animation: shimmer 3s ease infinite;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    position: relative;
    z-index: 2;
}

.login-body {
    padding: 2.5rem 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border: 2px solid var(--medium-gray);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--primary-glow);
    background: var(--white);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dark-gray);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary);
}

.btn-login {
    background: var(--green-gradient);
    background-size: var(--bg-size);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 2rem;
    font-weight: 600;
    color: var(--white);
    transition: all 0.3s ease;
    animation: shimmer 3s ease infinite;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    color: var(--white);
}

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

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

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

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 138, 136, 0.25);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before, .divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--medium-gray);
}

.divider-text {
    padding: 0 1rem;
    color: var(--dark-gray);
    font-size: 0.875rem;
    font-weight: 500;
}

.login-features {
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--medium-gray);
    box-shadow: var(--shadow-light);
}

.features-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.features-list li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Loading state */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Logo styles */
.auth-logo {
    margin-bottom: 1rem;
    width: 120px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

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

/* Responsive */
@media (max-width: 576px) {
    .login-container {
        margin: 1rem;
    }

    .login-body {
        padding: 2rem 1.5rem;
    }

    .login-header {
        padding: 2rem 1.5rem;
    }

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

/* Success message styles */
.alert-success {
    background: linear-gradient(135deg, #d1ecf1, #c3e6cb);
    border: 1px solid #c3e6cb;
    color: #0c5460;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--primary);
}

/* Form animations */
.form-group {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }

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