/* Design professionnel pour les pages d'authentification */

/* Auth body avec background moderne */
.auth-body {
    background: 
        linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%),
        var(--bg-color);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Animated background elements */
.auth-body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.02) 0%, transparent 50%);
    animation: float-bg 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float-bg {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(1%, -1%) rotate(0.5deg); }
    66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

/* Container principal */
.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Carte d'authentification */
.auth-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 8px 30px rgba(0, 0, 0, 0.05),
        0 0 1px rgba(102, 126, 234, 0.1);
    padding: 3rem;
    border: 1px solid rgba(102, 126, 234, 0.08);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

[data-theme="dark"] .auth-card {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 8px 30px rgba(0, 0, 0, 0.2),
        0 0 1px rgba(124, 138, 237, 0.2);
}

/* Header d'authentification */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    width: 4rem;
    height: 4rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.auth-logo:hover::before {
    transform: translateX(100%);
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Formulaire d'authentification */
.auth-form {
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-muted);
    transition: opacity 0.3s ease;
}

.form-group input:focus::placeholder {
    opacity: 0.5;
}

/* States des inputs */
.form-group input.valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2348bb78' d='m2.3 6.73.67-.67L4.07 7l2.6-2.6.67.67L4.07 8z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

.form-group input.invalid {
    border-color: var(--error-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23f56565'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.5 5.5 1 1 1-1'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

/* Password input group */
.password-input-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--text-primary);
    background: var(--button-bg-secondary);
}

/* Form hints */
.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-hint.error {
    color: var(--error-color);
}

.form-hint.success {
    color: var(--success-color);
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 1.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--primary-color);
    transform: scale(1.2);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.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;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--button-bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--button-bg-secondary-hover);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 1.125rem 2rem;
    font-size: 1.1rem;
}

/* Loading state */
.btn.loading {
    pointer-events: none;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert i {
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.alert-error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(245, 101, 101, 0.2);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(66, 153, 225, 0.2);
}

/* Footer d'authentification */
.auth-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

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

.auth-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.auth-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.auth-links a:hover {
    color: var(--primary-color);
}

/* Security notice */
.security-info {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 400px;
    width: calc(100% - 2rem);
}

.security-notice {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
}

.security-notice i {
    color: var(--success-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.security-notice small {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.security-notice a {
    color: var(--primary-color);
    text-decoration: none;
}

.security-notice a:hover {
    text-decoration: underline;
}

/* Progress indicators pour inscription */
.signup-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.progress-step {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
}

.progress-step.active {
    background: var(--primary-color);
    color: white;
}

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

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 2rem;
    height: 2px;
    background: var(--border-color);
    transform: translateY(-50%);
}

.progress-step.completed:not(:last-child)::after {
    background: var(--success-color);
}

/* Social auth buttons */
.social-auth {
    margin: 1.5rem 0;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.divider span {
    padding: 0 1rem;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-body {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .security-info {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: none;
        width: auto;
    }
}

/* Animations d'entrée */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-card {
    animation: slideInUp 0.6s ease forwards;
}

.security-info {
    animation: fadeIn 0.8s ease 0.3s both;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .auth-body::before {
        animation: none;
    }
}