/* ==========================================================================
   Habitat Signature — Simulateur salle de bain
   Design aligné sur le site www.simulation-projet.com : fond blanc, détails
   bruns premium, dégradé brun sur les mots importants (.g, comme
   « Pas votre budget. »), boutons en dégradé, DM Sans.
   Structure compacte reprise de Ma Pergola Idéale : chaque écran tient dans
   la hauteur de la fenêtre, deux blocs par ligne sur mobile.
   ========================================================================== */

:root {
  /* Couleurs relevées sur le site */
  --ink: #2E2420;
  --ink-soft: #5A4A40;
  --muted: #998B80;
  --faint: #B7AAA0;
  --line: #E9DFD6;
  --line-soft: #F1EAE3;
  --brown: #886044;
  --brown-deep: #674531;
  --brown-mid: #8E6546;
  --eyebrow: #765139;
  --sand: #C39973;
  --sel-bg: #FFFFFF;
  --tint: #F7F3EF;
  --ok: #4F7A55;
  --error: #B3261E;
  --error-bg: #FDF3F1;

  --grad-text: linear-gradient(100deg, #4D3428, #98704F 48%, #B99672 78%, #66442E);
  --grad-btn: linear-gradient(120deg, #674531, #8E6546);
  --grad-bar: linear-gradient(90deg, #6C4635, #C39973);

  --shadow-cta: 0 9px 25px rgba(95, 59, 36, .17);
  --shadow-cta-h: 0 12px 32px rgba(95, 59, 36, .26);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, .04);
  --shadow-sel: 0 6px 20px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .07);

  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
a { color: var(--brown); }
::selection { background: rgba(195, 153, 115, .3); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(195, 153, 115, .7); outline-offset: 3px; }
h1:focus, h1:focus-visible { outline: none; }

/* Mot important : dégradé brun du site */
.g {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* --- Structure ---------------------------------------------------------- */

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #fff; /* fond blanc pur, demandé par le client */
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 5vh, 52px) 0 24px;
  display: flex;
  flex-direction: column;
  animation: fadeUp .3s var(--ease) both;
}
.screen--wide .main { max-width: 1080px; }
.main--narrow { max-width: 600px; }
.main--center { text-align: center; }
.main--card { max-width: 480px; padding-top: clamp(14px, 3.4vh, 40px); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- En-tête + progression --------------------------------------------- */

.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 14px;
}
.logo { display: inline-flex; flex: none; }
.logo img { height: 44px; width: auto; }

.hdr__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.hdr__badge svg { color: var(--brown); }
.hdr__step { display: none; font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }

.steprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 9px;
}
.eyebrow {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--eyebrow);
}
.steprow__n { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }

.progress {
  height: 5px;
  border-radius: 99px;
  background: var(--line-soft);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--grad-bar);
  transition: width .5s var(--ease);
}

/* --- Titres ------------------------------------------------------------- */

.q-head { text-align: center; margin-bottom: clamp(16px, 2.8vh, 26px); }
.q-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.035em;
  color: var(--ink);
  text-wrap: balance;
}
.q-sub {
  margin: 8px 0 0;
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--muted);
}

/* --- Indicateurs radio / case ------------------------------------------- */

.ind {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border: 2px solid #D9CCC0;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.ind--radio { border-radius: 50%; }
.ind--radio::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .15s var(--ease);
}
.ind--box { border-radius: 6px; color: #fff; }
.ind--box svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); transition: .15s var(--ease); }

input:checked ~ .ind--radio,
input:checked ~ * .ind--radio { border-color: var(--brown); background: var(--brown); }
input:checked ~ .ind--radio::after,
input:checked ~ * .ind--radio::after { transform: scale(1); }
input:checked ~ .ind--box { border-color: var(--brown); background: var(--grad-btn); }
input:checked ~ .ind--box svg { opacity: 1; transform: none; }

/* --- Écran 1 : cartes avant / après ------------------------------------- */

.pgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0; padding: 0; border: 0; min-width: 0;
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border-radius: 13px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s var(--ease), background .18s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .pcard:hover { border-color: #D7C6B7; transform: translateY(-2px); box-shadow: var(--shadow-sel); }
}
.pcard:has(input:checked) {
  border-color: var(--brown);
  background: var(--sel-bg);
  box-shadow: 0 0 0 1px var(--brown), var(--shadow-sel);
}
.pcard:has(input:focus-visible) { outline: 3px solid rgba(195, 153, 115, .7); outline-offset: 3px; }

/* Écran 1 sur ordinateur : 2 cartes par ligne. La largeur de la grille suit
   la hauteur de la fenêtre pour que les deux rangées tiennent sans défiler. */
@media (min-width: 981px) {
  .pgrid:not(.pgrid--style) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: clamp(480px, calc(170vh - 700px), 800px);
    max-width: clamp(480px, calc(170dvh - 700px), 800px);
    margin: 0 auto;
  }
  /* Une seule rangée : la place permet des cartes plus grandes */
  .pgrid.pgrid--one { max-width: 820px; }
}

/* Photos fournies : projets ≈ 17:10, ambiances ≈ 5:4 — recadrage centré léger. */
.pcard__media {
  position: relative;
  aspect-ratio: 17 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--tint);
}
.pcard__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
@media (hover: hover) {
  .pcard:hover .pcard__media img { transform: scale(1.04); }
}
.pgrid--style .pcard__media { aspect-ratio: 5 / 4; }

/* « Je souhaite être conseillé(e) » : carte sans photo, sur toute la ligne */
.pgrid > .opt--wide { grid-column: 1 / -1; min-height: 58px; }

.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 11px 8px 8px;
}
.pcard__label { font-size: 15px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }

.reassure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.reassure svg { color: var(--brown); }

/* --- Options (détails, dimensions, ambiance, budget, logement) --------- */

.ogrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto; padding: 0; border: 0; min-width: 0;
}
/* Nombre impair : la dernière réponse (souvent « Je ne sais pas » ou
   « conseillé(e) ») occupe toute la ligne. */
.ogrid > label.opt:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 12px 16px 12px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .opt:hover { border-color: #D7C6B7; box-shadow: var(--shadow-sel); transform: translateY(-1px); }
}
.opt:active { transform: scale(.99); }
.opt:has(input:checked) {
  border-color: var(--brown);
  background: var(--sel-bg);
  box-shadow: 0 0 0 1px var(--brown), var(--shadow-sel);
}
.opt:has(input:focus-visible) { outline: 3px solid rgba(195, 153, 115, .7); outline-offset: 3px; }

.opt__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--tint);
  color: var(--brown);
  transition: background .16s, color .16s;
}
.opt__icon svg { width: 22px; height: 22px; }
.opt:has(input:checked) .opt__icon { background: var(--grad-btn); color: #fff; }

.opt__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.opt__label { font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.opt:has(input:checked) .opt__label,
.pcard:has(input:checked) .pcard__label { color: var(--brown-deep); }
.opt__desc { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* Ambiance : nuancier */
.opt__swatches {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, 17px);
  grid-template-rows: repeat(2, 17px);
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.opt__swatches i { display: block; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }

.switch { margin: 14px 0 0; text-align: center; }

/* --- Erreurs ------------------------------------------------------------ */

.form-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
}
.form-error:empty { display: none; }
.form-error svg { flex: none; }
.card .form-error { justify-content: flex-start; }
.has-error .opt, .has-error .pcard { border-color: #E5BDB6; }

/* --- Navigation & boutons ----------------------------------------------- */

.nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}
.nav--cta { margin-top: 20px; }
.nav--cta .btn--primary { min-width: 260px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .18s, transform .18s var(--ease), filter .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { cursor: progress; opacity: .85; }

.btn--primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
@media (hover: hover) {
  .btn--primary:hover:not([disabled]) { box-shadow: var(--shadow-cta-h); filter: brightness(1.06); transform: translateY(-1px); }
}
.btn--block { width: 100%; margin-top: clamp(18px, 5.2vh, 46px); }

.btn--link {
  min-height: 40px;
  padding: 0 8px;
  background: none;
  color: var(--brown);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(136, 96, 68, .35);
}
.btn--link:hover { text-decoration-color: currentColor; }
.btn--link[disabled] { color: var(--faint); text-decoration: none; cursor: default; opacity: 1; }
.btn--back { color: var(--muted); font-weight: 600; text-decoration: none; }
.btn--back:hover { color: var(--brown); }

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Analyse ------------------------------------------------------------ */

.main--sim { max-width: 900px; justify-content: center; }
.sim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
}
.sim__visual {
  position: relative;
  border-radius: 17px;
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.sim__visual img { width: 100%; height: auto; aspect-ratio: 17 / 10; object-fit: cover; }
.sim__scan {
  position: absolute;
  inset: 0 auto 0 0;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 238, .55), transparent);
  animation: scan 1.9s var(--ease) infinite;
}
@keyframes scan { from { transform: translateX(-110%); } to { transform: translateX(380%); } }
.sim__body .q-title { text-align: left; }

.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--faint);
  font-size: 14.5px;
  font-weight: 700;
  transition: color .2s, border-color .2s, background .2s;
}
.step[data-state='busy'] { color: var(--ink); border-color: #D7C6B7; }
.step[data-state='done'] { color: var(--ink); background: var(--sel-bg); border-color: #E3D3C5; }
.step__slot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; }
.step__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.step[data-state='busy'] .step__dot {
  width: 20px; height: 20px;
  background: none;
  border: 2.5px solid var(--line);
  border-top-color: var(--brown);
  animation: spin .8s linear infinite;
}
.step__done {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--grad-btn);
  color: #fff;
  animation: pop .25s var(--ease);
}
.step__done svg { width: 13px; height: 13px; }
@keyframes pop { from { transform: scale(.5); } to { transform: scale(1); } }

/* --- Écrans coordonnées (carte) ----------------------------------------- */

.main--card { justify-content: flex-start; }
/* Écrans de coordonnées : pas de cadre (effet « pop-up » évité), contenu
   posé sur la page et aéré. Les espacements suivent la hauteur de l'écran
   pour occuper la page sans jamais la faire défiler. */
.card { position: relative; }

.chip-project {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 12px 6px 6px;
  margin: 0 0 clamp(18px, 5vh, 44px);
  border-radius: 12px;
  background: var(--sel-bg);
  border: 1px solid var(--line-soft);
}
.chip-project__img {
  flex: none;
  width: 58px;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tint);
}
.chip-project__img img { width: 100%; height: 100%; object-fit: cover; }
.chip-project__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.chip-project__k { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--eyebrow); }
.chip-project__v { font-size: 14px; font-weight: 700; color: var(--ink); }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--ok);
  font-size: 13.5px;
  font-weight: 700;
}
.kicker__dot {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
}
.kicker__dot svg { width: 11px; height: 11px; }

.card__title {
  margin: 0;
  font-size: clamp(23px, 2.6vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.card__lede { margin: clamp(6px, 1.5vh, 14px) 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.card__lede strong { color: var(--ink); }

.fields { display: grid; gap: 2px; }
.field { margin-top: clamp(16px, 4.4vh, 40px); }
.fields .field { margin-top: clamp(12px, 3.4vh, 30px); }
.field__label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.field__box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 15px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  transition: border-color .15s, box-shadow .15s;
}
.field__box:focus-within { border-color: var(--brown); box-shadow: 0 0 0 4px rgba(136, 96, 68, .12); }
.field__icon { flex: none; display: grid; color: var(--sand); }
.field__prefix {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink-soft);
}
.field__box input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16.5px; /* ≥ 16 px : pas de zoom automatique sur iOS */
  font-weight: 600;
}
.field__box input::placeholder { color: #BDB0A5; font-weight: 500; }
.field__hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.field__err { margin: 6px 0 0; font-size: 13.5px; font-weight: 600; color: var(--error); }
.field__err:empty { display: none; }
.field--invalid .field__box { border-color: var(--error); background: var(--error-bg); }

/* Autocomplétion commune */
.ac { position: relative; }
.ac__list {
  position: absolute;
  z-index: 10;
  left: 0; right: 0;
  margin-top: 6px;
  padding: 5px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  max-height: 264px;
  overflow-y: auto;
}
.ac__list[hidden] { display: none; }
.ac__item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.ac__item:hover, .ac__item[aria-selected='true'] { background: var(--sel-bg); }
.ac__city { font-weight: 700; }
.ac__cp { color: var(--muted); font-variant-numeric: tabular-nums; }

.area-note, .panel {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--sel-bg);
  border: 1px solid var(--line-soft);
  color: var(--eyebrow);
  font-size: 13.5px;
}
.panel { text-align: center; }

/* Consentement */
.consent-wrap { margin-top: clamp(14px, 3.8vh, 34px); }
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--sel-bg);
  border: 1px solid var(--line-soft);
  cursor: pointer;
}
.consent .ind { margin-top: 1px; }
.consent:has(input:focus-visible) { outline: 3px solid rgba(195, 153, 115, .7); outline-offset: 2px; }
.consent__txt { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.consent__txt a { font-weight: 700; }
.field--invalid .consent { border-color: var(--error); background: var(--error-bg); }

/* Code SMS */
.code { display: flex; justify-content: center; gap: 12px; margin-top: clamp(18px, 3.6vh, 34px); }
.code input {
  width: 58px; height: 64px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.code input:focus { border-color: var(--brown); box-shadow: 0 0 0 4px rgba(136, 96, 68, .12); }
.code input[data-filled='1'] { background: var(--sel-bg); border-color: #D7C6B7; }
.code--error input { border-color: var(--error); background: var(--error-bg); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.code-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; margin-top: 8px; }
.card > .btn--link { display: flex; margin: clamp(6px, 1.6vh, 16px) auto 0; }

.secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: clamp(8px, 2.6vh, 24px) 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* --- Confirmation ------------------------------------------------------- */

.seal {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 0 0 8px #F6EEE7, var(--shadow-cta);
  animation: pop .35s var(--ease);
}
.seal svg { width: 28px; height: 28px; }

.recap {
  margin: 20px 0 0;
  padding: 6px 18px 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: left;
}
.recap__t {
  margin: 10px 0 2px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--eyebrow);
}
.recap dl { margin: 0; }
.recap__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.recap__row:first-child { border-top: 0; }
.recap dt { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.recap dd { margin: 0; font-weight: 700; font-size: 13.5px; text-align: right; }

.signature { margin: 16px 0 0; color: var(--ink-soft); font-size: 14px; }
.end-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; }

/* --- Tablette ----------------------------------------------------------- */

@media (max-width: 980px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; margin: 0 auto; }
  /* Légende toujours haute de 2 lignes : une légende sur 1 ou 2 lignes ne
     change plus la taille de la photo d'une carte à l'autre. */
  .pcard__foot { min-height: 58px; }
  /* Ambiances : on garde une seule rangée de photos tant que la largeur le
     permet, sinon l'écran dépasse la hauteur d'une tablette. */
  .pgrid--style { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 100%; }
}
@media (max-width: 700px) {
  .pgrid--style { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .sim { grid-template-columns: 1fr; gap: 18px; }
  .sim__visual { max-width: 340px; width: 100%; margin: 0 auto; }
  .sim__body .q-title { text-align: center; }
}

/* --- Mobile : 2 blocs par ligne, écran sans défilement ------------------
   Les écrans de questions occupent exactement la hauteur de l'écran : les
   blocs de réponse s'étirent pour remplir l'espace disponible (aussi grands
   que possible) sans jamais provoquer de défilement. */

@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  /* En-tête mobile : une seule ligne, logo à gauche, étape à droite. */
  .hdr { padding: 12px 0 12px; align-items: center; }
  .logo img { height: 38px; }
  .hdr__badge, .steprow { display: none; }
  .hdr__step { display: block; font-size: 14px; line-height: 1; }

  .main { padding: 18px 0 16px; }
  .main--card { padding-top: clamp(14px, 3.4vh, 36px); }
  .q-head { margin-bottom: 16px; }
  .q-title { font-size: 27px; }
  .q-sub { font-size: 15px; margin-top: 6px; }

  /* Hauteur d'écran fixe sur les questions : la grille prend le reste */
  .screen--q .shell { height: 100vh; height: 100dvh; min-height: 0; }
  .screen--q .main { flex: 1 1 auto; min-height: 0; }
  .screen--q .ogrid,
  .screen--q .pgrid { flex: 1 1 auto; min-height: 0; align-content: stretch; }

  /* Réponses texte : tuiles centrées, étirées */
  .ogrid {
    gap: 10px;
    grid-template-rows: repeat(var(--rows), minmax(0, 1fr));
    max-height: calc(var(--rows) * 170px);
  }
  .ogrid--odd {
    grid-template-rows: repeat(var(--rows), minmax(0, 1fr)) auto;
    max-height: calc(var(--rows) * 170px + 80px);
  }
  .opt {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    min-height: 0;
    padding: 12px 10px;
    border-radius: 14px;
  }
  .opt__icon { width: 48px; height: 48px; border-radius: 12px; }
  .opt__icon svg { width: 26px; height: 26px; }
  .opt__body { flex: 0 0 auto; align-items: center; }
  .opt__label { font-size: 16px; line-height: 1.25; }
  .opt__desc { font-size: 12.5px; }

  /* Dernière réponse (nombre impair) : en ligne, sur toute la largeur */
  .pgrid > .opt--wide,
  .ogrid > label.opt:last-of-type:nth-of-type(odd) {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    min-height: 60px;
    padding: 10px 14px;
  }
  .pgrid > .opt--wide .opt__icon,
  .ogrid > label.opt:last-of-type:nth-of-type(odd) .opt__icon { width: 40px; height: 40px; }
  .pgrid > .opt--wide .opt__icon svg,
  .ogrid > label.opt:last-of-type:nth-of-type(odd) .opt__icon svg { width: 22px; height: 22px; }
  .pgrid > .opt--wide .opt__body,
  .ogrid > label.opt:last-of-type:nth-of-type(odd) .opt__body { align-items: flex-start; }

  /* Cartes photo : la photo remplit toute la hauteur disponible */
  .pgrid {
    gap: 10px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    max-height: 560px;
  }
  .pgrid--style {
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto;
    max-height: 640px;
  }
  /* Une seule rangée de photos (ex. baignoire : moderniser / douche) */
  .pgrid--one { grid-template-rows: minmax(0, 1fr); max-height: 380px; }
  .pcard { padding: 4px; border-radius: 14px; min-height: 0; }
  .pcard__media,
  .pgrid--style .pcard__media { aspect-ratio: auto; flex: 1 1 auto; min-height: 0; border-radius: 10px; }
  .pcard__foot { padding: 8px 6px; min-height: 58px; }
  .pcard__label { font-size: 15.5px; }
  .reassure { margin-top: 14px; font-size: 13.5px; }

  .nav { margin-top: 10px; }
  .nav--cta { margin-top: 14px; }
  .nav--cta .btn--primary { width: 100%; min-width: 0; min-height: 54px; font-size: 16.5px; }
  .switch { margin-top: 8px; }
  .btn--link { font-size: 15px; }

  /* Écrans coordonnées */
  .chip-project__v { font-size: 15px; }
  .card__title { font-size: 25px; }
  .card__lede { font-size: 15.5px; }
  .field__label { font-size: 14.5px; }
  .field__box { min-height: 56px; }
  .field__box input { height: 52px; font-size: 18px; }
  .consent__txt { font-size: 13.5px; }
  .btn--block { min-height: 56px; font-size: 16.5px; }

  .code { gap: 10px; }
  .code input { width: 60px; height: 66px; font-size: 27px; }

  .seal { width: 54px; height: 54px; margin-bottom: 10px; }
  .recap { padding: 4px 14px 6px; margin-top: 14px; }
  .recap__row { padding: 8px 0; }
  .recap dt, .recap dd { font-size: 14px; }
  .recap dt { white-space: normal; }
}

/* Téléphones peu hauts (iPhone SE / 8) : en-tête et textes resserrés, les
   blocs se réduisent d'eux-mêmes pour rester sans défilement. */
@media (max-width: 640px) and (max-height: 720px) {
  .hdr { padding: 8px 0 7px; }
  .logo img { height: 32px; }
  .main { padding-top: 12px; padding-bottom: 10px; }
  .main--card { padding-top: clamp(12px, 3vh, 28px); }
  .q-head { margin-bottom: 12px; }
  .q-title { font-size: 24px; }
  .q-sub { font-size: 14px; margin-top: 4px; }
  .ogrid, .pgrid { gap: 8px; }
  .opt { gap: 7px; padding: 9px 8px; }
  .opt__icon { width: 40px; height: 40px; }
  .opt__icon svg { width: 22px; height: 22px; }
  .opt__label { font-size: 15px; }
  .pgrid > .opt--wide,
  .ogrid > label.opt:last-of-type:nth-of-type(odd) { min-height: 52px; padding: 8px 12px; }
  .reassure { margin-top: 10px; }
  .nav { margin-top: 6px; }
  .nav--cta { margin-top: 10px; }
  .nav--cta .btn--primary { min-height: 50px; }
  .btn--link { min-height: 36px; }
  .chip-project { padding: 4px 10px 4px 4px; }
  .chip-project__img { width: 48px; }
  .card__title { font-size: 23px; }
  .card__lede { font-size: 14.5px; }
  .field__box { min-height: 50px; }
  .field__box input { height: 46px; }
  .consent { padding: 9px 10px; }
  .consent__txt { font-size: 12.5px; }
  .btn--block { min-height: 50px; }
}

/* Très petits écrans (iPhone SE 1re génération) : on retire le superflu. */
@media (max-width: 640px) and (max-height: 620px) {
  .chip-project, .secure, .field__hint, .card__lede { display: none; }
  .hdr__badge { display: none; }
  .card__title { font-size: 21px; }
  .field__label { margin-bottom: 4px; font-size: 13.5px; }
  .consent__txt { font-size: 12px; line-height: 1.35; }
  .card > .btn--link { min-height: 32px; }
  .sim__visual { max-width: 230px; }
  .steps { margin-top: 12px; gap: 7px; }
  .step { padding: 9px 12px; font-size: 13.5px; }
}

@media (max-width: 400px) {
  .btn--block { padding: 0 12px; font-size: 14.5px; }
  .btn--block > svg { display: none; }
}

@media (max-width: 350px) {
  .eyebrow { font-size: 11px; letter-spacing: .06em; }
  .steprow__n { font-size: 11.5px; }
  .hdr__badge span { display: none; }
  .logo img { height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
