/* ===== SMA PRO — page de demande de devis (une question par écran) ===== */
.page-devis [hidden] { display: none !important; }
.dv-page { padding: 18px 0 70px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--blue-d); font-weight: 600; }
.crumbs span { margin: 0 6px; }

.dv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

/* ----- Carte formulaire ----- */
.dv-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 30px 60px -48px rgba(12,42,68,.5); }
.dv-head { text-align: center; }
.dv-head .pill { margin-bottom: 12px; }
.dv-head h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; letter-spacing: -.02em; }
.dv-head h1 em { color: var(--blue); }
.pill-green { background: #e9f8ef; border-color: #c6ebd3; color: #15803d; }
.pill-green::before { background: #16a34a; }
.dv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Progression : retour, compteur, barre */
.q-top { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-top: 22px; }
.q-back { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 8px; margin-left: -8px; border-radius: 10px;
  font-weight: 600; font-size: 14.5px; color: var(--blue-d); }
.q-back:hover { background: var(--blue-soft); }
.q-count { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.q-bar { height: 6px; border-radius: 999px; background: var(--alt); overflow: hidden; margin: 8px 0 26px; }
.q-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-d));
  transition: width .45s cubic-bezier(.4, 0, .2, 1); }

/* ----- Une question ----- */
.q { animation: q-in .35s cubic-bezier(.4, 0, .2, 1); }
@keyframes q-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.q-title { font: 800 clamp(21px, 2.6vw, 26px)/1.2 var(--head); color: var(--ink); outline: none; }
.q-hint { color: var(--muted); font-size: 15px; margin-top: 6px; }
.q-sub { font-weight: 700; color: var(--ink); margin: 22px 0 10px; }

/* Tuiles (choix unique) */
.tiles { display: grid; gap: 10px; margin-top: 18px; }
.tiles-2 { grid-template-columns: 1fr 1fr; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; cursor: pointer; display: block; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-box { position: relative; display: flex; align-items: center; gap: 14px; height: 100%; min-height: 62px; padding: 14px 44px 14px 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .18s, background .18s, box-shadow .18s, transform .18s; }
.tile:hover .tile-box { border-color: #9cc6e8; transform: translateY(-1px); box-shadow: 0 10px 22px -18px rgba(12,42,68,.5); }
.tile:active .tile-box { transform: scale(.985); }
.tile-box::after { content: ""; position: absolute; right: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  border: 2px solid #c7d3de; background: #fff center / 12px no-repeat; transition: all .18s; }
.tile input:checked + .tile-box { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(10,141,224,.14); }
.tile input:checked + .tile-box::after { border-color: var(--blue); background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.tile input:focus-visible + .tile-box { outline: 2px solid var(--blue-d); outline-offset: 2px; }
.tile-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--blue-soft); }
.tile-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--blue-d); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile input:checked + .tile-box .tile-ico { background: #fff; }
.tile-txt { line-height: 1.25; }
.tile-txt b { display: block; font-weight: 700; color: var(--ink); font-size: 15.5px; }
.tile-txt small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.tile-badge { margin-left: auto; flex: none; background: var(--blue); color: #fff; font: 800 11px/1 var(--head); text-transform: uppercase;
  letter-spacing: .04em; padding: 7px 10px; border-radius: 999px; }
.tile-star { grid-column: 1 / -1; }
.tile-star .tile-box { padding-top: 18px; padding-bottom: 18px; border-color: #9cc6e8; }
.tile-star .tile-ico { background: var(--blue); }
.tile-star .tile-ico svg { stroke: #fff; }
.tiles-2 > .tile:last-child:nth-child(even) { grid-column: 1 / -1; }
.tile-col .tile-box { flex-direction: column; text-align: center; justify-content: center; gap: 10px; padding: 20px 12px; }
.tile-col .tile-box::after { top: 12px; right: 12px; margin-top: 0; width: 20px; height: 20px; }

/* Pastilles (choix multiples) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.q-sub + .chips { margin-top: 0; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-weight: 600; font-size: 14.5px; color: var(--ink); transition: all .18s; }
.chip span::before { content: "+"; font-weight: 700; color: var(--blue-d); }
.chip:hover span { border-color: #9cc6e8; }
.chip input:checked + span { background: var(--blue-btn); border-color: var(--blue-btn); color: #fff; }
.chip input:checked + span::before { content: "✓"; color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--blue-d); outline-offset: 2px; }

.q-actions { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.q-skip { font-weight: 600; color: var(--muted); padding: 10px 6px; text-decoration: underline; text-underline-offset: 3px; }
.q-skip:hover { color: var(--ink); }

/* Champs texte */
.dv-input { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px;
  transition: border-color .2s, box-shadow .2s; }
.dv-input::placeholder { color: #9aa7b2; }
.dv-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,141,224,.15); }
textarea.dv-input { resize: vertical; min-height: 120px; margin-top: 18px; }

/* Récapitulatif cliquable */
.recap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.recap:empty { display: none; }
.recap-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--alt); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink); text-align: left; transition: border-color .2s, background .2s; }
.recap-item span { color: var(--muted); font-weight: 500; }
.recap-item span::after { content: " :"; }
.recap-item i { font-style: normal; color: var(--blue-d); margin-left: 2px; }
.recap-item:hover { border-color: var(--blue); background: var(--blue-soft); }

/* Coordonnées */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 22px; }
.field label { display: block; font-weight: 700; font-size: 14.5px; color: var(--ink); margin-bottom: 7px; }
.field .opt { font-weight: 500; font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.field-err { color: #b91c1c; font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.field-err:empty { display: none; }
.field.is-bad .dv-input { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--alt); }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--muted); transition: all .18s; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -2px rgba(12,42,68,.25); }
.seg input:focus-visible + span { outline: 2px solid var(--blue-d); outline-offset: 1px; }

.q-send { width: 100%; margin-top: 26px; min-height: 58px; font-size: 16.5px; }
.q-legal { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.q-legal a { color: var(--blue-d); text-decoration: underline; }
.btn-cta.is-loading { opacity: .75; pointer-events: none; }
.btn-cta.is-loading .cta-arrow { animation: dv-go .7s ease-in-out infinite; }
@keyframes dv-go { 50% { transform: translateX(5px); } }
.btn-soft { background: var(--alt); color: var(--ink); border-radius: 999px; }
.btn-soft:hover { background: var(--line); }

/* ----- Résultat ----- */
.dv-result { text-align: center; padding: 30px 0 10px; animation: q-in .4s ease; }
.dv-result h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 900; margin: 18px 0 10px; }
.dv-result p { color: var(--muted); font-size: 17px; max-width: 44ch; margin: 0 auto; }
.dv-result-ico { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; }
.dv-result-ico svg { width: 38px; height: 38px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dv-result-ico.ok { background: #16a34a; box-shadow: 0 0 0 10px #e9f8ef; }
.dv-result-ico.ko { background: #f59e0b; box-shadow: 0 0 0 10px #fef3c7; }
.dv-result-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

/* ----- Encadré contact ----- */
.dv-aside { display: grid; gap: 16px; position: sticky; top: 90px; }
.dv-box { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.dv-box h2 { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.dv-contact { display: grid; gap: 14px; }
.dv-contact li { display: flex; gap: 12px; align-items: center; }
.dv-contact b { display: block; font-size: 14px; color: var(--ink); }
.dv-contact .todo { font-size: 14px; }
.dv-ci { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--blue-soft); }
.dv-ci svg { width: 19px; height: 19px; fill: none; stroke: var(--blue-d); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dv-why { display: grid; gap: 10px; }
.dv-why li { position: relative; padding-left: 28px; font-weight: 600; font-size: 15px; color: var(--ink); }
.dv-why li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #16a34a
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 11px no-repeat; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .dv-layout { grid-template-columns: 1fr; }
  .dv-aside { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .dv-page { padding-top: 10px; }
  .crumbs { display: none; }
  .dv-card { border-radius: 20px; }
  .dv-head .pill { margin-bottom: 8px; }
  .q-top { margin-top: 14px; }
  .q-bar { margin-bottom: 20px; }
  .dv-aside { grid-template-columns: 1fr; }
  .tiles-2:not(.tiles-keep) { grid-template-columns: 1fr; }
  .tiles-3 { grid-template-columns: 1fr; }
  .tile-col .tile-box { flex-direction: row; text-align: left; justify-content: flex-start; padding: 14px 44px 14px 16px; }
  .tile-col .tile-box::after { top: 50%; right: 14px; margin-top: -10px; }
  .tile-box { min-height: 58px; }
  .fields { grid-template-columns: 1fr; }
  .seg { display: flex; }
  .seg label { flex: 1; text-align: center; }
  .seg span { padding: 10px 6px; }
  .dv-result-btns .btn { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .tiles-keep .tile-box { padding: 12px 34px 12px 12px; min-height: 64px; }
  .tiles-keep .tile-box::after { right: 10px; width: 18px; height: 18px; margin-top: -9px; }
  .tiles-keep .tile-txt b { font-size: 14.5px; }
  .tiles-keep .tile-txt small { font-size: 12.5px; }
}
@media (max-width: 640px) {
  .tile-star .tile-badge { position: absolute; top: -10px; right: 14px; box-shadow: 0 0 0 3px #fff; }
}

/* ----- Choix de plusieurs services ----- */
.tiles-multi .tile-box::after { border-radius: 7px; }
.q-nb { font-weight: 800; }
.q-nb:empty { display: none; }
.q-tag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 5px 11px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue-d); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.q-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
/* Le bouton « Continuer » reste à portée de pouce pendant qu'on coche */
.q-sticky { position: sticky; bottom: 0; z-index: 5; margin: 18px -4px 0; padding: 14px 4px 4px;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0)); }
.q-sticky .btn { width: 100%; }
@media (min-width: 641px) { .q-sticky { position: static; background: none; } .q-sticky .btn { width: auto; } }
@media (max-width: 640px) { .q-sticky { padding-bottom: calc(10px + env(safe-area-inset-bottom)); } }

/* « Autre… » avec texte libre */
.chip-other span::before { content: "✎"; }
.other-input { margin-top: 12px; animation: q-in .25s ease; }
