/* Login Page Styles */
:root {
    --primary-color: #0a2463; /* Aligned with shared.css */
    --secondary-color: #DAA520; /* Aligned with shared.css */
    --accent-color: #e76f51; /* Kept for distinct buttons */
    --light-color: #f8f9fa;
    --dark-color: #2d3142;
    --text-color: #333333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

* {
    box-sizing: border-box; /* Ensure padding/border included in width */
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: linear-gradient(135deg, rgba(10, 36, 99, 0.05) 0%, rgba(218, 165, 32, 0.05) 100%);
}

.login-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-container:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    font-family: 'Poppins', sans-serif;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.logo p {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 400;
}

.welcome-text {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-text h2 {
    font-family: 'Poppins', sans-serif;
    color: var(--dark-color);
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.welcome-text p {
    color: var(--text-light);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    color: var(--dark-color);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px; /* Reduced padding to prevent overflow */
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--light-color);
    transition: var(--transition);
    outline: none;
    font-family: 'Open Sans', sans-serif;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.password-toggle {
    position: absolute;
    right: 10px; /* Adjusted to stay within input */
    top: 50%; /* Center vertically */
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    transition: var(--transition);
}

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

.forgot-password {
    text-align: right;
    margin-bottom: 25px;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

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

.forgot-password a i {
    margin-right: 5px;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: var(--accent-color);
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.login-btn:hover:not(:disabled) {
    background: #e6b800;
    transform: translateY(-2px);
}

.login-btn:disabled {
    background: #9ab3c5;
    cursor: not-allowed;
}

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

.login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.register-link {
    text-align: center;
    margin-top: 25px;
    color: var(--text-light);
    font-size: 0.95rem;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.register-link a:hover {
    color: var(--accent-color);
}

.register-link a i {
    margin-left: 5px;
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border-left: 4px solid #d32f2f;
    animation: fadeIn 0.3s ease;
}

.error-message i {
    margin-right: 8px;
}

.forgot-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.forgot-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.forgot-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.3s ease;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.forgot-content h3 {
    font-family: 'Poppins', sans-serif;
    color: var(--dark-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.forgot-content p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.forgot-content .form-group {
    text-align: left;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--accent-color);
}

.modal-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--accent-color);
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.modal-btn:hover:not(:disabled) {
    background: #e6b800;
}

.modal-btn:disabled {
    background: #9ab3c5;
    cursor: not-allowed;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-family: 'Open Sans', sans-serif;
    display: none;
    align-items: center;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-success {
    background-color: #e8f5e9;
    color: var(--success-color); /* #4caf50 from shared.css */
    border-left: 4px solid var(--success-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 575.98px) {
    .login-container {
        padding: 25px 20px; /* Reduced padding */
        margin: 10px;
        max-width: 100%;
    }

    .forgot-content {
        padding: 20px; /* Reduced padding */
    }

    .logo h1 {
        font-size: 2rem;
    }

    .welcome-text h2 {
        font-size: 1.5rem;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .password-toggle {
        right: 8px;
        top: 48%; /* Adjust for smaller padding */
    }

    .login-btn, .modal-btn {
        padding: 12px;
        font-size: 1rem;
    }
}