/*
 * Scoped Login Form Styles
 * 
 * Purpose: Provides consistent styling for login forms across modal and page contexts
 * Scope: All styles are scoped to .auth-login to prevent conflicts with other components
 * 
 * Rollback: Delete this file to revert to individual form styles
 */

/* Base Container */
.auth-login {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

/* Page Context Styling */
.auth-login--page {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

/* Modal Context Styling */
.auth-login--modal {
    /* Modal context inherits modal styling from parent */
}

/* Header Section */
.auth-login__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.auth-login__logo {
    margin-bottom: 15px;
}

.auth-login__logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.auth-login__title {
    margin: 0 0 8px 0;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.5px;
}

.auth-login__subtitle {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Form Section */
.auth-login__form {
    padding: 30px;
    background: #fafbfc;
}

.auth-login__fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.auth-login__field {
    margin-bottom: 25px;
}

.auth-login__field--remember {
    margin-bottom: 20px;
}

/* Labels */
.auth-login__label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Input Wrapper */
.auth-login__input-wrapper {
    position: relative;
}

/* Input Fields */
.auth-login__input {
    width: 100%;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    padding: 12px 45px 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    outline: none;
}

.auth-login__input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-login__input:hover {
    border-color: #cbd3da;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.auth-login__input::placeholder {
    color: #adb5bd;
    font-size: 13px;
}

/* Input Icons */
.auth-login__input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
    font-size: 14px;
    pointer-events: none;
}

/* Forgot Password Link */
.auth-login__forgot-password {
    text-align: right;
    margin-top: 8px;
}

.auth-login__forgot-link {
    color: #667eea;
    font-size: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-login__forgot-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Checkbox Styling */
.auth-login__checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #5a6c7d;
    font-weight: 500;
    user-select: none;
}

.auth-login__checkbox {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    border: 2px solid #e1e8ed;
    border-radius: 3px;
    background: white;
    transition: all 0.3s ease;
    accent-color: #667eea;
}

.auth-login__checkbox:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.auth-login__checkbox:checked {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.auth-login__checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.auth-login__checkbox-text {
    flex: 1;
}

/* Error Messages */
.auth-login__error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.auth-login__error::before {
    content: "⚠";
    margin-right: 5px;
}

/* Alert Messages */
.auth-login__alert {
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
}

.auth-login__alert--error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.auth-login__alert--success {
    background: #efe;
    border: 1px solid #cfc;
    color: #363;
}

.auth-login__alert-icon {
    margin-right: 8px;
    margin-top: 1px;
    flex-shrink: 0;
}

.auth-login__alert-content {
    flex: 1;
}

/* Footer Section */
.auth-login__footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 20px 30px;
    text-align: center;
}

/* Submit Button */
.auth-login__submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-login__submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.auth-login__submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.auth-login__submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.auth-login__submit-icon {
    margin-right: 8px;
}

/* Modal-specific adjustments */
.auth-login--modal .auth-login__form {
    padding: 30px;
}

.auth-login--modal .auth-login__footer {
    padding: 20px 30px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-login--page {
        margin: 20px;
        border-radius: 8px;
    }
    
    .auth-login__header,
    .auth-login__form,
    .auth-login__footer {
        padding: 20px;
    }
    
    .auth-login__title {
        font-size: 18px;
    }
    
    .auth-login__input {
        padding: 10px 40px 10px 12px;
        font-size: 13px;
    }
    
    .auth-login__input-icon {
        right: 12px;
        font-size: 13px;
    }
}

/* Accessibility Improvements */
.auth-login__input:focus,
.auth-login__checkbox:focus,
.auth-login__submit-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-login__input {
        border-width: 3px;
    }
    
    .auth-login__alert--error {
        border-width: 2px;
    }
    
    .auth-login__alert--success {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-login__input,
    .auth-login__checkbox,
    .auth-login__submit-btn,
    .auth-login__forgot-link {
        transition: none;
    }
    
    .auth-login__submit-btn:hover {
        transform: none;
    }
}
