/*
 * MDK Formulaires — tunnel en étapes (Contact Form 7), #377.
 * Charte d'interface de Vincent (savoir charte/interface.md) : mode clair, cases-boutons à coins discrets (jamais de
 * pilule), survol = contour fin de la couleur d'action sans mouvement, champ actif = contour fin, texte saisi à 16 px,
 * tailles en pixels entiers, aucun lien souligné, aucun fond teinté derrière un texte. Polices : celles du thème.
 * Couleur d'action : --db-action (réglage du module, sinon lue dans le thème par tunnel.js, sinon bleu MDK).
 * Sélecteurs préfixés par .wpcf7-form .db-form pour passer devant les styles génériques des thèmes (input[type=text]…).
 */
.db-form {
  --db-action: #006FBA;
  --db-action-survol: #005C9A;
  --db-action-doux: #EEF5FB;
  --db-encre: #1C1F22;
  --db-texte: #33383C;
  --db-gris: #5B6470;
  --db-aide: #8A9096;
  --db-trait: #E1E5EA;
  --db-trait-case: #D5DAE0;
  --db-trait-pale: #EEF0F2;
  --db-grise: #B4B9BE;
  --db-rouge: #B42318;
  --db-vert: #2F7D57;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 18px;
  background: #fff;
  border: 1px solid var(--db-trait);
  border-radius: 6px;
  color: var(--db-texte);
  font-size: 15px;
  line-height: 22px;
  text-align: left;
  box-sizing: border-box;
}
@media (min-width: 640px) { .db-form { padding: 28px 32px 24px; } }
.db-form *, .db-form *::before, .db-form *::after { box-sizing: border-box; }
.db-form p { margin: 0; }
.db-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.db-form [hidden] { display: none !important; }
.db-form .wpcf7-form-control-wrap { display: block; position: relative; }

/* Étapes nommées et corbeille */
.db-pas-ligne { display: flex; align-items: flex-start; gap: 12px; }
.db-pas-ligne .db-pas { flex: 1; }
.db-form .db-pas { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 20px; padding: 0 0 14px; list-style: none; border-bottom: 1px solid var(--db-trait-pale); font-size: 13px; line-height: 20px; color: var(--db-aide); counter-reset: dbpas; }
.db-form .db-pas li { position: relative; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; counter-increment: dbpas; }
/* Pastille dans le flux, quoi qu'impose le thème aux listes numérotées (Diamond de GT3 : ol li::before en absolu,
   pastille posée sur le texte, vu sur refletdimage.com le 01/12/2026) */
.db-form .db-pas li::before { position: static; top: auto; left: auto; right: auto; transform: none; flex: none; margin: 0; }
.db-form .db-pas li::before { content: counter(dbpas); display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--db-trait-case); border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--db-gris); background: #fff; transition: background .25s, border-color .25s, color .25s; }
.db-form .db-pas li + li::after { content: ""; position: absolute; left: -17px; top: 50%; width: 12px; height: 1px; background: var(--db-trait-case); }
.db-form .db-pas li.is-active { color: var(--db-encre); font-weight: 600; }
.db-form .db-pas li.is-active::before { background: var(--db-action); border-color: var(--db-action); color: #fff; }
.db-form .db-pas li.is-faite { color: var(--db-gris); }
.db-form .db-pas li.is-faite::before { content: "✓"; border-color: var(--db-vert); color: var(--db-vert); }
@media (max-width: 559px) {
  .db-form .db-pas li:not(.is-active) { font-size: 0; gap: 0; }
  .db-form .db-pas li:not(.is-active)::before { font-size: 12px; }
}
.db-repris { flex: none; }
.db-corbeille { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--db-aide); cursor: pointer; }
.db-corbeille:hover { border-color: var(--db-action); color: var(--db-encre); }

/* Une étape à la fois (sans JavaScript : tout s'affiche, le formulaire reste utilisable) */
.db-form.db-js .db-etape { display: none; }
.db-form.db-js .db-etape.db-active { display: block; }
.db-etape > legend { display: block; width: 100%; margin: 0 0 16px; padding: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--db-encre); font-family: inherit; }
.db-etape.db-vers-avant { animation: db-avant .28s ease-out; }
.db-etape.db-vers-arriere { animation: db-arriere .28s ease-out; }
@keyframes db-avant { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes db-arriere { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

/* Champs */
.db-champ { position: relative; margin: 0 0 18px; }
.db-ligne { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 560px) { .db-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.db-form .db-libelle, .db-form .db-champ > label, .db-form .db-champ label.db-lib { display: block; margin: 0 0 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--db-encre); }
.db-form .db-aide { margin: -4px 0 8px; font-size: 13px; line-height: 18px; color: var(--db-gris); }
.db-req { margin-left: 2px; color: var(--db-aide); font-weight: 400; }
.db-champ[data-requis-si]:not(.db-exige) .db-req { display: none; }
.db-champ small { font-size: 13px; color: var(--db-aide); font-weight: 400; }
.wpcf7-form .db-form input[type="text"], .wpcf7-form .db-form input[type="email"], .wpcf7-form .db-form input[type="tel"],
.wpcf7-form .db-form input[type="number"], .wpcf7-form .db-form input[type="date"], .wpcf7-form .db-form select, .wpcf7-form .db-form textarea {
  display: block; width: 100%; max-width: 100%; height: 46px; margin: 0; padding: 0 12px;
  border: 1px solid var(--db-trait-case); border-radius: 6px; background: #fff; color: var(--db-encre);
  font-family: inherit; font-size: 16px; line-height: 22px; letter-spacing: normal; text-transform: none;
  box-shadow: none; outline: 0; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.wpcf7-form .db-form textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; }
.wpcf7-form .db-form input:hover, .wpcf7-form .db-form select:hover, .wpcf7-form .db-form textarea:hover { border-color: var(--db-action); }
.wpcf7-form .db-form input:focus, .wpcf7-form .db-form select:focus, .wpcf7-form .db-form textarea:focus { border-color: var(--db-action); box-shadow: 0 0 0 1px var(--db-action); }
.db-form ::placeholder { color: var(--db-aide); opacity: 1; }

/* Choix en cases-boutons (radio et cases à cocher de Contact Form 7) */
.db-form .wpcf7-radio, .db-form .wpcf7-checkbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.db-form .db-choix-2 .wpcf7-radio, .db-form .db-choix-2 .wpcf7-checkbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-form .db-choix-4 .wpcf7-radio, .db-form .db-choix-4 .wpcf7-checkbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .db-form .db-choix-4 .wpcf7-radio, .db-form .db-choix-4 .wpcf7-checkbox { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Cases de même taille : lignes de même hauteur, chaque case remplit la sienne (0.1.4) */
.db-form .wpcf7-radio, .db-form .wpcf7-checkbox { grid-auto-rows: 1fr; }
.db-form .wpcf7-list-item { display: block; margin: 0; height: 100%; }
.db-form .wpcf7-list-item label { position: relative; display: block; margin: 0; cursor: pointer; height: 100%; }
.db-form .wpcf7-list-item-label { box-sizing: border-box; height: 100%; }
.db-form .wpcf7-list-item input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.db-form .wpcf7-list-item-label {
  display: flex; align-items: center; gap: 10px; min-height: 48px; height: 100%; padding: 10px 12px;
  border: 1px solid var(--db-trait-case); border-radius: 6px; background: #fff; color: var(--db-texte);
  font-size: 15px; line-height: 20px; transition: border-color .15s, box-shadow .15s, color .15s;
}
.db-form .wpcf7-list-item label:hover .wpcf7-list-item-label { border-color: var(--db-action); }
.db-form .wpcf7-list-item input:focus-visible + .wpcf7-list-item-label { outline: 2px solid var(--db-action); outline-offset: 2px; }
.db-form .wpcf7-list-item input:checked + .wpcf7-list-item-label { border-color: var(--db-action); box-shadow: inset 0 0 0 1px var(--db-action); color: var(--db-encre); font-weight: 600; }
/* Ce qu'un thème ou une ancienne copie du moteur ajoute aux choix (rond de bouton radio dessiné en ::before) : retiré */
.db-form.mdk-tunnel .wpcf7-list-item-label::before, .db-form.mdk-tunnel .wpcf7-list-item-label::after { content: none; display: none; }
.db-form .wpcf7-list-item-label .db-picto { flex: none; width: 22px; height: 22px; color: var(--db-gris); transition: color .15s; }
.db-form .wpcf7-list-item input:checked + .wpcf7-list-item-label .db-picto { color: var(--db-action); }
/* Grandes tuiles à pictogramme (étape 1) : pictogramme au-dessus du texte */
.db-form .db-tuiles .wpcf7-radio, .db-form .db-tuiles .wpcf7-checkbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .db-form .db-tuiles .wpcf7-radio, .db-form .db-tuiles .wpcf7-checkbox { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.db-form .db-tuiles .wpcf7-list-item-label { flex-direction: column; justify-content: center; gap: 8px; min-height: 92px; padding: 14px 8px; text-align: center; font-size: 14px; }
.db-form .db-tuiles .wpcf7-list-item-label .db-picto { width: 28px; height: 28px; }
/* Téléphone : tuiles plus basses, choix à pictogramme sur une ligne même en deux colonnes */
@media (max-width: 559px) {
  .db-form .wpcf7-list-item-label { gap: 8px; padding: 8px 10px; font-size: 14px; }
  .db-form .db-tuiles .wpcf7-list-item-label { min-height: 76px; padding: 10px 6px; gap: 6px; }
  .db-form .db-tuiles .wpcf7-list-item-label .db-picto { width: 24px; height: 24px; }
}
/* Colonne très étroite (thème qui garde une barre latérale sur téléphone : 260 px sur refletdimage.com) : formulaire
   moins rembourré, choix à deux colonnes avec le pictogramme au-dessus du texte, qui ne se coupe plus */
@media (max-width: 400px) {
  .db-form { padding: 16px 12px; }
  .db-form .db-pas { flex-wrap: nowrap; gap: 6px 14px; }
  .db-form .db-pas li + li::after { left: -11px; width: 8px; }
  .db-form .db-choix-2.db-avec-ico .wpcf7-list-item-label { flex-direction: column; justify-content: center; gap: 4px; padding: 10px 6px; text-align: center; }
}

/* Champ oublié */
.db-champ.db-oubli .wpcf7-list-item-label, .wpcf7-form .db-form .db-oubli input:not([type="radio"]):not([type="checkbox"]), .wpcf7-form .db-form .db-oubli textarea { border-color: var(--db-rouge); }
.db-a-renseigner { display: block; margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--db-rouge); }
.db-secousse { animation: db-secousse .32s; }
@keyframes db-secousse { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.db-form .wpcf7-not-valid-tip { margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--db-rouge); }

/* Téléphone : pays du numéro (liste de MDK Anti-Spam 1.6.3) devant le champ, à sa hauteur */
.db-form .mdk-cf7-tel { display: flex; flex-wrap: wrap; gap: 8px; }
.wpcf7-form .db-form .mdk-cf7-tel > input { flex: 1 1 140px; width: auto; min-width: 0; }
.db-form .mdk-cf7-tel > .wpcf7-not-valid-tip { flex-basis: 100%; }
.wpcf7-form .db-form select.mdk-cf7-pays {
  flex: 0 0 auto; width: auto; max-width: 150px; height: 46px; padding: 0 30px 0 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%278%27%3E%3Cpath d=%27M1 1l5 5 5-5%27 fill=%27none%27 stroke=%27%235B6470%27 stroke-width=%271.5%27/%3E%3C/svg%3E") no-repeat right 10px center;
}

/* E-mail : fins d'adresse proposées */
.db-email-aide { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--db-gris); }
.db-email-aide:empty { display: none; }
.db-email-aide button { min-height: 32px; padding: 4px 10px; border: 1px solid var(--db-trait-case); border-radius: 6px; background: #fff; color: var(--db-texte); font: inherit; font-size: 13px; cursor: pointer; }
.db-email-aide button:hover { border-color: var(--db-action); }
.db-email-aide .db-correction { color: var(--db-action); font-weight: 600; }

/* Dictée */
.db-dictee .db-avec-micro { padding-right: 48px !important; }
.db-micro { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--db-trait-case); border-radius: 6px; background: #fff; color: var(--db-gris); cursor: pointer; }
.db-micro svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.db-micro:hover { border-color: var(--db-action); color: var(--db-encre); }
.db-micro.is-ecoute { border-color: var(--db-rouge); color: var(--db-rouge); }
.db-micro-etat { position: absolute; right: 52px; bottom: 16px; font-size: 13px; color: var(--db-rouge); }
.db-micro-info { margin-top: 6px !important; font-size: 13px; line-height: 18px; color: var(--db-aide); }

/* Récapitulatif */
.db-recap { margin: 4px 0 16px; border-top: 1px solid var(--db-trait-pale); }
.db-recap:empty { display: none; }
.db-recap-ligne { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--db-trait-pale); font-size: 14px; line-height: 20px; }
.db-recap-libelle { font-size: 13px; color: var(--db-gris); }
.db-recap-valeur { font-weight: 500; color: var(--db-encre); overflow-wrap: anywhere; }
.db-recap-modifier { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--db-action); cursor: pointer; }
.db-recap-modifier:hover { border-color: var(--db-action); }

/* Mention de confidentialité */
.db-mention { margin: 4px 0 0 !important; font-size: 13px; line-height: 18px; color: var(--db-gris); }
.db-mention a { color: var(--db-action); text-decoration: none; }
.db-mention a:hover { text-decoration: none; color: var(--db-action-survol); }

/* Navigation */
.db-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--db-trait-pale); }
.db-form .db-precedent { width: auto; min-height: 44px; margin: 0; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: none; box-shadow: none; color: var(--db-gris); font: inherit; font-size: 15px; font-weight: 400; letter-spacing: normal; text-transform: none; cursor: pointer; }
.db-form button { text-transform: none; letter-spacing: normal; text-shadow: none; }
.db-form .db-precedent:hover { border-color: var(--db-action); color: var(--db-encre); }
.db-form .db-suivant, .wpcf7-form .db-form input[type="submit"] {
  display: inline-block; width: auto; min-height: 46px; margin: 0 0 0 auto; padding: 0 26px;
  border: 1px solid var(--db-action); border-radius: 6px; background: var(--db-action); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 600; line-height: 44px; letter-spacing: normal; text-transform: none;
  text-shadow: none; box-shadow: none; cursor: pointer; -webkit-appearance: none; appearance: none; transition: background .15s, border-color .15s;
}
.db-form .db-suivant:hover, .wpcf7-form .db-form input[type="submit"]:hover { background: var(--db-action-survol); border-color: var(--db-action-survol); color: #fff; }
.db-form .db-suivant:focus-visible, .wpcf7-form .db-form input[type="submit"]:focus-visible { outline: 2px solid var(--db-action); outline-offset: 3px; }
.db-form .db-suivant.db-grise, .wpcf7-form .db-form input[type="submit"].db-grise,
.db-form .db-suivant.db-grise:hover, .wpcf7-form .db-form input[type="submit"].db-grise:hover { background: var(--db-grise); border-color: var(--db-grise); color: #fff; }
.db-suivant.db-pret, .db-form input[type="submit"].db-pret { animation: db-halo .7s ease-out; }
@keyframes db-halo { from { box-shadow: 0 0 0 0 var(--db-action); } to { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); } }
.db-envoi { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.db-envoi .wpcf7-spinner { margin: 0; }
.db-manque-nav { margin: 10px 0 0 !important; font-size: 13px; line-height: 18px; color: var(--db-gris); text-align: right; }
.db-manque-nav:empty { display: none; }
@media (max-width: 559px) {
  .db-nav { flex-wrap: wrap; }
  .db-form .db-suivant, .db-envoi { flex: 1 1 auto; }
  .db-envoi input[type="submit"] { width: 100%; }
}

/* Merci */
.db-merci { padding: 24px 8px; text-align: center; }
.db-merci svg { width: 56px; height: 56px; fill: none; stroke: var(--db-vert); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.db-merci h3 { margin: 12px 0 6px; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--db-encre); }
.db-merci p { color: var(--db-gris); }

/* Contact Form 7 : message de réponse et pot de miel */
.wpcf7-form:has(.db-form) .wpcf7-response-output { max-width: 680px; margin: 12px auto 0; padding: 10px 14px; border-radius: 6px; font-size: 14px; line-height: 20px; }
.wpcf7-form.sent:has(.db-form .db-merci.db-visible) .wpcf7-response-output { display: none; }
.db-pot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) { .db-form *, .db-form *::before { animation: none !important; transition: none !important; } }
