/* =====================================================
   A1 SCHEDULE - AUTHENTICATION PAGES
   Modern Login/Register Styles
   ===================================================== */

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

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    padding: var(--space-4);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1200px;
    width: 100%;
    background: var(--surface-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 600px;
}

@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .auth-image {
        display: none;
    }
}

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

.auth-card {
    padding: var(--space-12) var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 600px;
}

@media (max-width: 768px) {
    .auth-card {
        padding: var(--space-8) var(--space-6);
        min-height: auto;
    }
}

/* =====================================================
   AUTH HEADER
   ===================================================== */

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo {
    margin-bottom: var(--space-6);
}

.logo-image {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.auth-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    line-height: var(--leading-tight);
}

.auth-subtitle {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin: 0;
}

/* =====================================================
   AUTH FORM
   ===================================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin: 0;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--text-tertiary);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
}

.auth-form .form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) 44px !important;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    transition: all var(--duration-fast) var(--ease-out);
    background: var(--surface-primary);
    color: var(--text-primary);
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-form .form-input.error {
    border-color: var(--border-error);
}

.auth-form .form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-form .form-input::placeholder {
    color: var(--text-tertiary);
}

/* Password field with toggle button needs extra right padding */
.auth-form input[type="password"].form-input,
.auth-form input[type="text"]#password.form-input {
    padding-right: 48px !important;
}

.toggle-password {
    position: absolute;
    right: var(--space-4);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-base);
    transition: color var(--duration-fast) var(--ease-out);
}

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

.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--error-600);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}

/* =====================================================
   CHECKBOX GROUP
   ===================================================== */

.checkbox-group {
    margin: var(--space-2) 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    background: var(--surface-primary);
    transition: all var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
    border-color: var(--border-interactive);
}

.checkbox-label input:checked ~ .checkmark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark::after {
    display: block;
}

/* =====================================================
   AUTH DIVIDER
   ===================================================== */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-6) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

.auth-divider span {
    padding: 0 var(--space-4);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    background: var(--surface-primary);
}

/* =====================================================
   AUTH ACTIONS
   ===================================================== */

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* =====================================================
   AUTH IMAGE SECTION
   ===================================================== */

.auth-image {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4) saturate(1.2);
}

.image-overlay {
    position: relative;
    z-index: 2;
    padding: var(--space-12);
    text-align: center;
    color: white;
}

.overlay-content h2 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
    line-height: var(--leading-tight);
}

.overlay-content p {
    font-size: var(--text-lg);
    margin-bottom: var(--space-8);
    opacity: 0.9;
    line-height: var(--leading-relaxed);
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
}

.feature-item i {
    color: var(--primary-400);
    font-size: var(--text-xl);
    width: 24px;
    text-align: center;
}

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

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

.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* =====================================================
   DARK MODE SUPPORT
   ===================================================== */

[data-theme="dark"] .auth-layout {
    background: linear-gradient(135deg, var(--neutral-900) 0%, var(--neutral-800) 100%);
}

[data-theme="dark"] .auth-form .form-input {
    background: var(--surface-secondary);
}

[data-theme="dark"] .checkmark {
    background: var(--surface-secondary);
}

[data-theme="dark"] .auth-divider span {
    background: var(--surface-primary);
}

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

@media (prefers-reduced-motion: reduce) {
    .form-input,
    .checkmark,
    .toggle-password {
        transition: none;
    }
    
    .fa-spinner {
        animation: none;
    }
}

/* High contrast support */
@media (prefers-contrast: more) {
    .form-input {
        border-width: 3px;
    }
    
    .form-input:focus {
        border-width: 3px;
        box-shadow: none;
    }
}

/* Focus indicators for keyboard navigation */
.checkbox-label:focus-within .checkmark {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.toggle-password:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}