/* Popup « Devis gratuit » de l'accueil : un module mod_popupbox_j6 dont le texte est un formulaire en quatre étapes à choix interactifs.
   Maquette de Mande : Temp/Screenshot_132 (bleu translucide qui laisse voir la page, titre noir, quatre barres de progression, choix en pastilles blanches,
   pastille choisie en brun #47372A). Le texte du popup et la liste des choix viennent de refonte/integration/popup-devis/definition.py. */

/* Page de fond : très floue derrière le popup, le fond bleu laisse encore deviner la zone. */
.pbj6-root:has(.dp) .pbj6-overlay { -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }

/* Page figée derrière le popup, sans que la largeur de la page change (la bande de défilement reste réservée). */
html.dp-ouvert { overflow: hidden; scrollbar-gutter: stable; }

.pbj6-root .pbj6-box:has(.dp) {
  max-width: min(800px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  overscroll-behavior: contain;
  /* Titre, progression et boutons restent en place ; seul le corps défile quand l'écran est trop court (téléphone, étape des coordonnées). */
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
}
.pbj6-root .pbj6-box:has(.dp) .pbj6-content, .dp, .dp__form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.dp__corps { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 30px 8px; overscroll-behavior: contain; }

/* Bandeau blanc du haut : le titre et les quatre barres. */
.dp__haut { flex: none; padding: 28px 30px 20px; background: #fff; }
.pbj6-root .pbj6-box:has(.dp) .pbj6-close { top: 10px; right: 10px; border-radius: 50%; }
.pbj6-root .pbj6-box:has(.dp) .pbj6-close:hover, .pbj6-root .pbj6-box:has(.dp) .pbj6-close:focus-visible { background: rgba(255, 255, 255, .55); opacity: 1; }
.pbj6-root .pbj6-box:has(.dp) .pbj6-close:focus-visible { outline: 3px solid var(--encre); outline-offset: 1px; }

.dp { font: 400 17px/1.45 var(--f-texte); color: var(--encre); }
.dp-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dp__piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.dp__titre { margin: 0 34px 18px; text-align: center; font: 700 clamp(24px, 3.4vw, 34px)/1.15 var(--f-texte); color: #000; outline: none; text-wrap: balance; }

/* Quatre barres : celles de l'étape en cours et des étapes faites en brun, les autres en bleu (maquette). */
.dp__progres { display: flex; flex: none; gap: 20px; width: 100%; max-width: 420px; margin: 0 auto; padding: 0; list-style: none; }
.dp__progres li { flex: 1; height: 9px; border-radius: 2px; background: #5299B8; transition: background-color .3s ease; }
.dp__progres li[data-etat="fait"], .dp__progres li[data-etat="actif"] { background: #47372A; }

.dp__etape { min-width: 0; }
.dp__etape:not([hidden]) { animation: dp-entree .3s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes dp-entree { from { opacity: 0; translate: calc(var(--dp-sens, 1) * 22px) 0; } to { opacity: 1; translate: 0 0; } }

/* Pastilles : un choix = un bouton blanc ; choisie, elle passe au brun. Le vrai champ reste dessous, pour le clavier et les lecteurs d'écran. */
.dp__puces { display: flex; flex-wrap: wrap; gap: 12px 14px; }
.dp__puces--centre { justify-content: center; max-width: 680px; margin: 0 auto; }
.dp-puce { position: relative; display: inline-flex; }
.dp-puce input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.dp-puce span {
  position: relative; display: inline-flex; align-items: center; min-height: 46px; padding: 9px 20px; background: #fff; color: var(--encre);
  border-radius: 8px; font: 500 19px/1.2 var(--f-texte); box-shadow: 0 1px 3px rgba(12, 48, 56, .22);
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.dp-puce:hover span { background: #fff; box-shadow: 0 0 0 2px #47372A, 0 3px 8px rgba(12, 48, 56, .2); transform: translateY(-1px); }
.dp-puce input[type="checkbox"] + span { padding-inline: 30px; }
.dp-puce input:checked + span { background: #47372A; color: #fff; transform: none; box-shadow: 0 3px 8px rgba(71, 55, 42, .45); }
.dp-puce input:focus-visible + span { outline: 3px solid var(--encre); outline-offset: 2px; }
.dp-puce input[type="checkbox"]:checked + span::before {
  content: ""; position: absolute; left: 11px; top: calc(50% - 7px); width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; rotate: 45deg;
}
.dp__puces--petites .dp-puce span { min-height: 40px; padding: 6px 15px; font-size: 17px; }

.dp__groupe { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.dp__groupe legend { padding: 0 0 0 12px; margin-bottom: 11px; border-left: 4px solid #47372A; font: 700 17px/1.2 var(--f-texte); }
.dp__sous { margin: -4px 0 20px; text-align: center; font-weight: 500; }

.dp__detail[hidden] { display: none; }
.dp__groupe--centre legend { display: table; margin: 0 auto 12px; padding: 0; border: 0; text-align: center; }
.dp__detail .dp__etiquette { padding: 0; border: 0; text-align: center; }
.dp__champ--centre { margin-inline: auto; }
.dp__champ.dp__champ--centre label { padding: 0; border: 0; text-align: center; }
.dp__champ--centre input { text-align: center; }
.dp__etiquette, .dp__champ label { display: block; margin-bottom: 7px; padding-left: 12px; border-left: 4px solid #47372A; font: 700 17px/1.2 var(--f-texte); }
.dp__champ label span { font-weight: 400; font-size: 15px; }
.dp__champ { margin-bottom: 20px; }
.dp__champ--court { max-width: 230px; }
.dp__ligne { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.dp input[type="text"], .dp input[type="tel"], .dp input[type="email"], .dp textarea {
  display: block; width: 100%; min-height: 50px; padding: 11px 14px; font: 400 18px/1.4 var(--f-texte); color: var(--encre);
  background: #fff; border: 1.5px solid #6F8F96; border-radius: 8px; box-shadow: 0 1px 3px rgba(12, 48, 56, .15);
}
.dp textarea { min-height: 130px; resize: vertical; }
.dp input[type="text"]:focus-visible, .dp input[type="tel"]:focus-visible, .dp input[type="email"]:focus-visible, .dp textarea:focus-visible {
  outline: 3px solid #47372A; outline-offset: 1px; border-color: #47372A;
}

.dp__robot { margin: 0 0 14px; }
.dp__robot altcha-widget { --altcha-max-width: 100%; display: block; background: #fff; border-radius: 6px; }
.dp__note { margin: 0 0 6px; font-size: 15px; }
.dp__erreur { margin: 14px 0 0; padding: 10px 14px; background: #fff; color: #8A1C14; border-left: 4px solid #B3261E; border-radius: 6px; font-weight: 600; }
.dp__erreur[hidden] { display: none; }

.dp--fin .dp__haut, .dp--fin .dp__budget { display: none; }
.dp--fin .dp__corps { padding: 30px 30px 26px; }
/* À la fin, le popup passe du bleu au blanc : plus de cadre bleu autour de la confirmation. */
.pbj6-root .pbj6-box:has(.dp) { transition: opacity .3s ease, transform .3s ease, background-color .4s ease, visibility 0s linear .3s; }
.pbj6-root .pbj6-box.pbj6-open:has(.dp) { transition: opacity .3s ease, transform .3s ease, background-color .4s ease; }
.pbj6-root .pbj6-box:has(.dp--fin) { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.dp--fin .dp__carte { margin-top: 0; padding: 12px 8px 4px; box-shadow: none; }
.dp__merci { text-align: center; }
.dp__carte { max-width: 660px; margin: 6px auto 0; padding: 34px 36px 32px; background: #fff; border-radius: 14px; box-shadow: 0 10px 28px rgba(12, 48, 56, .22); color: #000; }
.dp__ok { display: inline-flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin-bottom: 16px; background: #47372A; color: #fff; border-radius: 50%; animation: dp-pop .5s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
.dp__ok svg { width: 40px; height: 40px; }
@keyframes dp-pop { from { scale: .4; opacity: 0; } to { scale: 1; opacity: 1; } }
.dp__ok-titre { margin: 0 0 18px; font: 700 clamp(26px, 3.4vw, 34px)/1.2 var(--f-texte); color: #000; outline: none; text-wrap: balance; }
.dp__promesse { margin: 0 0 20px; font: 500 clamp(21px, 2.6vw, 25px)/1.45 var(--f-texte); color: #000; text-wrap: pretty; }
.dp__spam { margin: 0 0 28px; padding-top: 18px; border-top: 1px solid #D9D2CB; font: 400 clamp(18px, 2.2vw, 20px)/1.45 var(--f-texte); color: #000; }
.dp__fermer { min-height: 56px; padding: 0 52px; background: #47372A; color: #fff; border: 0; border-radius: 6px; font: 600 20px/1 var(--f-texte); cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); transition: background-color .2s ease; }
.dp__fermer:hover { background: #2E241B; }
.dp__fermer:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }

.dp__pied { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 30px 26px; }
.dp__pied[hidden] { display: none; }
.dp__aide { flex: 1; min-height: 1.45em; margin: 0; text-align: center; font-size: 15px; line-height: 1.45; font-weight: 500; }
.dp__aide--insiste { color: #5A0F0A; font-weight: 700; }
.dp__retour[hidden] { display: none; }
/* Bandeau du bas (première page) : bleu plus foncé, texte blanc, lien blanc souligné au repos et au survol. */
.dp__budget { flex: none; margin: 0; padding: 17px 30px 19px; background: #2B7391; color: #fff; text-align: center; font: 500 18px/1.4 var(--f-texte); }
.dp__budget[hidden] { display: none; }
.dp__budget a { color: #fff; font-weight: inherit; text-decoration: underline; text-underline-offset: 3px; }
.dp__budget a:hover, .dp__budget a:focus-visible { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; }
.dp__budget a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 2px; }
.dp__retour, .dp__suite {
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 26px; background: #47372A; color: #fff;
  border: 0; border-radius: 6px; font: 600 17px/1 var(--f-texte); cursor: pointer; transition: background-color .2s ease;
}
.dp__retour:hover, .dp__suite:hover { background: #2E241B; }
.dp__suite[aria-disabled="true"] { background: rgba(71, 55, 42, .5); cursor: not-allowed; }
.dp__suite[data-final] svg { display: none; }
.dp__retour svg, .dp__suite svg { flex: none; }
.dp__retour:focus-visible, .dp__suite:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
.dp__envoi { opacity: .7; pointer-events: none; }

@media (max-width: 640px) {
  .dp__haut { padding: 22px 16px 16px; }
  .dp__corps { padding: 16px 16px 6px; }
  .dp__pied { padding: 12px 16px 18px; }
  .dp__budget { padding: 14px 16px 16px; font-size: 16px; }
  .dp--fin .dp__corps { padding: 22px 16px 20px; }
  .dp { font-size: 16px; }
  .dp__titre { margin: 0 24px 14px; }
  .dp__progres { gap: 12px; }
  .dp__puces { gap: 10px; }
  .dp-puce span { min-height: 44px; padding: 8px 15px; font-size: 17px; }
  .dp__puces--petites .dp-puce span { min-height: 40px; padding: 6px 12px; font-size: 16px; }
  .dp__carte { padding: 26px 18px 24px; }
  .dp__ligne { grid-template-columns: minmax(0, 1fr); }
  .dp__pied { flex-wrap: wrap; }
  .dp__aide { order: -1; flex-basis: 100%; min-height: 2.9em; }
  .dp__suite { margin-left: auto; }
  .dp__retour, .dp__suite { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .dp__etape:not([hidden]) { animation: none; }
  .dp-puce span, .dp__progres li { transition: none; }
  .dp__ok { animation: none; }
}
