/*
 * public/assets/css/recherche.css — page « Recherche personnalisée ».
 *
 * Chargée uniquement sur cette page (voir app/views/layout.php) : un visiteur
 * de la page d'accueil n'a aucune raison de télécharger ces styles.
 *
 * Aucun style="" en ligne dans la vue : la CSP du site porte un nonce, donc
 * 'unsafe-inline' est ignoré et un style en attribut serait purement et
 * simplement supprimé. C'est pour la même raison que la barre d'avancement
 * utilise des classes de largeur (--50, --100) au lieu de style="width:50%".
 */

.recherche__intro {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
    background: var(--fond-2, #F5F8FC);
    border-bottom: 1px solid var(--bord, #DFE5EC);
}

.recherche__intro h1 {
    margin: 0 0 .75rem;
}

.recherche__accroche {
    max-width: 62ch;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    line-height: 1.6;
    margin: 0 0 .75rem;
}

.recherche__gratuit {
    display: inline-block;
    margin: 0;
    padding: .5rem .9rem;
    border-radius: 999px;
    background: var(--vert-fond, #E7F5EC);
    color: var(--vert, #1E7A3B);
    font-weight: 600;
    font-size: .92rem;
}

.recherche__formulaire {
    padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.conteneur--etroit {
    max-width: 860px;
}

.recherche__sous-titre {
    color: var(--gris, #5A6B80);
    margin: 0 0 1.75rem;
    max-width: 62ch;
}

/* --- Barre d'avancement -------------------------------------------------- */

.recherche__progression {
    margin: 0 0 1.75rem;
}

.recherche__progression-texte {
    margin: 0 0 .5rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--gris, #5A6B80);
}

.recherche__barre {
    height: 8px;
    border-radius: 999px;
    background: var(--bord, #DFE5EC);
    overflow: hidden;
}

.recherche__barre-remplie {
    height: 100%;
    border-radius: 999px;
    background: var(--bleu, #1B4F9C);
    transition: width .3s ease;
    width: 50%;
}

/* Largeurs en classes : voir l'en-tête de ce fichier (CSP). */
.recherche__barre-remplie--50 { width: 50%; }
.recherche__barre-remplie--100 { width: 100%; }

/* --- Étapes et champs ---------------------------------------------------- */

.recherche__etape {
    border: 1px solid var(--bord, #DFE5EC);
    border-radius: 12px;
    padding: clamp(1.25rem, 3vw, 2rem);
    margin: 0 0 1.5rem;
    background: #fff;
}

.recherche__etape legend {
    padding: 0 .6rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.recherche__grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem 1.4rem;
}

.recherche__form .champ {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.champ--large {
    margin-top: 1.1rem;
}

.recherche__form label {
    font-weight: 600;
    font-size: .92rem;
}

.recherche__form input[type="text"],
.recherche__form input[type="tel"],
.recherche__form input[type="email"],
.recherche__form input[type="number"],
.recherche__form select,
.recherche__form textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--bord, #DFE5EC);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    /* 16px minimum : en dessous, iOS zoome sur le champ au focus et casse la mise en page. */
}

.recherche__form input:focus,
.recherche__form select:focus,
.recherche__form textarea:focus {
    outline: 2px solid var(--bleu, #1B4F9C);
    outline-offset: 1px;
    border-color: var(--bleu, #1B4F9C);
}

.champ__aide {
    margin: 0;
    font-size: .82rem;
    color: var(--gris, #5A6B80);
}

.champ__requis {
    color: var(--rouge, #B3261E);
}

.champ--erreur input,
.champ--erreur select,
.champ--erreur textarea {
    border-color: var(--rouge, #B3261E);
}

.champ__erreur {
    margin: 0;
    font-size: .85rem;
    font-weight: 600;
    color: var(--rouge, #B3261E);
}

.champ--consentement {
    margin-top: 1.25rem;
}

.champ--consentement label {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    font-weight: 400;
    font-size: .92rem;
    line-height: 1.5;
}

.champ--consentement input[type="checkbox"] {
    /* 20px : cible tactile confortable, le consentement se coche au doigt. */
    width: 20px;
    height: 20px;
    margin-top: .15rem;
    flex: 0 0 auto;
}

/* --- Actions ------------------------------------------------------------- */

.recherche__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem;
}

.recherche__actions .btn {
    min-height: 48px;
    padding: .8rem 1.6rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
}

/* Pot de miel : hors écran, jamais display:none — un robot qui lit le CSS
   repère display:none et évite le champ, ce qui annule le piège. */
.recherche__piege {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 640px) {
    .recherche__grille {
        grid-template-columns: 1fr;
    }

    .recherche__actions {
        flex-direction: column-reverse;
    }

    .recherche__actions .btn {
        width: 100%;
    }
}
