:root {
    --bws-pink: #f90e94;
    --bws-orange: #fc9b0d;
    --bws-blue: #2e51d5;
    --bws-gray: #f4f6f8;
}

#bws-brief-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    max-width: 900px;
    margin: 20px 0;
    font-family: 'Arial', sans-serif;
    position: relative;
}

/* --- HEADER & PROGRESS BAR (Desktop) --- */
.bws-progress-header {
    background: #fdfdfd;
    padding: 25px 40px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.progress-steps li {
    position: relative;
    color: #ccc;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}
.progress-steps li span.step-num {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid #eee; background: #fff;
    font-weight: bold; font-size: 0.85rem;
}
.progress-steps li.active { color: var(--bws-blue); }
.progress-steps li.active span.step-num { border-color: var(--bws-blue); color: var(--bws-blue); }
.progress-steps li.completed { color: var(--bws-pink); }
.progress-steps li.completed span.step-num { background: var(--bws-pink); border-color: var(--bws-pink); color: #fff; }

/* --- MOBILE PROGRESS BAR (Jauge colorée) --- */
.mobile-progress-bar {
    display: none; /* Caché sur desktop */
    height: 6px;
    width: 0%;
    background: linear-gradient(90deg, var(--bws-orange), var(--bws-pink));
    transition: width 0.4s ease;
    position: absolute;
    top: 0; left: 0; z-index: 10;
}

.steps-wrapper { 
    display: flex; 
    /* Animation fluide de la hauteur et du slide */
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), height 0.4s ease-in-out; 
    width: 100%; 
    /* Important : align-items flex-start empêche les slides de s'étirer inutilement */
    align-items: flex-start; 
}

/* On s'assure que le conteneur global n'a pas de hauteur fixe */
.bws-form-container {
    padding: 40px; 
    position: relative; 
    overflow: hidden; 
    /* Pas de height ou min-height fixe ici qui bloquerait le resize */
}
.form-step { 
    min-width: 100%; 
    width: 100%;        /* Force la largeur */
    flex-shrink: 0;     /* IMPORTANT : Empêche l'écrasement des étapes */
    box-sizing: border-box; 
    opacity: 0; 
    transition: opacity 0.3s, transform 0.3s; /* On anime aussi si besoin */
    padding: 5px; 
}
.form-step.active { opacity: 1; }

.step-title { margin-top: 0; margin-bottom: 30px; color: #333; font-size: 1.8rem; text-align: center; }

/* Champs */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #444; }
/* 1. On cible uniquement les champs TEXTES (et on exclut checkboxes/radios) */
.input-group input:not([type="checkbox"]):not([type="radio"]),
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #eef0f2;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.3s;
    background: var(--bws-gray);
    box-sizing: border-box;
    -webkit-appearance: none;
}

.input-group input:focus, 
.input-group select:focus, 
.input-group textarea:focus {
    border-color: var(--bws-blue);
    background: #fff;
    outline: none;
}

/* 2. Style spécifique pour la grille de Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(199px, 1fr)); /* Grille responsive */
    gap: 10px;
    margin-top: 10px;
}

/* Le conteneur (Label) de chaque case */
.checkbox-grid label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s ease;
}

/* Effet au survol */
.checkbox-grid label:hover {
    border-color: var(--bws-blue);
    background: #f0f7ff;
}

/* La Checkbox elle-même : On force le reset des styles */
.checkbox-grid input[type="checkbox"] {
    appearance: auto !important;       /* Restaure le style natif */
    -webkit-appearance: checkbox !important;
    width: 18px !important;           /* Taille fixe */
    height: 18px !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: inline-block !important;
    padding: 0 !important;
}

/* Conditionnel caché par défaut */
.conditional-field { display: none; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* Boutons */
.form-navigation { margin-top: 30px; display: flex; justify-content: space-between; align-items: center; }
.bws-btn {
    padding: 14px 35px; border-radius: 50px; border: none; font-size: 1rem;
    font-weight: bold; cursor: pointer; transition: 0.3s;
}
.bws-btn.primary {
    background: linear-gradient(45deg, var(--bws-blue), var(--bws-pink));
    color: #fff; box-shadow: 0 4px 15px rgba(46, 81, 213, 0.3);
}
.bws-btn.ghost { background: transparent; color: #aaa; padding: 10px 20px; }

.bws-radio-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px; /* Espace entre Oui et Non */
    padding: 10px 0;
}

.bws-radio-inline label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    margin: 0; /* Reset des marges par défaut */
}

.bws-radio-inline input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    /* On enlève le style "input texte" global s'il s'applique */
    border: 1px solid #ccc;
    background: #fff;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    #bws-brief-wrapper { margin: 0; border-radius: 0; box-shadow: none; }
    
    /* On cache les étapes textes, on montre la barre colorée */
    .bws-progress-header { display: none; }
    .mobile-progress-bar { display: block; }
    
    .bws-form-container { padding: 25px 20px; }
    .step-title { font-size: 1.5rem; text-align: left; }
    .form-grid { grid-template-columns: 1fr; gap: 10px; }
    
    .form-navigation { flex-direction: column-reverse; gap: 15px; }
    .bws-btn { width: 100%; text-align: center; }
}

.bws-input-compact {
    width: 100%;
    padding: 10px !important; /* Moins haut */
    border: 1px solid #ccc !important;
    border-radius: 4px;
    font-size: 0.9rem;
}

.bws-select-compact {
    width: 100%;
    padding: 10px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    height: 38px;
}

.module-row {
    animation: fadeInRow 0.3s ease;
}

@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .module-row {
        grid-template-columns: 1fr !important; /* Empilement sur mobile */
        gap: 5px !important;
        background: #fff;
        padding: 10px;
        border-radius: 6px;
        border: 1px solid #eee;
    }
}