/* ProPilot · modale « kit démo » (balisage construit par js/demo.js). Référence de rendu : la feuille du kit démo de la maquette.
   Bureau : carte centrée 1040 × 640, rayon 24, contenu à gauche et visuel à droite, fond flouté cliquable.
   Mobile (< 760 px) : plein écran, visuel en haut (38svh), contenu défilant dessous. */

/* Page derrière la modale : défilement bloqué, largeur de la barre de défilement compensée */
html.pp-demo-open, html.pp-demo-open body { overflow: hidden; }
html.pp-demo-open body { padding-right: var(--pp-demo-sbw, 0px); }

.demo { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 32px; font-family: var(--font-ui); color: var(--white); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
.demo[hidden] { display: none; }
.demo, .demo *, .demo *::before, .demo *::after { box-sizing: border-box; }
.demo :focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.demo [tabindex="-1"]:focus { outline: none; }
.demo [hidden] { display: none !important; }   /* plus fort que les display des encadrés (.demo__warn:not(:empty)…) */

.demo__backdrop { position: absolute; inset: 0; background: rgba(11, 20, 36, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: demo-fade .4s ease both; }

.demo__sheet { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: 100%; max-width: 1040px; height: min(640px, 100%); max-height: 100%; overflow: hidden; border-radius: var(--r-sheet); background: var(--navy); color: var(--white); box-shadow: 0 60px 140px rgba(0, 0, 0, .5); animation: demo-in .6s var(--ease) both; }

/* ---------- Visuel (scène PP.story ou image de repli) ---------- */
.demo__visual { position: relative; order: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse 70% 70% at 50% 50%, var(--navy-glow) 0%, var(--navy) 75%); }
.demo__poster { position: absolute; top: 50%; left: 50%; height: min(78%, 430px); max-width: 82%; aspect-ratio: 600 / 760; transform: translate(-50%, -50%); overflow: hidden; border-radius: 22px; background: var(--navy-2); box-shadow: 0 40px 80px rgba(0, 0, 0, .45); }
.demo__poster img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
/* Voile sous la légende, ancré au bas de la carte : la légende reste au-dessus de 4,5:1 même sur un pixel blanc */
.demo__poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 20, 36, .25) 0%, rgba(11, 20, 36, 0) 28%, rgba(11, 20, 36, 0) calc(100% - 150px), rgba(11, 20, 36, .78) calc(100% - 80px), rgba(11, 20, 36, .92) 100%); }
.demo__pill { position: absolute; z-index: 1; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 28px); padding: 5px 11px 5px 9px; border-radius: var(--r-pill); background: var(--white); color: var(--navy); font-size: 12px; font-weight: 700; line-height: 1.3; }
.demo__pill::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.demo__poster-meta { position: absolute; z-index: 1; right: 16px; bottom: 16px; left: 16px; display: flex; flex-direction: column; gap: 6px; }
.demo__poster-k { font-size: 12px; font-weight: 700; line-height: 1.2; letter-spacing: .14em; text-transform: uppercase; color: var(--white); }
.demo__poster-t { font-family: var(--font-serif); font-size: clamp(26px, 3vw, 40px); font-weight: 400; line-height: 1; letter-spacing: -.02em; color: var(--white); }

/* ---------- Contenu ---------- */
.demo__body { --pad: 36px; position: relative; display: flex; flex-direction: column; gap: 22px; min-height: 0; padding: var(--pad); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 64px 0 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
/* La rangée du haut (sur-titre, fermer) reste visible quand le contenu défile ; scroll-padding (64 px) garde l’élément
   qui reçoit le focus sous elle (son bas tombe à 50 px du haut, plus le dégradé de 12 px) */
.demo__head { position: sticky; top: calc(14px - 2 * var(--pad));   /* décalage compté depuis le bord intérieur du rembourrage : collée, la rangée garde 14 px au-dessus d’elle */ z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: calc(-1 * var(--pad)); padding-top: var(--pad); background: var(--navy); }
.demo__head::after { content: ""; position: absolute; top: 100%; right: 0; left: 0; height: 12px; background: linear-gradient(var(--navy), rgba(11, 20, 36, 0)); pointer-events: none; }
.demo__kicker { font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan-light); }
.demo__close { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -8px 0 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--white); cursor: pointer; transition: background-color .3s; -webkit-tap-highlight-color: transparent; }
.demo__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.demo__title { margin: 0; font-family: var(--font-serif); font-size: clamp(30px, 3.4vw, 44px); font-weight: 400; line-height: 1.02; letter-spacing: -.02em; color: var(--white); }
.demo__title em { font-style: italic; color: var(--cyan); }

.demo__panel { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.demo__panel--end { gap: 16px; animation: demo-in .6s var(--ease) both; }

/* ---------- Champs ---------- */
.demo__field { display: flex; flex-direction: column; min-width: 0; }
.demo__label { margin-bottom: 8px; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--mist); }
.demo__input { display: block; width: 100%; height: 54px; margin: 0; padding: 0 20px; border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--r-pill); background: rgba(255, 255, 255, .06); color: var(--white); font: 500 16px/1.2 var(--font-ui); -webkit-appearance: none; appearance: none; transition: border-color .2s; }
.demo__input::placeholder { color: var(--mist-2); opacity: 1; }
.demo__input:focus { border-color: var(--cyan); }
.demo__input[aria-invalid="true"] { border-color: var(--warn-on-dark); }
.demo__input:-webkit-autofill { -webkit-text-fill-color: var(--white); box-shadow: 0 0 0 100px var(--navy-2) inset; caret-color: var(--white); }
.demo__help { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mist-2); text-align: center; }
.demo__help--start { text-align: left; }
.demo__row { display: flex; flex-wrap: wrap; gap: 12px; }
.demo__row > .demo__field { flex: 1 1 180px; }

.demo__err { display: flex; gap: 8px; margin: 8px 0 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--warn-on-dark); overflow-wrap: anywhere; }
.demo__err::before, .demo__warn:not(:empty)::before, .demo__alert:not(:empty)::before { content: "!"; content: "!" / ""; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--warn-on-dark); color: var(--navy); font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; }

/* Avertissement (SeLoger, Leboncoin) et refus du service : encadrés, absents tant qu’ils sont vides
   (les régions vivantes restent dans la page pour être annoncées) */
.demo__warn, .demo__alert { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.demo__warn:not(:empty) { display: flex; gap: 10px; margin-top: 12px; padding: 12px 16px; border: 1px solid rgba(243, 180, 157, .38); border-radius: 14px; background: rgba(243, 180, 157, .08); color: #E6EBF0; }
.demo__warn:not(:empty)::before, .demo__alert:not(:empty)::before { margin-top: 2px; }
.demo__panel > .demo__warn:not(:empty) { margin-top: 0; }
.demo__alert:not(:empty) { display: flex; gap: 10px; margin-bottom: 12px; padding: 12px 16px; border: 1px solid var(--warn-on-dark); border-left-width: 4px; border-radius: 14px; background: rgba(243, 180, 157, .1); color: var(--white); font-weight: 600; }

/* Rappel du lien à l’étape des coordonnées */
.demo__recap { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 4px 6px 4px 20px; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r-pill); background: rgba(255, 255, 255, .04); }
.demo__recap-k { flex: none; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mist-2); }
.demo__recap-v { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; color: var(--white); }
.demo__recap .demo__link { flex: none; padding: 0 14px; }

/* Cases à cocher */
.demo__cb { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 4px 0; font-size: 14px; line-height: 1.5; color: var(--mist); cursor: pointer; }
.demo__cb input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--cyan); cursor: pointer; }
.demo__cb input[aria-invalid="true"] { outline: 2px solid var(--warn-on-dark); outline-offset: 2px; }
.demo__cb input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.demo__cb a { color: var(--cyan-light); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.demo__check .demo__err { margin-top: 2px; padding-left: 34px; }
.demo__hp { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip-path: inset(50%); pointer-events: none; }
.demo__send { display: flex; flex-direction: column; padding-top: 4px; }
.demo__note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--mist-2); }

/* ---------- Boutons ----------
   Texte sur fond cyan : navy (--on-cyan, décision du propriétaire, accessibilité d’abord : 6,65:1 au lieu de 2,77:1 en blanc) */
.demo__btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; margin: 0; padding: 12px 24px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--cyan); color: var(--on-cyan, #0B1424); font: 700 16px/1.3 var(--font-ui); text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; transition: background-color .3s, color .3s, border-color .3s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.demo__btn--light { background: var(--white); color: var(--navy); }
.demo__btn--ghost { border-color: rgba(255, 255, 255, .25); background: transparent; color: var(--white); }
.demo__btn.is-busy { background: var(--cyan); color: var(--on-cyan, #0B1424); cursor: progress; }
.demo__btn.is-busy::before { content: ""; flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: demo-spin .8s linear infinite; }
.demo__link { align-self: flex-start; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: var(--cyan-light); font: 700 14px/1.3 var(--font-ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.demo__actions { display: flex; flex-direction: column; gap: 10px; }
.demo__actions--row { flex-direction: row; flex-wrap: wrap; }
.demo__actions--row > .demo__btn { flex: 1 1 190px; width: auto; }

/* ---------- Fabrication ---------- */
.demo__steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.demo__step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 14px; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--white); opacity: .6; transition: opacity .4s; }
.demo__step.is-done, .demo__step.is-current { opacity: 1; }
.demo__step.is-current .demo__st { font-weight: 800; }
.demo__mk { position: relative; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: var(--white); font-size: 11px; font-weight: 800; transition: background-color .4s; }
.demo__mk svg { display: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.is-current .demo__mk { background: var(--cyan); color: var(--on-cyan, #0B1424); }
.is-current .demo__mk::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--cyan); border-radius: 50%; animation: demo-ping 1.6s var(--ease) infinite; }
.is-done .demo__mk { background: var(--success); }
.is-done .demo__mk svg { display: block; }
.is-done .demo__mk-n { display: none; }
.demo__ss { font-size: 12px; font-weight: 500; color: var(--mist-2); text-align: right; white-space: nowrap; }
.demo__bar { height: 2px; margin-top: 6px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.demo__bar-fill { display: block; height: 100%; background: var(--cyan); transform: scaleX(0); transform-origin: left center; transition: transform 1.2s var(--ease); }
.demo__note--run { margin: 0; font-size: 14px; color: var(--mist); overflow-wrap: anywhere; }

/* ---------- Fin : kit prêt, échec, envoi impossible ---------- */
.demo__ok { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; color: var(--white); }
.demo__ok-mk { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--success); }
.demo__ok-mk svg { width: 18px; height: 18px; fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.demo__facts { margin: 0; padding: 4px 18px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.demo__fact { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.demo__fact:last-child { border-bottom: 0; }
.demo__fact dt { font-size: 13px; color: var(--mist-2); }
.demo__fact dd { min-width: 0; margin: 0; font-size: 14px; font-weight: 700; color: #E6EBF0; text-align: right; overflow-wrap: anywhere; }
.demo__text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--mist); overflow-wrap: anywhere; }
.demo__text--strong { font-weight: 600; color: var(--white); }
.demo__text--small { font-size: 14px; line-height: 1.5; }
.demo__muted { font-size: 13px; color: var(--mist-2); white-space: nowrap; }
.demo__ptitle { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--white); }

.demo__sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Survols : seulement avec un pointeur qui survole (pas d’état collé après un toucher) */
@media (hover: hover) {
  .demo__close:hover { background: rgba(255, 255, 255, .18); }
  .demo__input:hover:not(:focus):not([aria-invalid="true"]) { border-color: rgba(255, 255, 255, .36); }
  .demo__cb a:hover, .demo__link:hover { color: var(--white); }
  .demo__btn:hover { background: var(--white); color: var(--navy); }
  .demo__btn--light:hover { background: var(--cyan); color: var(--on-cyan, #0B1424); }
  .demo__btn--ghost:hover { border-color: var(--white); background: transparent; color: var(--white); }
  .demo__btn.is-busy:hover { background: var(--cyan); color: var(--on-cyan, #0B1424); }
}

/* ---------- Mobile : plein écran, visuel en haut ---------- */
@media (max-width: 759.98px) {
  .demo { align-items: stretch; padding: 0; }
  .demo__sheet { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38vh minmax(0, 1fr); grid-template-rows: 38svh minmax(0, 1fr); height: 100%; border-radius: 0; box-shadow: none; }
  .demo__visual { order: 0; }
  .demo__body { --pad: 22px; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
  /* 38svh de haut ne laissent qu’une carte étroite au format 3:4 : elle s’élargit pour que ses mentions tiennent */
  .demo__poster { width: min(64vw, 280px); height: 84%; max-width: none; aspect-ratio: auto; border-radius: 18px; }
  .demo__pill { top: 10px; left: 10px; padding: 4px 9px 4px 8px; font-size: 11px; white-space: nowrap; }
  .demo__poster-meta { right: 12px; bottom: 12px; left: 12px; gap: 4px; }
  .demo__poster-k { font-size: 11px; letter-spacing: .08em; }
  .demo__poster-t { font-size: 26px; }
}
@media (max-width: 359.98px) {
  .demo__input { padding: 0 14px; }
}
/* Écran bas (téléphone à l’horizontale) : la carte prend toute la hauteur */
@media (min-width: 760px) and (max-height: 560px) {
  .demo { padding: 12px; }
  .demo__body { --pad: 24px; }
}

@keyframes demo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demo-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes demo-ping { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
@keyframes demo-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .demo__backdrop, .demo__sheet, .demo__panel--end, .demo__step, .demo__mk, .demo__bar-fill, .demo__input, .demo__btn, .demo__close { animation: none; transition: none; }
  .is-current .demo__mk::after { animation: none; opacity: 0; }
  .demo__btn.is-busy::before { animation: none; border-right-color: currentColor; opacity: .6; }
}
