/*
   LOGIN.CSS - Login Page Styles
   Developer: Dominic Appleton | ID: 2102508
*/

/* Auth page uses flexbox to center the form vertically and horizontally */
.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Auth container - the login form card */
.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 35px rgba(61, 10, 20, 0.18);
    animation: fadeIn 0.7s ease-out;
    border-top: 4px solid #800020;
}

/* Fade in animation for the card */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-25px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Shake animation for a failed login attempt */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Form title */
.auth-container h2 {
    color: #800020;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8ddd5;
}

/* Brand name on auth pages */
.auth-container .brand-name {
    color: #800020;
}

/* Auth footer with register/login link */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8ddd5;
    color: #5a3535;
}

.auth-footer a {
    color: #800020;
    text-decoration: none;
    font-weight: bold;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Tablet */
@media (max-width: 750px) {
    .auth-container {
        max-width: 500px;
        padding: 30px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .auth-container { padding: 24px; }
}

/* Button group for Login and Cancel buttons */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

/* Button base styles */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    padding: 12px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    flex: 1;
}

/* Login button (Primary) */
.btn-primary {
    background-color: #800020;
    color: white;
}

.btn-primary:hover {
    background-color: #5a0015;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(128, 0, 32, 0.3);
}

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

/* Cancel button (Secondary) */
.btn-secondary {
    background-color: #6c757d;
    color: white;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

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

/* Input error state */
.input-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

/* Error message styling */
.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    min-height: 20px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Login error (form-level error) */
#login-error {
    text-align: center;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 6px;
    background-color: #f8d7da;
    color: #721c24;
    font-size: 14px;
}

/* Attempt warning display */
.attempt-warning {
    font-size: 13px;
    text-align: center;
    margin-top: 15px;
    padding: 8px;
    border-radius: 6px;
    background-color: #fff3cd;
    color: #856404;
    font-weight: 500;
    display: none;
}

.attempt-warning.show {
    display: block;
}

/* Reset password link styling */
.reset-link {
    text-align: center;
    margin-top: 15px;
}

.reset-link a {
    color: #800020;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.reset-link a:hover {
    color: #5a0015;
    text-decoration: underline;
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Mobile responsive for toast */
@media (max-width: 600px) {
    #toast {
        white-space: normal;
        text-align: center;
        max-width: 90%;
        font-size: 12px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        padding: 10px 16px;
    }
}

/* Brand tagline styling */
.brand-tagline {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Form group spacing */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #800020;
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

/* Shake animation class for form */
form.shake {
    animation: shake 0.5s ease;
}
