/* ==========================================================================
   FORMULAIRE DE QUALIFICATION — feuille de style
   ==========================================================================

   Direction : l'ardoise et le fer du Conflent, et l'encre des plans
   techniques. Un bandeau profond qui annonce ce que le visiteur gagne, puis
   un questionnaire posé à plat, sans boîtes empilées. Le contenu est composé
   à empattements, l'interface en linéale : la distinction est fonctionnelle,
   ce qu'on lit d'un côté, ce qu'on manipule de l'autre.

   Aucune police distante n'est chargée — il serait incohérent d'appeler les
   serveurs de Google sur un formulaire dont l'argument est que vos données
   n'y passent pas. Georgia est présente sur Windows et macOS ; ailleurs, les
   substituts déclarés prennent le relais.

   Pour changer les couleurs, ne touchez qu'au bloc :root.
   ========================================================================== */

:root {
    /* L'ardoise du Conflent, pas un noir teinté : un vrai bleu-gris sombre. */
    --encre:          #1c2a35;
    --encre-douce:    #4d5c69;
    --encre-tenue:    #626c7a;   /* 5,3:1 sur blanc — vérifié */

    --granit:         #e3e6e6;   /* fond de page, minéral et froid */
    --surface:        #ffffff;
    --trait:          #d2d7d8;
    --trait-fort:     #b4bdc0;

    /* Bleu de plan technique. Profond, pas le bleu clair des interfaces. */
    --prusse:         #17475f;
    --prusse-sombre:  #0f3246;
    --prusse-pale:    #dde8ee;

    --alerte:         #a4332a;
    --alerte-pale:    #fbefed;

    --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman",
             "Noto Serif", serif;
    --lineale: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;

    --colonne: 40rem;
    --rayon: 3px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --encre:         #e6eaec;
        --encre-douce:   #a8b4bd;
        --encre-tenue:   #929eab;
        --granit:        #141c23;
        --surface:       #1b242c;
        --trait:         #2d3942;
        --trait-fort:    #41505b;
        --prusse:        #6fa8c6;
        --prusse-sombre: #8fc0d8;
        --prusse-pale:   #19303e;
        --alerte:        #e08a80;
        --alerte-pale:   #2a1c1a;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--granit);
    color: var(--encre);
    font: 400 17px/1.65 var(--serif);
    -webkit-font-smoothing: antialiased;
}

.contenu {
    max-width: var(--colonne);
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================================================ BANDEAU

   Le hero n'annonce pas le formulaire mais ce que le visiteur obtient en
   échange de trois minutes. C'est la seule chose qui le fera commencer.     */

.bandeau {
    background: var(--prusse);
    color: #fff;
    padding: 36px 0 32px;
}

@media (prefers-color-scheme: dark) {
    .bandeau { background: var(--prusse-pale); color: var(--encre); }
}

.marque {
    margin: 0 0 20px;
    font-family: var(--lineale);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .72);
}

@media (prefers-color-scheme: dark) {
    .marque { color: var(--encre-douce); }
}

.bandeau h1 {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.18;
    font-weight: 400;
    letter-spacing: -.012em;
    text-wrap: balance;
}

.promesse {
    margin: 16px 0 0;
    font-size: 1.04rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .86);
    max-width: 34rem;
}

@media (prefers-color-scheme: dark) {
    .promesse { color: var(--encre-douce); }
}

.duree {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .22);
    font-family: var(--lineale);
    font-size: .88rem;
    color: rgba(255, 255, 255, .78);
}

@media (prefers-color-scheme: dark) {
    .duree { border-top-color: var(--trait); color: var(--encre-tenue); }
}

/* ============================================================ PROGRESSION

   Une règle pleine largeur sous le bandeau, pas une barre posée dans une
   boîte : la progression appartient à la page, pas à une carte.             */

.jauge { height: 3px; background: var(--trait); }

.jauge span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--prusse);
    transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

/* La largeur passe par une classe et non par un attribut style : la politique
   de sécurité de contenu déclarée dans commun.php interdit les styles en
   ligne, et c'est elle qui empêche l'injection de contenu dans cette page. */
.jauge span.p5   { width:   5%; }
.jauge span.p10  { width:  10%; }
.jauge span.p15  { width:  15%; }
.jauge span.p20  { width:  20%; }
.jauge span.p25  { width:  25%; }
.jauge span.p30  { width:  30%; }
.jauge span.p35  { width:  35%; }
.jauge span.p40  { width:  40%; }
.jauge span.p45  { width:  45%; }
.jauge span.p50  { width:  50%; }
.jauge span.p55  { width:  55%; }
.jauge span.p60  { width:  60%; }
.jauge span.p65  { width:  65%; }
.jauge span.p70  { width:  70%; }
.jauge span.p75  { width:  75%; }
.jauge span.p80  { width:  80%; }
.jauge span.p85  { width:  85%; }
.jauge span.p90  { width:  90%; }
.jauge span.p95  { width:  95%; }
.jauge span.p100 { width: 100%; }

.compteur {
    margin: 0;
    padding: 14px 0 0;
    font-family: var(--lineale);
    font-size: .78rem;
    color: var(--encre-tenue);
    font-variant-numeric: tabular-nums;
}

/* ================================================================= ÉTAPES */

main { padding: 0 0 56px; }

/* Marge et non padding : dans un fieldset, le legend est rendu hors du flux
   normal, si bien qu'un padding-top s'applique au premier enfant — ici l'aide
   de section — et creuse un vide sous le titre. */
.etape {
    border: 0;
    margin: 28px 0 0;
    padding: 0;
    min-width: 0;
}

/* Le numéro est justifié : ce sont bien cinq étapes successives, pas une
   décoration. Carré plutôt que rond — on est plus près du repère technique
   que de la pastille d'application. */
.etape > legend {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 0;
    margin: 0 0 8px;
    font-size: 1.42rem;
    font-weight: 400;
    letter-spacing: -.01em;
}

.rang {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--prusse);
    border-radius: var(--rayon);
    color: var(--prusse);
    font-family: var(--lineale);
    font-size: .76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transform: translateY(-2px);
}

.aide-section {
    margin: 0;
    color: var(--encre-tenue);
    font-size: .97rem;
    font-style: italic;
}

/* ============================================================== QUESTIONS */

.question {
    padding: 26px 0 0;
    margin-top: 26px;
    border-top: 1px solid var(--trait);
}

/* La première question suit l'aide de section : pas de filet, et moins
   d'écart, sinon l'aide se retrouve orpheline entre le titre et le vide. */
.question:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 22px;
}

.groupe { border: 0; margin: 0; padding: 0; min-width: 0; }

.intitule {
    display: block;
    padding: 0;
    margin: 0 0 5px;
    font-size: 1.08rem;
    line-height: 1.45;
    color: var(--encre);
}

.intitule abbr {
    color: var(--prusse);
    text-decoration: none;
    font-family: var(--lineale);
}

.aide {
    margin: 0 0 14px;
    font-size: .93rem;
    line-height: 1.55;
    color: var(--encre-tenue);
}

.intitule + .options,
.intitule + input,
.intitule + textarea { margin-top: 14px; }

/* ------------------------------------------------ options cliquables */

.options { display: flex; flex-direction: column; gap: 2px; }

.option {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 12px 15px;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    cursor: pointer;
    font-family: var(--lineale);
    font-size: .97rem;
    line-height: 1.45;
    transition: border-color .12s, background-color .12s;
}

.option + .option { margin-top: -1px; }

.option:hover { border-color: var(--trait-fort); z-index: 1; }

.option input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    accent-color: var(--prusse);
    cursor: pointer;
}

.option:has(input:checked) {
    border-color: var(--prusse);
    background: var(--prusse-pale);
    position: relative;
    z-index: 2;
}

.option:has(input:focus-visible) {
    outline: 2px solid var(--prusse);
    outline-offset: 1px;
    z-index: 3;
}

@supports not selector(:has(*)) {
    .option input:checked { outline: 2px solid var(--prusse); }
}

/* ------------------------------------------------- champs de saisie */

input[type="text"], input[type="email"], input[type="tel"], textarea, select {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    color: var(--encre);
    font-family: var(--lineale);
    font-size: 1rem;
    transition: border-color .12s, box-shadow .12s;
}

input:hover, textarea:hover { border-color: var(--trait-fort); }

input:focus, textarea:focus, select:focus {
    outline: 0;
    border-color: var(--prusse);
    box-shadow: inset 0 0 0 1px var(--prusse);
}

textarea { resize: vertical; min-height: 100px; line-height: 1.55; }

/* ================================================================ ERREURS */

.question.en-erreur .intitule { color: var(--alerte); }

.question.en-erreur input[type="text"],
.question.en-erreur input[type="email"],
.question.en-erreur input[type="tel"],
.question.en-erreur textarea,
.question.en-erreur .option { border-color: var(--alerte); }

.message-erreur {
    margin: 0 0 12px;
    font-family: var(--lineale);
    font-size: .88rem;
    font-weight: 550;
    color: var(--alerte);
}

.alerte {
    margin: 24px 0 0;
    padding: 14px 17px;
    background: var(--alerte-pale);
    border-left: 3px solid var(--alerte);
    border-radius: 0 var(--rayon) var(--rayon) 0;
    color: var(--alerte);
    font-size: .97rem;
}

/* ============================================================= NAVIGATION */

.navigation {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 32px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--trait);
}

button {
    font-family: var(--lineale);
    font-size: .97rem;
    font-weight: 550;
    padding: 12px 24px;
    border-radius: var(--rayon);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}

button:focus-visible { outline: 2px solid var(--prusse); outline-offset: 2px; }

.suivant, .envoyer {
    background: var(--prusse);
    color: #fff;
    margin-left: auto;
}

.suivant:hover, .envoyer:hover { background: var(--prusse-sombre); }

.envoyer:disabled { opacity: .6; cursor: default; }

@media (prefers-color-scheme: dark) {
    .suivant, .envoyer { color: #0d151b; }
}

.precedent {
    background: transparent;
    border-color: var(--trait-fort);
    color: var(--encre-douce);
}

.precedent:hover { border-color: var(--encre-douce); color: var(--encre); }

/* ====================================================== MENTION ET NOTICE */

.mention-rgpd {
    margin: 28px 0 0;
    padding-left: 15px;
    border-left: 2px solid var(--trait-fort);
    font-size: .92rem;
    line-height: 1.6;
    color: var(--encre-tenue);
}

.notice {
    margin: 48px 0 0;
    padding: 32px 0 0;
    border-top: 2px solid var(--trait-fort);
}

.notice h2 {
    margin: 0 0 20px;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: -.01em;
}

.notice dl { margin: 0; }

.notice dt {
    font-family: var(--lineale);
    font-weight: 600;
    font-size: .86rem;
    margin: 18px 0 4px;
    color: var(--encre);
}

.notice dt:first-child { margin-top: 0; }

.notice dd {
    margin: 0;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--encre-douce);
}

/* ================================================================== MERCI */

.merci {
    padding: 44px 0 0;
    max-width: 34rem;
}

.merci h1 {
    margin: 0 0 18px;
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -.015em;
    line-height: 1.2;
}

.merci p {
    margin: 0 0 14px;
    color: var(--encre-douce);
    font-size: 1.05rem;
}

.merci .appel {
    margin: 26px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--trait);
    color: var(--encre);
}

/* =================================================================== PIED */

.pied {
    margin-top: 56px;
    border-top: 1px solid var(--trait);
    padding: 22px 0 36px;
    font-family: var(--lineale);
    font-size: .86rem;
    color: var(--encre-tenue);
}

.pied p { margin: 0 0 5px; }
.pied p:last-child { margin-bottom: 0; }

a { color: var(--prusse); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--prusse-sombre); }

/* ============================================================ CHAMP-PIÈGE */

.piege {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ================================================================= MOBILE */

@media (max-width: 34rem) {
    body { font-size: 16px; }
    .bandeau { padding: 28px 0 26px; }
    .bandeau h1 { font-size: 1.68rem; }
    .promesse { font-size: 1rem; }
    .etape > legend { font-size: 1.24rem; gap: 11px; }
    .aide-section { padding-left: 0; }
    .merci h1 { font-size: 1.6rem; }
    .navigation { flex-wrap: wrap; }
    .suivant, .envoyer { flex: 1 1 100%; margin-left: 0; order: -1; }
    .precedent { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; }
}

@media print {
    .navigation, .progression, .pied { display: none; }
    .bandeau { background: none; color: #000; border-bottom: 2px solid #000; }
    .bandeau h1, .promesse, .marque, .duree { color: #000; }
    .etape { break-inside: avoid; }
}

/* =============================================================== PLANNING

   Une grille jours × plages de deux heures pour le créneau de rappel. Chaque
   case est une vraie case à cocher, assez grande pour le doigt ; les titres
   de ligne et de colonne suffisent à la lire, et chaque case porte son nom
   complet (« Mardi, 12 h – 14 h ») pour les lecteurs d'écran.               */

.planning-cadre { margin-top: 14px; overflow-x: auto; }

.planning {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-family: var(--lineale);
    font-size: .88rem;
}

.planning th, .planning td {
    padding: 0;
    border: 1px solid var(--trait);
    text-align: center;
}

.planning thead td {
    background: var(--granit);
    border-top-color: transparent;
    border-left-color: transparent;
}

.planning thead th {
    padding: 8px 2px;
    font-weight: 600;
    color: var(--encre-douce);
}

.planning thead abbr { text-decoration: none; }

.planning tbody th {
    padding: 0 10px;
    font-weight: 400;
    text-align: right;
    white-space: nowrap;
    color: var(--encre-douce);
    font-variant-numeric: tabular-nums;
}

.case-planning {
    display: grid;
    place-items: center;
    min-height: 40px;
    cursor: pointer;
    transition: background-color .12s;
}

.case-planning:hover,
.case-planning:has(input:checked) { background: var(--prusse-pale); }

.case-planning input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--prusse);
    cursor: pointer;
}

.case-planning:has(input:focus-visible) {
    outline: 2px solid var(--prusse);
    outline-offset: -2px;
}

.intitule abbr.conditionnel[hidden] { display: none; }

@media (max-width: 34rem) {
    .planning { font-size: .8rem; }
    .planning tbody th { padding: 0 6px; }
    .case-planning { min-height: 44px; }
}
