/* Styles pour les pages d'authentification */
.auth-body {
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--white) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-electric), var(--blue-hover));
}

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

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--blue-electric);
    margin-bottom: var(--space-sm);
}

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

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

.error-message,
.success-message {
    padding: var(--space-sm);
    border-radius: 6px;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
    animation: slideDown var(--transition-base);
}

.error-message {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.success-message {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

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

.two-factor-section {
    display: none;
    text-align: center;
    padding: var(--space-xl);
    background: var(--gray-light);
    border-radius: 8px;
    margin: var(--space-lg) 0;
    border: 1px solid var(--gray-border);
}

.two-factor-section.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

.code-input {
    font-size: var(--font-size-xl);
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: 600;
    padding: var(--space-md);
    border: 2px solid var(--gray-border);
    border-radius: 8px;
    transition: border-color var(--transition-fast);
}

.code-input:focus {
    border-color: var(--blue-electric);
    outline: none;
    box-shadow: 0 0 0 3px var(--blue-light);
}

.resend-code {
    background: none;
    border: none;
    color: var(--blue-electric);
    text-decoration: underline;
    cursor: pointer;
    font-size: var(--font-size-sm);
    margin-top: var(--space-md);
    transition: color var(--transition-fast);
}

.resend-code:hover:not(:disabled) {
    color: var(--blue-hover);
}

.resend-code:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    text-decoration: none;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-border);
}

.auth-footer p {
    margin: var(--space-sm) 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--blue-electric);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--blue-hover);
    text-decoration: underline;
}

/* Progress bar styles */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-border);
    z-index: 1;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: var(--space-sm);
    border-radius: 8px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--gray-light);
    position: relative;
    z-index: 2;
    transition: all var(--transition-base);
}

.progress-step > div:first-child {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xs);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.progress-step.active {
    background: var(--blue-light);
    color: var(--blue-electric);
}

.progress-step.active > div:first-child {
    background: var(--blue-electric);
}

.progress-step.completed {
    background: var(--blue-electric);
    color: white;
}

.progress-step.completed > div:first-child {
    background: var(--blue-electric);
}

.progress-step.completed > div:first-child::after {
    content: '✓';
}

/* File upload styles */
.file-upload {
    border: 2px dashed var(--gray-border);
    border-radius: 8px;
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--gray-light);
}

.file-upload:hover {
    border-color: var(--blue-electric);
    background: var(--blue-light);
}

.file-upload.dragover {
    border-color: var(--blue-electric);
    background: var(--blue-light);
    transform: scale(1.02);
}

/* Two-factor options */
.two-factor-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.two-factor-option {
    padding: var(--space-md);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.two-factor-option:hover {
    border-color: var(--blue-electric);
    background: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.two-factor-option.selected {
    border-color: var(--blue-electric);
    background: var(--blue-electric);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.two-factor-option > div:first-child {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.two-factor-option > div:nth-child(2) {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.two-factor-option > div:nth-child(3) {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-body {
        padding: var(--space-md);
    }
    
    .auth-container {
        padding: var(--space-lg);
    }
    
    .auth-title {
        font-size: var(--font-size-xl);
    }
    
    .code-input {
        font-size: var(--font-size-lg);
        letter-spacing: 0.3em;
    }
    
    .progress-step {
        font-size: 10px;
    }
    
    .progress-step > div:first-child {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* Loading states */
.loading .submit-btn {
    position: relative;
    color: transparent;
}

.loading .submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--white);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus management */
.auth-container:focus-within {
    box-shadow: 0 0 0 3px var(--blue-light);
}

/* High contrast support */
@media (prefers-contrast: high) {
    .auth-container {
        border: 2px solid var(--text-primary);
    }
    
    .error-message {
        background: var(--text-primary);
        color: var(--white);
    }
    
    .success-message {
        background: var(--admin-success);
        color: var(--white);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-container,
    .two-factor-section,
    .progress-step,
    .two-factor-option,
    .error-message,
    .success-message {
        animation: none;
        transition: none;
    }
}
