/* File: static/css/auth.css */
/* Purpose: Styling for authentication pages (login, register, etc.) */
/* Priority: [MAJOR] - Consistent auth UI styling */

/* =============================================================================
   AUTH PAGE LAYOUT
   ============================================================================= */

.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem 0;
    display: flex;
    align-items: center;
}

/* =============================================================================
   AUTH CARD STYLING
   ============================================================================= */

.auth-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -3px rgba(0, 0, 0, 0.12), 0 8px 12px -2px rgba(0, 0, 0, 0.08);
}

/* =============================================================================
   BRAND LOGO IN AUTH PAGES
   ============================================================================= */

.auth-page .brand-logo {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.auth-page .brand-logo:hover {
    color: #3b82f6;
    text-decoration: none;
}

.auth-page .brand-logo i {
    color: #3b82f6;
}

/* =============================================================================
   FORM STYLING
   ============================================================================= */

.auth-card .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.auth-card .form-control {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.auth-card .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
    background: white;
}

.auth-card .form-control:disabled {
    background-color: #f3f4f6;
    opacity: 0.7;
}

.auth-card .form-control.is-invalid {
    border-color: #dc2626;
}

.auth-card .form-control.is-invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.15);
}

/* =============================================================================
   PASSWORD TOGGLE BUTTON
   ============================================================================= */

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #6b7280;
    padding: 0.5rem;
    text-decoration: none;
    z-index: 5;
}

.password-toggle-btn:hover {
    color: #3b82f6;
    background: none;
    text-decoration: none;
}

.password-toggle-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    outline: none;
    border-radius: 4px;
}

/* =============================================================================
   SUBMIT BUTTON STYLING
   ============================================================================= */

.auth-submit-btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-submit-btn:hover::before {
    left: 100%;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -8px rgba(59, 130, 246, 0.5);
}

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

.auth-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-submit-btn:disabled::before {
    display: none;
}

/* =============================================================================
   FORM VALIDATION STYLING
   ============================================================================= */

.invalid-feedback {
    font-size: 0.875rem;
    color: #dc2626;
    display: block;
    margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* =============================================================================
   ALERT STYLING
   ============================================================================= */

.auth-card .alert {
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.auth-card .alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.auth-card .alert-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border-left: 4px solid #16a34a;
}

.auth-card .alert-info {
    background: linear-gradient(135deg, #f0f9ff, #dbeafe);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.auth-card .alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

/* =============================================================================
   LINKS AND NAVIGATION
   ============================================================================= */

.auth-card a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-card a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.auth-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.auth-spinner {
    color: #3b82f6;
}

/* =============================================================================
   FORM GROUPS AND SPACING
   ============================================================================= */

.auth-card .form-group {
    margin-bottom: 1.5rem;
}

.auth-card .form-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* =============================================================================
   DIVIDER STYLING
   ============================================================================= */

.auth-card hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
    margin: 1.5rem 0;
}

/* =============================================================================
   FOOTER TEXT
   ============================================================================= */

.auth-page .text-muted {
    color: #6b7280 !important;
}

.auth-page small {
    font-size: 0.85rem;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .auth-page {
        padding: 1rem 0;
    }
    
    .auth-card {
        margin: 1rem;
        border-radius: 12px;
    }
    
    .auth-page .brand-logo {
        font-size: 1.5rem;
    }
    
    .auth-submit-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .auth-page {
        padding: 0.5rem 0;
    }
    
    .auth-card .card-body {
        padding: 1.5rem !important;
    }
    
    .auth-page .brand-logo {
        font-size: 1.25rem;
    }
    
    .password-toggle-btn {
        right: 4px;
        padding: 0.25rem;
    }
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

.auth-card .form-control:focus,
.auth-card .btn:focus,
.password-toggle-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-submit-btn,
    .auth-card .form-control,
    .password-toggle-btn {
        transition: none;
    }
    
    .auth-submit-btn::before {
        display: none;
    }
}

/* =============================================================================
   HIGH CONTRAST MODE
   ============================================================================= */

@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid #000;
        background: #fff;
    }
    
    .auth-card .form-control {
        border: 2px solid #000;
    }
    
    .auth-submit-btn {
        background: #000;
        border: 2px solid #000;
    }
}