/* --- Couleurs de l'ANVD (inspirées du logo) --- */
:root {
    --anvd-orange: #FF7800; /* Orange */
    --anvd-vert: #00AD68;   /* Vert */
    --anvd-blanc: #FFFFFF;
    --anvd-noir: #330000;   /* Noir/Marron */
    --anvd-gris-clair: #f4f7f9;
    --anvd-gris-moyen: #666666;
    --anvd-bordure: #e0e0e0;
    --anvd-ombre: rgba(0, 0, 0, 0.08);
}

/* --- Global & Body --- */
* { 
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--anvd-gris-clair);
    color: var(--anvd-noir);
    margin: 0;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Layout Principal d'Auth --- */
.page-wrapper {
    padding: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 10px 30px var(--anvd-ombre);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--anvd-blanc);
}

/* --- Section Promo --- */
.promo {
    background-color: var(--anvd-vert);
    color: var(--anvd-blanc);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 550px;
}

.brand {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: 50%;
    background-color: var(--anvd-blanc); /* Pour contraster avec le vert */
    padding: 5px;
}

.brand-text h1 {
    font-size: 1.8rem;
    margin: 0;
}

.brand-text p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.promo-content h2 {
    font-size: 2rem;
    margin-top: 50px;
    margin-bottom: 15px;
    font-weight: 700;
}

.promo-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* --- Section Formulaire --- */
.auth-form {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--anvd-noir);
    text-align: center;
}

/* --- Formulaires & Inputs --- */
.form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="tel"] {
    padding: 12px 15px;
    border: 1px solid var(--anvd-bordure);
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--anvd-orange);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 120, 0, 0.2);
}

/* --- Boutons --- */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background-color: var(--anvd-orange);
    color: var(--anvd-blanc);
    min-height: 44px; /* Fixe la hauteur pour le spinner */
}

.btn-primary:hover:not(:disabled) {
    background-color: #e05206;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--anvd-blanc);
    border: 2px solid var(--anvd-blanc);
    margin-top: 20px;
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
}

.forgot-link {
    text-align: right;
    font-size: 0.9rem;
    color: var(--anvd-gris-moyen);
    margin-top: 10px;
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--anvd-orange);
}

.separator {
    text-align: center;
    margin: 25px 0;
    color: var(--anvd-gris-moyen);
    position: relative;
    font-size: 0.9rem;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--anvd-bordure);
}

.separator::before {
    left: 0;
}

.separator::after {
    right: 0;
}

/* --- Modales --- */
.modal {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--anvd-blanc);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease-in-out;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.large-modal {
    max-width: 600px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--anvd-gris-moyen);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--anvd-noir);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    color: var(--anvd-noir);
}

.modal-body {
    padding-top: 10px;
}

/* --- Onglets d'Inscription --- */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--anvd-bordure);
}

.tab-link {
    flex-grow: 1;
    padding: 12px 15px;
    border: none;
    background-color: transparent;
    color: var(--anvd-gris-moyen);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-bottom-color 0.2s;
}

.tab-link.active {
    color: var(--anvd-orange);
    border-bottom-color: var(--anvd-orange);
}

.tab-fields {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.tab-fields.active {
    display: flex;
}

.email-info {
    font-size: 0.9rem;
    color: var(--anvd-gris-moyen);
    text-align: center;
    margin-top: 20px;
}

/* --- Réactivité --- */
@media (max-width: 1100px) {
    .auth-layout {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .promo {
        order: 2;
        min-height: 200px;
        justify-content: center;
        text-align: center;
        padding: 30px;
    }

    .promo .brand {
        justify-content: center;
    }

    .promo-content h2, .promo-content p {
        margin-top: 0;
        margin-bottom: 10px;
    }

    .btn-secondary {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        padding: 0;
    }

    .auth-layout {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .promo, .auth-form {
        padding: 25px 20px;
    }

    .auth-form h2 {
        font-size: 1.5rem;
    }
}

/* ================================================= */
/* --- NOUVEAU: Styles pour l'Animation de Chargement --- */
/* ================================================= */

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    position: relative; /* Nécessaire pour positionner le spinner */
}

/* Cache le texte du bouton quand le spinner est affiché */
.btn-primary:disabled span {
    display: none;
}

/* Le spinner lui-même */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3); /* Blanc transparent */
    border-top-color: var(--anvd-blanc);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

/* Positionnement pour le centrer dans le bouton (si le texte est caché) */
.btn-primary:disabled .loading-spinner {
    position: static; 
    margin-left: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}