/* Login Page Styles */
.login-page {
    margin: 0;
    padding: 0;
    background-color: var(--color-background, #f8f9fa);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-base);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: none;
    /* Add 1px border matching header dark blue */
    border: 1px solid var(--color-primary-dark, #374e64);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

.login-header {
    background: var(--color-primary-dark, #374e64);
    color: white;
    /* Reduced by ~25% from 40/30/30 to 30/24/24 */
    padding: 30px 24px 24px;
    text-align: center;
}

.login-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: var(--font-weight-bold, 600);
    letter-spacing: -0.5px;
    color: white;
}

.login-form {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 24px;
}

/* Add extra spacing between password field and login button */
.password-input-container {
    margin-bottom: 8px;
}

/* Add extra spacing before the login button */
.form-group:has(.btn-login) {
    margin-top: 32px;
}

/* Alternative selector for browsers that don't support :has() */
.btn-login {
    margin-top: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text-primary, #1f2937);
    font-size: 14px;
}

.email-input-container {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-500, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.email-select {
    cursor: pointer;
}

/* Email text box sits directly below its label per standards */
.email-input {
    margin-top: 0;
}

/* Spacing for remember email checkbox under email input */
.remember-email {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* Optional subtle label color for checkbox */
.remember-email label {
    margin: 0;
    font-weight: var(--font-weight-normal, 400);
    color: var(--color-text-secondary, #6b7280);
}

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-secondary, #6b7280);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--color-text-primary, #1f2937);
}

.btn-login {
    width: 100%;
    padding: 14px 20px;
    background: var(--color-primary-dark, #374e64);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: none;
    background: var(--color-primary-light, #3498db);
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary button: full-width, same sizing as primary, lighter style */
.btn-secondary {
    width: 100%;
    padding: 14px 20px;
    background: #f9fafb; /* light neutral */
    color: var(--color-primary-dark, #374e64);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

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

.btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Footer container to place Forgot action at bottom */
.login-footer {
    padding: 0 30px 30px;
}

/* Centered 1px dark blue divider */
.auth-divider {
    height: 1px;
    background: var(--color-primary-dark, #374e64);
    opacity: 0.5;
    width: 100%;
    margin: 0; /* let padding from container handle spacing */
}

/* Ensure footer provides spacing around full-width divider */
.login-footer .auth-divider {
    display: block;
    margin: 16px 0 12px; /* top and bottom spacing */
}

.login-spinner {
    margin-right: 8px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    animation: shakeError 0.5s ease-out;
}

@keyframes shakeError {
    0%, 20%, 40%, 60%, 80% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
}

.error-message i {
    flex-shrink: 0;
}

/* Secondary auth action button */
.btn-link-secondary {
    width: 100%;
    margin-top: 12px; /* spacing under primary sign-in button */
    padding: 10px 12px;
    background: transparent;
    color: var(--color-primary-dark, #374e64);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    font-size: 16px; /* standard/default font size to match inputs */
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-link-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }
    
    .login-header {
        /* Reduced by ~25% from 32/24/24 to 24/18/18 */
        padding: 24px 18px 18px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-form {
        padding: 32px 24px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* Loading state animations */
.form-loading {
    pointer-events: none;
}

.form-loading .form-control {
    opacity: 0.6;
}

/* Success state (for future use) */
.login-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* Extra spacing between success message and return button on reset page */
#successMessage + #returnToLoginContainer {
    margin-top: 20px;
}

/* Focus styles for accessibility */
.form-control:focus,
.btn-login:focus,
.btn-secondary:focus,
.password-toggle:focus {
    outline: 2px solid var(--color-primary-500, #3b82f6);
    outline-offset: 2px;
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .form-control {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-control:focus {
        border-color: var(--color-primary-400, #60a5fa);
    }
}
