/* css_connexion.css */

/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
    --color-primary: #3498db;
    --color-primary-hover: #2980b9; 
    --color-secondary: #2c3e50;
    --color-success: #27ae60;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-light: #f8f9fa;         
    --color-text-muted: #95a5a6;
    --radius-card: 12px;
    --shadow-card: 0 15px 35px rgba(0,0,0,0.1);
}

/* ============================================================
   2. LAYOUT SPLIT (INDEX)
   ============================================================ */

/* Initialisation stricte pour éviter le scroll global */
html {
    height: 100%;
}

body.auth-split-layout {
    margin: 0;
    padding: 0;
    height: 100vh; /* Hauteur écran */
    width: 100vw;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #ffffff;
    overflow: hidden; /* SÉCURITÉ : Empêche le scroll de la page entière */
}

.split-container {
    display: flex;
    width: 100%;
    height: 100%; /* Prend toute la hauteur du body */
}

/* --- ZONE IMAGE (GAUCHE) --- */
.split-visual {
    display: none; /* Mobile : Caché */
    flex: 1.2;     /* Desktop : 60% largeur */
    position: relative;
    background-color: var(--color-secondary);
    
    /* Chemin relatif depuis /css_connexion/ vers /images/ */
    background-image: url('../../images/fond-connexion.jpg'); 
    
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.split-visual::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.85) 0%, rgba(52, 152, 219, 0.4) 100%);
    z-index: 1;
}

.visual-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    color: white;
}
.visual-content h2 { font-size: 2.8rem; margin: 0 0 10px 0; font-weight: 700; line-height: 1.1; }
.visual-content p { font-size: 1.5rem; opacity: 0.9; font-weight: 300; max-width: 500px; margin: 0; }

/* --- ZONE FORMULAIRE (DROITE) --- */
.split-form-wrapper {
    flex: 1;
    height: 100%; /* Important pour le scroll interne */
    display: flex;
    flex-direction: column; /* Permet le scroll vertical propre */
    background-color: #ffffff;
    overflow-y: auto; /* SCROLL INTERNE UNIQUEMENT ICI */
    padding: 20px;
}

/* La carte est centrée via margin: auto (Astuce Flexbox pour scroll safe) */
.split-form-wrapper .auth-card {
    width: 100%;
    max-width: 420px;
    margin: auto; /* Centre verticalement et horizontalement */
    padding: 40px;
    background: transparent;
    box-shadow: none;
    animation: slideUp 0.5s ease-out;
}

/* ============================================================
   3. LAYOUT STANDARD (AUTRES PAGES)
   ============================================================ */
body.auth-page {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Segoe UI', system-ui, sans-serif;
    /* Ici on laisse le scroll naturel si besoin car c'est une page centrée */
}
body.auth-page .auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

/* ============================================================
   4. COMPOSANTS COMMUNS
   ============================================================ */
.auth-logo { height: 60px; width: auto; margin: 0 auto 15px auto; display: block; opacity: 1; }
.auth-header { text-align: center; margin-bottom: 35px; }
.auth-header h1 { font-size: 1.8rem; color: var(--color-secondary); margin: 0 0 5px 0; font-weight: 700; }
.auth-header p { color: var(--color-text-muted); margin: 0; font-size: 0.95rem; }

.auth-links { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; margin-top: 10px; margin-bottom: 25px; }
.auth-links a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
.auth-links a:hover { text-decoration: underline; color: var(--color-primary-hover); }

.auth-back-link { display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 500; text-decoration: none; color: var(--color-primary); margin-top: 25px; }
.auth-back-link:hover { text-decoration: underline; }

.auth-footer { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #f1f1f1; font-size: 0.85rem; color: #bdc3c7; }
.auth-card .cmp-input-wrapper { margin-bottom: 20px; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   5. RESPONSIVE
   ============================================================ */
@media (min-width: 992px) {
    .split-visual { display: block; }
}
@media (max-width: 991px) {
    /* Mobile : Retour à une colonne */
    .split-container { flex-direction: column; }
    .split-visual { display: none; }
    
    .split-form-wrapper { 
        flex: 1; 
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        /* On conserve le overflow-y: auto pour le mobile */
    }
    .split-form-wrapper .auth-card { 
        background: #ffffff; 
        border-radius: var(--radius-card); 
        box-shadow: var(--shadow-card); 
        padding: 30px; 
        /* Sur mobile, on garde margin: auto pour centrer si possible, 
           mais on ajoute une marge verticale pour éviter que ça colle aux bords si clavier virtuel */
        margin: 20px auto; 
        max-width: calc(100% - 60px);
    }
}

/* ============================================================
   6. MODULES
   ============================================================ */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: white; padding: 12px 20px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); border-left: 5px solid #ccc; display: flex; align-items: center; gap: 12px; min-width: 280px; animation: slideIn 0.3s ease-out; font-size: 0.95rem; }
.toast.success { border-left-color: var(--color-success); }
.toast.error   { border-left-color: var(--color-danger); }
.toast i { font-size: 1.2em; }
.toast.success i { color: var(--color-success); }
.toast.error i   { color: var(--color-danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.debug-alert { margin-top: 20px; padding: 15px; background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; border-radius: 6px; font-size: 0.9em; word-break: break-all; line-height: 1.5; }
.password-criteria { margin-top: 10px; margin-bottom: 20px; background: #f8f9fa; padding: 15px; border-radius: 8px; font-size: 0.85rem; color: var(--color-text-muted); }
.password-criteria p { margin: 0 0 10px 0; font-weight: 600; color: var(--color-secondary); }
.criteria-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.criterion { display: flex; align-items: center; gap: 6px; transition: all 0.3s ease; }
.criterion i { font-size: 14px; color: #bdc3c7; }
.criterion.valid { color: var(--color-success); font-weight: 500; }
.criterion.valid i { color: var(--color-success); }

/* ============================================================
   7. LANGUAGE SWITCHER (SÉLECTEUR DE LANGUE)
   ============================================================ */
.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 15px; /* Espacement entre les drapeaux */
    margin-top: 25px; /* Espace après le bouton submit/liens */
    padding-top: 20px;
    border-top: 1px solid #f1f1f1; /* Ligne de séparation subtile */
}

.lang-link {
    text-decoration: none;
    font-size: 1.6rem; /* Taille des drapeaux */
    opacity: 0.4;      /* Semi-transparent par défaut */
    filter: grayscale(100%); /* Noir et blanc par défaut */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: scale(1);
    cursor: pointer;
    line-height: 1;
}

/* État Actif (Langue courante) */
.lang-link.active {
    opacity: 1;
    filter: grayscale(0%); /* Couleur normale */
    transform: scale(1.1); /* Légèrement plus grand */
    color: var(--color-primary);
}

/* État Survol */
.lang-link:hover {
    opacity: 0.8;
    filter: grayscale(0%);
    transform: scale(1.2); /* Zoom au survol */
    color: var(--color-primary-hover);
}