/* --- STYLE PAR DEFAUT (Avant chargement config) --- */
:root {
    --brand-primary: #343a40; /* Gris neutre pro par défaut */
    --brand-text: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #212529; /* Fond sombre par défaut */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Transition douce pour quand l'image de fond arrive */
    transition: background 0.5s ease;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Overlay pour lisibilité */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 0;
    opacity: 0;
    transition: opacity 1s; /* Apparait doucement */
}

.login-card {
    position: relative;
    z-index: 10;
    background: #fff;
    width: 100%;
    max-width: 950px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    min-height: 600px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
}

/* --- COLONNE GAUCHE --- */
.card-brand-side {
    background-color: var(--brand-primary);
    color: var(--brand-text);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background-color 0.5s ease; /* Transition couleur douce */
}

/* --- COLONNE DROITE --- */
.card-form-side {
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.btn-login {
    background-color: var(--brand-primary);
    color: var(--brand-text);
    border: none;
    padding: 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.5s ease, filter 0.2s;
}

    .btn-login:hover {
        filter: brightness(90%);
    }

/* --- SKELETON LOADER (Effet de chargement gris pulsant) --- */
.skeleton {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-logo {
    width: 150px;
    height: 80px;
    margin-bottom: 2rem;
    border-radius: 8px;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 0.3;
    }
}

/* Mobile */
@media (max-width: 992px) {
    .login-card {
        flex-direction: column;
        max-width: 500px;
        min-height: auto;
    }

    .card-brand-side {
        padding: 2rem;
        align-items: center;
        text-align: center;
    }

    .card-form-side {
        padding: 2rem;
    }
}
/* ... dans <style> ... */

/* CONTENEUR DU LOGO : On définit une "boite" rigide */
.brand-logo-wrapper {
    width: 100%;
    height: 120px; /* Hauteur fixe réservée pour le logo */
    margin-bottom: 2rem;
    display: flex; /* Pour centrer l'image dedans */
    align-items: center; /* Centrage vertical */
    justify-content: flex-start; /* Aligné à gauche (ou center si vous préférez) */
    overflow: hidden; /* Coupe tout ce qui dépasse au cas où */
}

/* L'IMAGE : Elle doit obéir au conteneur */
.company-logo {
    max-width: 100%; /* Ne dépasse jamais la largeur du conteneur */
    max-height: 100%; /* Ne dépasse jamais la hauteur du conteneur */
    width: auto; /* Garde les proportions */
    height: auto; /* Garde les proportions */
    object-fit: contain; /* MAGIQUE : L'image se redimensionne pour tenir dedans */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
/* --- SELECTEUR DE LANGUE --- */
.lang-switcher {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
}

    .lang-switcher a {
        text-decoration: none;
        font-size: 0.75rem;
        font-weight: 700;
        color: #adb5bd; /* Gris discret par défaut */
        padding: 4px 8px;
        border-radius: 6px;
        background: #f8f9fa;
        transition: all 0.2s ease;
        border: 1px solid transparent;
    }

        .lang-switcher a:hover {
            background: #e9ecef;
            color: var(--brand-primary); /* Prend la couleur du client au survol */
        }

        .lang-switcher a.active {
            background: var(--brand-primary); /* Fond coloré pour la langue active */
            color: var(--brand-text); /* Texte contrasté */
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

/* Ajustement mobile pour les drapeaux */
@media (max-width: 992px) {
    .lang-switcher {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 2rem;
        width: 100%;
    }
}
/* Animation d'erreur (Secousse) */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.shake-anim {
    animation: shake 0.4s ease-in-out;
}