:root {
    --primary-color: #003366;
    --secondary-color: #005a9e;
    --accent-color: #f0ad4e;
    --light-bg: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --hover-color: #dc3545;
}

/* --- Base & Background --- */
body {
    font-family: 'Poppins', sans-serif;
    background-image: linear-gradient(rgba(0, 10, 30, 0.7), rgba(0, 20, 40, 0.85)), url('https://images.unsplash.com/photo-1600985163348-5389b7a48d13?auto=format&fit=crop&q=80&w=2070');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #f0f4f8;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Animation Keyframes --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* --- Login Container --- */
.login-container {
    background: var(--light-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    color: var(--accent-color);
    animation: fadeIn 1s ease-out;
}

/* --- Form Styling --- */
.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.3rem;
    display: block;
    color: #f0f4f8;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(240, 173, 78, 0.4);
    outline: none;
    background-color: #fff;
}

/* --- Password Field with Eye Icon --- */
.password-container {
    display: flex;
    align-items: center;
    position: relative;
}

.password-container input {
    flex: 1;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.eye-icon {
    width: 22px;
    height: 22px;
    fill: var(--secondary-color);
    transition: fill 0.3s ease;
}

/* --- Forgot Password --- */
.forgot-password {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #d8932e;
    text-decoration: underline;
}

/* --- Captcha --- */
.captcha-wrapper {
    margin-top: 1rem;
}

.captcha-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.8rem;
    border: 1px solid var(--border-color);
}

.captcha {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--accent-color);
    user-select: none;
}

.refresh-btn {
    background: var(--accent-color);
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #d8932e;
    transform: scale(1.05);
}

/* --- Submit Button --- */
button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--accent-color);
    border: none;
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
    cursor: pointer;
}

button[type="submit"]:hover {
    background-color: #d8932e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* --- Error Message Styling --- */
.error-message {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.25));
    border: 1px solid rgba(220, 53, 69, 0.6);
    color: #ffebee;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: slideInUp 0.6s ease-out;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.error-message i {
    margin-right: 0.5rem;
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.error-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e, #ff6b6b);
    border-radius: 0.75rem 0.75rem 0 0;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* --- Success Message Styling --- */
.success-message {
    background: rgba(25, 135, 84, 0.2);
    border: 1px solid rgba(25, 135, 84, 0.5);
    color: #d1e7dd;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

/* --- Responsive Design --- */
@media (max-width: 480px) {
    .login-container {
        margin: 1rem;
        padding: 2rem;
        max-width: calc(100% - 2rem);
    }
    
    .login-container h2 {
        font-size: 1.5rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="password"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* --- Loading State --- */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

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

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