/* ==========================================================================
    1. STYLES GLOBAUX & RESET (Spécifique Auth)
    ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Synchronisé sur global.css */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg), var(--bg-darker));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

/* ==========================================================================
    2. CONTENEURS & LAYOUT
    ========================================================================== */
.container, 
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: var(--card); 
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

/* ==========================================================================
   SECTION AUTH-FOOTER (Positionnement & Structure)
   ========================================================================== */

/* ==========================================================================
   SECTION AUTH-FOOTER (Protection contre les styles globaux)
   ========================================================================== */

.auth-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

/* On "nettoie" les propriétés héritées du Home/Global qui cassent le design */
.auth-footer p {
    margin: 0 !important;
    font-size: 0.9rem;
    line-height: 1.4;
    /* --- Neutralisation du Global --- */
    white-space: normal !important;   /* Annule le pre-wrap pour éviter les sauts de ligne fantômes */
    word-break: normal !important;    /* Empêche de couper les mots au milieu (ex: "con-nexion") */
    word-wrap: normal !important;
    overflow-wrap: normal !important;
}

.login-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Liens d'accentuation */
.link-accent {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block; /* Permet un meilleur contrôle du clic */
}

.link-accent:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Utilitaires spécifiques */
.small { 
    font-size: 0.8rem !important; 
    opacity: 0.8;
}

.bold { 
    font-weight: 700 !important; 
}

/* ==========================================================================
    3. TYPOGRAPHIE
    ========================================================================== */
h1 {
    color: var(--accent);
    text-align: center;
    font-weight: 700;
    margin-bottom: 30px;
    font-size: 2rem;
}

p {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
    4. FORMULAIRES & INPUTS
    ========================================================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input[type="text"], 
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus, 
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.5);
    outline: none;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* --- Gestion Spécifique Password --- */
.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon input {
    padding-right: 45px !important; 
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    user-select: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    opacity: 0.6;
    z-index: 10;
}

.toggle-password:hover {
    opacity: 1;
    color: var(--accent);
}

/* --- Jauge de force --- */
.strength-meter {
    height: 4px;
    background-color: var(--border);
    margin-top: -10px;
    margin-bottom: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.strength-bar.weak { background-color: var(--danger); width: 33%; }
.strength-bar.medium { background-color: #ffd700; width: 66%; }
.strength-bar.strong { background-color: #28a745; width: 100%; }

/* ==========================================================================
    5. BOUTONS D'ACTION
    ========================================================================== */
button, 
button[name="login"], 
button[type="submit"] {
    width: 100%;
    background-color: var(--accent);
    color: var(--bg-darker);
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-family: 'Poppins', sans-serif;
}

button:hover, 
button[name="login"]:hover, 
button[type="submit"]:hover {
    background-color: var(--accent-hover);
    color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

/* ==========================================================================
    6. MESSAGES D'ÉTAT
    ========================================================================== */
.error {
    background-color: rgba(255, 95, 95, 0.1);
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--danger);
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.message-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #28a745;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}


/* --- Classes spécifiques pour remplacer les styles inline --- */

/* Conteneurs d'input relatifs pour l'icône oeil */
.input-group, .input-with-icon {
    position: relative;
    width: 100%;
}

.input-group input, .input-with-icon input {
    padding-right: 45px !important;
}

/* Positionnement de l'icône de visibilité */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.3s;
    user-select: none;
}

.toggle-password:hover {
    opacity: 1;
}

/* Checkbox "Se souvenir de moi" */
.remember-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Jauge de force du mot de passe */
.strength-meter {
    height: 4px;
    background: var(--bg-darker);
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
}

.strength-text {
    font-size: 0.75rem;
    margin-top: 5px;
    min-height: 1em;
}

/* Alertes et messages personnalisés */
.alert-custom {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.alert-custom.error {
    background: rgba(255, 95, 95, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

.alert-custom.success {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* Bloc d'info (quand le formulaire est caché) */
.info-box {
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    padding: 20px;
    border-radius: 8px;
}

.info-box p {
    font-size: 0.9rem;
    margin: 0 !important;
    white-space: normal !important;
}



/* Container des 6 cases */
.code-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
}

/* Style individuel des cases */
.code-input {
    width: 45px;
    height: 60px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #00d4ff; /* Ton bleu accent */
    color: #fff;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.code-input:focus {
    border-color: #00d4ff;
    outline: none;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Style du message de succès */
.alert-custom.success {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

/* Bouton de renvoi (lien discret) */
.resend-link {
    background: none;
    border: none;
    color: #00d4ff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    font-family: inherit;
    transition: opacity 0.2s;
}

.resend-link:hover {
    opacity: 0.8;
}

.resend-link:disabled {
    color: #777;
    text-decoration: none;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 400px) {
    .code-container { gap: 8px; }
    .code-input { width: 38px; height: 50px; font-size: 1.4rem; }
}
/* ==========================================================================
    7. RESPONSIVE
    ========================================================================== */
@media (max-width: 480px) {
    .container, 
    .login-container {
        padding: 25px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
}


/* ==========================================================================
   7. ÉCRAN DE SUCCÈS (SPÉCIFIQUE)
   ========================================================================== */

.success-screen {
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

/* L'icône Check animée */
.success-icon {
    font-size: 4rem;
    color: #00ff88; /* Vert fluo pour le succès */
    background: rgba(0, 255, 136, 0.1);
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    margin: 0 auto 25px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

/* La boîte d'information "Fermer l'onglet" */
.success-box {
    background: rgba(0, 212, 255, 0.05) !important;
    border: 1px dashed var(--accent) !important;
    color: var(--text-main) !important;
    margin: 30px 0;
    padding: 20px !important;
}


.success-box p {
    word-break: normal !important; 
    word-wrap: normal !important;   
    overflow-wrap: normal !important; 
    white-space: normal !important;   
    
    margin: 0 !important;
    color: var(--accent) !important;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

/* Transformation du lien en bouton (puisque ce n'est plus un <button> de formulaire) */
.btn-primary-link {
    display: block;
    width: 100%;
    background-color: var(--accent);
    color: var(--bg-darker) !important;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary-link:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.4);
}

/* Petite animation d'entrée */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}