/* ===== PAGE DE CONNEXION RESPONSIVE ===== */

/* Variables CSS */
:root {
    --primary: #FEA347;
    --secondary: #800080;
    --accent: #410056;
    --background: #FAF9F6;
    --surface: #F5F5DC;
    --text-primary: #2E2E2E;
    --text-secondary: #410056;
    --success: #10B981;
    --error: #EF4444;
    --border: #E5E7EB;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #f3f4f6 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Header minimal */
.login-header {
    background: white;
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.login-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    height: 50px;
    width: auto;
}

.back-home {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 8px;
}

.back-home:hover {
    background: rgba(254, 163, 71, 0.1);
    color: var(--primary);
}

/* Contenu principal */
.auth-main {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

/* Onglets de navigation */
.auth-tabs {
    display: flex;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 24px;
    padding: 6px;
    gap: 6px;
}

.tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab-button.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-medium);
}

.tab-button:not(.active):hover {
    background: rgba(254, 163, 71, 0.1);
    color: var(--primary);
}

/* Conteneur de formulaire */
.auth-form-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form-container.active {
    display: block;
}

/* Carte d'authentification */
.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

/* Header de la carte */
.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, #ffb366 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    opacity: 0.9;
    font-size: 14px;
}

/* Formulaire */
.auth-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
}

/* Groupes d'input avec icônes */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(254, 163, 71, 0.1);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--background);
    color: var(--text-secondary);
    border-right: 2px solid var(--border);
}

.form-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* Toggle du mot de passe */
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.password-toggle:hover {
    background: rgba(254, 163, 71, 0.1);
    color: var(--primary);
}

/* Options du formulaire */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 12px;
}

/* Checkbox personnalisée */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: var(--transition);
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Lien mot de passe oublié */
.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Boutons d'authentification */
.auth-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #ffb366 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin: 20px 0;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

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

.auth-button-secondary {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    flex: 1;
}

.auth-button-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(254, 163, 71, 0.05);
}

/* Diviseur */
.auth-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: var(--text-secondary);
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    background: white;
    padding: 0 16px;
    font-size: 14px;
}

/* Connexion sociale */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.social-button.google:hover {
    border-color: #DB4437;
    color: #DB4437;
    background: rgba(219, 68, 55, 0.05);
}

.social-button.facebook:hover {
    border-color: #4267B2;
    color: #4267B2;
    background: rgba(66, 103, 178, 0.05);
}

/* Inscription par étapes */
.signup-steps {
    margin-bottom: 24px;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    color: white;
    font-weight: bold;
    font-size: 14px;
    transition: var(--transition);
}

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

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: slideIn 0.3s ease;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Groupe de consentement */
.consent-group {
    margin: 16px 0;
}

.consent-group .checkbox-text {
    font-size: 13px;
    line-height: 1.4;
}

/* Messages d'erreur */
.error-message {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.input-group.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-group.error .input-icon {
    color: var(--error);
    border-right-color: var(--error);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Tablettes */
@media (max-width: 768px) {
    .auth-main {
        padding: 16px;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .tab-button span {
        display: none;
    }
    
    .tab-button {
        padding: 12px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .login-header .container {
        height: 60px;
        padding: 0 16px;
    }
    
    .logo {
        height: 40px;
    }
    
    .desktop-only {
        display: none;
    }
    
    .back-home {
        padding: 8px;
    }
    
    .auth-main {
        padding: 12px;
        min-height: calc(100vh - 60px);
    }
    
    .auth-header {
        padding: 20px 16px;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
    
    .auth-form {
        padding: 20px 16px;
    }
    
    .input-icon {
        width: 44px;
        height: 44px;
    }
    
    .form-input {
        font-size: 16px; /* Empêche le zoom sur iOS */
    }
    
    .step-indicator {
        margin-bottom: 20px;
    }
    
    .step {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .step-line {
        width: 30px;
        margin: 0 6px;
    }
    
    .social-login {
        gap: 8px;
    }
    
    .social-button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Mode sombre (si nécessaire) */
@media (prefers-color-scheme: dark) {
    body.dark-mode {
        --background: #111827;
        --surface: #1F2937;
        --text-primary: #F9FAFB;
        --text-secondary: #D1D5DB;
        --border: #374151;
    }
    
    body.dark-mode .auth-card {
        background: var(--surface);
    }
    
    body.dark-mode .input-icon {
        background: var(--background);
    }
    
    body.dark-mode .checkbox-custom {
        background: var(--background);
    }
    
    body.dark-mode .auth-divider span {
        background: var(--surface);
    }
    
    body.dark-mode .social-button {
        background: var(--background);
        color: var(--text-primary);
    }
}

/* Améliorations d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}