:root {
    --brand: #4F25A9;
    --brand-light: #AE97DB;
    --brand-dark: #3a1a80;
    --noir: #1F1F21;
    --gray1: #f7f6fb;
    --gray2: #ede9f7;
    --gray3: #c4b8e6;
    --gray4: #8a7ab5;
    --gray5: #4a4060;
    --radius: 14px;
    --radius-sm: 10px;
    --page-padding: 14px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f3f0fa;
    height: 100vh;
    margin: 0;
    padding: var(--page-padding);
    display: flex;
    align-items: stretch;
    transition: background-color 0.3s ease;
}

[data-bs-theme="dark"] body {
    background-color: #12101a;
}

[data-bs-theme="dark"] .right-panel {
    background: #1e1a2e;
}

[data-bs-theme="dark"] .field input,
[data-bs-theme="dark"] .select-field {
    background: #2a2440;
    border-color: #3d3360;
    color: #e8e2f5;
}

[data-bs-theme="dark"] .field input:focus {
    background: #2a2440;
    border-color: var(--brand-light);
}

[data-bs-theme="dark"] .form-title {
    color: #f0ecfa;
}

[data-bs-theme="dark"] .tabs {
    background: #2a2440;
}

[data-bs-theme="dark"] .tab.active {
    background: #3d3360;
    color: var(--brand-light);
}

[data-bs-theme="dark"] .tab {
    color: var(--gray3);
}

[data-bs-theme="dark"] .btn-outline {
    background: #2a2440;
    color: var(--brand-light);
    border-color: #3d3360;
}

[data-bs-theme="dark"] .btn-outline:hover {
    background: #3d3360;
}

[data-bs-theme="dark"] .info-box {
    background: #2a2440;
    border-color: #3d3360;
    color: #c4b8e6;
}

[data-bs-theme="dark"] .theme-btn {
    border-color: #3d3360;
    color: var(--gray3);
}

.main-container {
    width: 100%;
    display: flex;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 50px rgba(79, 37, 169, 0.15);
}

/* Panneau Gauche */
.left-panel {
    flex: 0 0 42%;
    background: var(--brand);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(174, 151, 219, 0.18);
    top: -100px;
    right: -120px;
}

.left-panel::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(174, 151, 219, 0.13);
    bottom: 60px;
    left: -70px;
}

.left-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
}

.left-logo svg {
    fill: white;
}

.left-logo span {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.left-bottom {
    z-index: 1;
}

.left-bottom .eyebrow {
    color: var(--brand-light);
    font-size: 12px;
    margin-bottom: 8px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 600;
}

.left-bottom h2 {
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.left-dots {
    display: flex;
    gap: 7px;
    margin-top: 28px;
}

.left-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.left-dots span:first-child {
    background: white;
    width: 26px;
    border-radius: 6px;
}

/* Panneau Droit */
.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    background: white;
}

.form-wrapper {
    width: 100%;
    max-width: 380px;
}

.brand-icon-mini {
    color: var(--brand-red);
    margin-bottom: 20px;
}

/* Style des inputs injectés */
.form-content input {
    width: 100%;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 15px;
}

.btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    background-color: var(--brand);
    color: white; /* Changé pour un meilleur contraste */
    border: none;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    cursor: pointer;

    /* Transition fluide */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Effet Hover */
.btn-main:hover:not(:disabled) {
    background-color: var(--brand-dark);
    box-shadow: 0 6px 20px rgba(79, 37, 169, 0.3);
    transform: translateY(-2px);
}

.btn-main:active:not(:disabled) {
    transform: translateY(0);
}

/* Animation icône */
.btn-main i {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-main:hover:not(:disabled) i.fa-paper-plane {
    transform: rotate(45deg) translateX(2px);
}

/* État Loading (UX crucial pour un SaaS) */
.btn-main:disabled {
    background-color: var(--gray4);
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-main.is-loading .btn-text { opacity: 0; }
.btn-main.is-loading .fa-paper-plane { display: none; }

/* État de base de l'icône */
.logo-top i.fa-carrot {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effet rebondi sympa */
}

/* Quand on survole le bouton principal, on cible la carotte */
/* Note : Cela nécessite que le bouton soit "avant" ou que l'on survole le parent */
.main-container:has(.btn-main:hover) .logo-top i.fa-carrot {
    transform: scale(1.5) rotate(10deg);
    /*color: #ff6b6b; !* Optionnel : change la couleur pour attirer l'oeil *!*/
    color: var(--brand);
}

.forgot-pass {
    display: block;
    text-align: center;
    margin-top: 25px;
    color: var(--bs-secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

@media (max-width: 991px) {
    body { padding: 0; }
    .left-panel { display: none; }
}


/*===================
  CHEVRON SELECT
====================*/

/* 1. Retirer la flèche par défaut de Bootstrap */
.form-floating select.form-select,
.form-floating select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important; /* Enlève le SVG de Bootstrap */
    padding-right: 2.5rem !important; /* Laisse de la place pour l'icône */
}

/* 2. Positionner votre chevron Font Awesome */
.select-chevron {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%); /* Centre verticalement */
    pointer-events: none; /* L'icône ne doit pas bloquer le clic sur le select */
    color: #6c757d; /* Couleur grise type Bootstrap */
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

/* Optionnel : faire tourner le chevron quand on clique (si le select est focus) */
.form-floating select:focus ~ .select-chevron {
    transform: translateY(-50%) rotate(180deg);
}


/*=========================
    ANIMATION ICON ACTIVE LOAD
==========================*/

#transition-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Au-dessus de tout */
    opacity: 0;
    pointer-events: none;
    overflow: hidden; /* Empêche les barres de défilement */
    transition: opacity 0.1s ease;
}

#transition-overlay.active {
    opacity: 1;
    pointer-events: auto; /* Bloque l'écran */
}

/* 1. L'icône Carotte qui fait le FOND (unifié et coloré) */
#transition-overlay i.carrot-background {
    color: var(--brand);
    font-size: 5rem;
    position: absolute;
    transform: scale(0) rotate(0deg);
    opacity: 0;
}

#transition-overlay.active i.carrot-background {
    /* Animation totale ~1.5s, zoom massif cubic-bezier pour l'effet flash */
    animation: carrotFillAndTurn 1.2s cubic-bezier(0.85, 0, 0.15, 1) forwards;
}

/* 2. Le Conteneur du Logo SVG FINAL */
#transition-overlay .final-logo-container {
    position: relative;
    z-index: 2; /* Au-dessus de la carotte qui zoom */
    opacity: 0; /* Caché initialement */
    transform: scale(0.8); /* Légèrement plus petit pour l'effet d'apparition */
    max-width: 80%; /* Pour mobile */
}

#transition-overlay.active .final-logo-container {
    /* Apparaît après 1s, quand l'écran est déjà rempli par la couleur unifiée */
    animation: fadeInFinalLogo 0.5s ease-out 0.7s forwards;
}

/* Le SVG lui-même */
#transition-overlay .final-logo-img {
    width: auto;
    height: auto;
    max-height: 200px; /* Taille maximale au centre */
}

/* --- Keyframes des Animations --- */

/* Animation de la Carotte-Fond (Zoom + Rotation + Remplissage) */
@keyframes carrotFillAndTurn {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    30% {
        transform: scale(1.5) rotate(720deg); /* Tourne vite sur place */
        opacity: 1;
    }
    /* Zoom massif exponentiel : le centre couvre un écran 4K de couleur unie */
    100% {
        transform: scale(400) rotate(1080deg);
        opacity: 1;
    }
}

/* Animation du Logo Final SVG (Fondu + Léger Zoom) */
@keyframes fadeInFinalLogo {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1); /* Taille normale */
    }
}

/* Toggle thème */
.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: 1.5px solid var(--gray2);
    border-radius: 8px;
    padding: 7px 9px;
    cursor: pointer;
    color: var(--gray4);
    font-size: 18px;
    transition: .2s;
    line-height: 1;
}

.theme-btn:hover {
    border-color: var(--brand-light);
    color: var(--brand);
}

@media (max-width: 991px) {
    body {
        padding: 0;
        border-radius: 0;
    }

    .left-panel {
        display: none;
    }

    .main-container {
        border-radius: 0;
    }
}