/* public/login.css */

:root {
    --login-primary: #18a0fb; /* tick-blue */
    --login-secondary: #00d2b4; /* it-teal */
    --login-dark: #152c4a; /* crm-navy */
    --login-bg: #f4f7f6; /* fond clair pour la partie droite */
}

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--login-bg);
    overflow: hidden; /* Empêche le scroll disgracieux */
}

.login-container {
    display: flex;
    min-height: 100vh;
}

/* =========================================
   PANNEAU GAUCHE : BRANDING & DÉCORATION
   ========================================= */
.login-brand-panel {
    display: none; /* Masqué sur mobile */
    background: linear-gradient(145deg, var(--login-dark) 0%, #0a1526 100%);
    color: white;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    justify-content: center; /* Centre le texte verticalement */
    padding: 4rem;
}

@media (min-width: 992px) {
    .login-brand-panel {
        display: flex;
        width: 45%;
        max-width: 650px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        z-index: 10;
    }
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -64px; left: -64px; right: -64px; bottom: -64px;
    /* On passe le point à 1.5px pour éviter le pixel snapping */
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1.5px, transparent 1.5px);
    background-size: 32px 32px;
    z-index: 0;
    animation: driftGrid 12s linear infinite;
    will-change: transform;
    
    /* Hacks anti-scintillement pour le moteur de rendu */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

@keyframes driftGrid {
    0% { 
        /* On utilise translate3d pour forcer l'accélération matérielle stricte */
        transform: translate3d(0, 0, 0); 
    }
    100% { 
        transform: translate3d(32px, 32px, 0); 
    }
}

/* Halos colorés animés */
.brand-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    z-index: 1;
    animation: pulse 15s infinite alternate ease-in-out;
}
.shape-a {
    width: 450px; height: 450px;
    background: var(--login-primary);
    top: -150px; left: -150px;
}
.shape-b {
    width: 350px; height: 350px;
    background: var(--login-secondary);
    bottom: -100px; right: -100px;
    animation-delay: -5s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(40px, 30px); }
}

/* Contenu du panneau gauche */
.brand-content {
    position: relative;
    z-index: 2;
}

.brand-logo {
    position: absolute;
    top: 3.5rem;
    left: 4rem;
    max-height: 40px;
    filter: brightness(0) invert(1); /* Opticontact en blanc pur */
    z-index: 3;
}

.brand-quote {
    font-size: 2.6rem;
    font-weight: 300;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    color: #ffffff !important;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* =========================================
   PANNEAU DROIT : FORMULAIRE
   ========================================= */
.login-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

/* La Card qui encadre le formulaire */
.form-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    padding: 3.5rem 3rem;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(21, 44, 74, 0.04), 0 5px 15px rgba(0,0,0,0.02);
    border: 1px solid rgba(21, 44, 74, 0.04);
}

.client-logo-wrapper {
    text-align: center;
    margin-bottom: 2.5rem;
}

.client-logo-wrapper img {
    max-height: 85px;
    object-fit: contain;
}

/* Champs de saisie flottants */
.custom-form-floating {
    margin-bottom: 1.25rem;
}

.custom-form-floating > .form-control {
    border-radius: 12px;
    border: 2px solid #edf2f7;
    background-color: #f8fafc;
    padding: 1rem 1.2rem;
    height: auto;
    font-weight: 500;
    color: var(--login-dark);
    transition: all 0.3s ease;
}

.custom-form-floating > .form-control:focus {
    border-color: var(--login-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(24, 160, 251, 0.1);
}

.custom-form-floating > label {
    padding: 1rem 1.2rem;
    color: #94a3b8;
    font-weight: 500;
}

.custom-form-floating > .form-control:focus ~ label,
.custom-form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-1.3rem) translateX(-0.15rem);
    color: var(--login-primary);
    background-color: transparent;
}

/* Bouton de soumission */
.btn-login {
    background: linear-gradient(135deg, var(--login-primary) 0%, var(--login-secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 210, 180, 0.2);
    margin-top: 1.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 210, 180, 0.35);
    color: white;
}

.btn-login:disabled {
    background: #cbd5e1;
    transform: none;
    box-shadow: none;
}

/* Feedback d'erreur animé */
.login-error {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 0.8rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-6px); }
}

/* Badge de version */
.version-badge {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background-color: #ffffff;
    border: 1px solid rgba(21,44,74,0.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Ajustement Mobile */
.mobile-brand-logo {
    display: block;
    margin-bottom: 2rem;
    text-align: center;
}
.mobile-brand-logo img {
    height: 35px;
}
@media (min-width: 992px) {
    .mobile-brand-logo { display: none; }
}