/* ============================================
   CONNEXION — Styles
   ============================================ */

/* ---- LAYOUT Écran split ---- */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Côté gauche : visuel ---- */
.login-visual {
    flex: 1;
    background: linear-gradient(90deg, var(--blue-900) 0%, var(--blue-800) 55%, var(--blue-700) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 60px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.login-visual::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.login-visual::after {
    content: '';
    position: absolute;
    bottom: -15%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
}

.login-visual .decor-line {
    position: absolute;
    width: 1px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
}

.login-visual .decor-line:nth-child(1) { top: 10%; left: 15%; }
.login-visual .decor-line:nth-child(2) { top: 30%; right: 20%; height: 80px; }
.login-visual .decor-line:nth-child(3) { bottom: 20%; left: 25%; height: 100px; }

.visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    max-width: 480px;
}

.visual-logo {
    width: 72px;
    height: 72px;
    background: var(--white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.visual-logo i {
    font-size: 32px;
    color: var(--blue-700);
}

.visual-content h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.visual-content .visual-sub {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 32px;
}

.visual-content .visual-desc {
    font-size: 15px;
    opacity: 0.8;
    line-height: 1.7;
    margin-bottom: 40px;
}

.visual-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.visual-stat {
    text-align: center;
}

.visual-stat .vs-num {
    font-size: 26px;
    font-weight: 800;
    display: block;
}

.visual-stat .vs-label {
    font-size: 11px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.visual-institution {
    position: absolute;
    bottom: 32px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

.visual-institution p {
    font-size: 11px;
    opacity: 0.45;
    line-height: 1.6;
}

/* ---- Côté droit : formulaire ---- */
.login-form-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    background: var(--white);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-form-logo {
    display: none;
    justify-content: center;
    margin-bottom: 28px;
}

.login-form-logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.form-welcome {
    margin-bottom: 36px;
}

.form-welcome h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.form-welcome p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ---- Formulaire ---- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i.input-icon {
    position: absolute;
    left: 14px;
    font-size: 15px;
    color: var(--gray-400);
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    outline: none;
    transition: var(--transition);
}

.input-wrapper input::placeholder {
    color: var(--gray-400);
}

.input-wrapper input:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-wrapper input:focus + i.input-icon,
.input-wrapper input:focus ~ i.input-icon {
    color: var(--blue-500);
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    color: var(--gray-400);
    font-size: 15px;
    padding: 4px;
    transition: var(--transition);
}

.input-wrapper .toggle-password:hover {
    color: var(--gray-600);
}

/* ---- Remember / Forgot ---- */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.form-options label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-500);
    cursor: pointer;
}

.form-options a {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-500);
    transition: var(--transition);
}

.form-options a:hover {
    color: var(--blue-700);
}

/* ---- Bouton connexion ---- */
.btn-login {
    width: 100%;
    height: 50px;
    background: var(--blue-500);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background: var(--blue-600);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-login.loading .spinner {
    display: block;
}

.btn-login.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Message d'erreur ---- */
.form-error {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--red-100);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #b91c1c;
    font-weight: 500;
}

.form-error.visible {
    display: flex;
}

.form-error i {
    font-size: 16px;
    flex-shrink: 0;
}

/* ---- Message de succès ---- */
.form-success {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--green-100);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #15803d;
    font-weight: 500;
}

.form-success.visible {
    display: flex;
}

.form-success i {
    font-size: 16px;
    flex-shrink: 0;
}

/* ---- Séparateur ---- */
.form-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 4px 0;
}

.form-separator span {
    font-size: 12px;
    color: var(--gray-400);
    white-space: nowrap;
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ---- Indices de connexion ---- */
/* ============================================
   CONNEXION — Nouveau Design (Centré / Modal)
   ============================================ */

.login-layout-body {
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

/* Barre supérieure (Logo + Titre) alignée à gauche */
.login-top-bar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 32px; /* Aligné avec les marges standard de l'application */
    display: flex;
    justify-content: flex-start; /* Aligne tout à gauche */
    align-items: center;
}

.top-bar-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.top-logo-wrap {
    width: 100px;
    height: 50px;
}

.top-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.top-bar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.5px;
}

/* Sous-bannière bleue */
.login-sub-bar {
    background: #3777B0;
    color: #ffffff;
    text-align: center;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1);
}

/* Section principale centrée */
.login-main-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Carte / Modale de connexion */
.login-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* En-tête de la carte (Fond bleu foncé + Icône bouclier) */
.login-modal-header {
    background: linear-gradient(135deg, #3777B0, #3777B0);
    color: #ffffff;
    text-align: center;
    padding: 32px 20px;
}

.modal-shield {
    font-size: 32px;
    margin-bottom: 10px;
    color: #93c5fd;
}

.login-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-modal-header p {
    font-size: 13px;
    opacity: 0.85;
}

/* Corps du formulaire */
.login-modal-body {
    padding: 32px;
}

/* Boîte d'information info style capture */
.login-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #3777B0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-info-box i {
    font-size: 16px;
    color: #3777B0;
}

/* Champs de formulaire */
.login-form .form-group {
    margin-bottom: 18px;
}

.login-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .input-wrapper input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
}

.login-form .input-wrapper input:focus {
    border-color: #3777B0;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-form .input-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    font-size: 15px;
}

.login-form .toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    font-size: 15px;
}

/* Bouton de soumission */
.btn-login-action {
    width: 100%;
    background: #3777B0;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-login-action:hover {
    background: #3777B0;
    transform: translateY(-1px);
}

.login-demo-reminder {
    text-align: center;
    margin-top: 16px;
    font-size: 11.5px;
    color: #64748b;
}

/* Pied de page */
.login-page-footer {
    background: #367ccc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: #dcdee0;
}

/* ---- Footer formulaire ---- */
/*.form-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
}

.form-footer a {
    color: var(--blue-500);
    font-weight: 600;
    transition: var(--transition);
}

.form-footer a:hover {
    color: var(--blue-700);
}

/* ---- Input erreur ---- */
.input-wrapper.error input {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-wrapper.error i.input-icon {
    color: var(--red-500);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1024px) {
    .login-visual {
        display: none;
    }

    .login-form-side {
        flex: 1;
    }

    .login-form-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .login-form-side {
        padding: 32px 24px;
    }

    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .visual-stats {
        gap: 24px;
    }
}