/* Cleaneo — parcours de devis */

.devis-header-note { margin-left: auto; color: var(--muted); font-size: .92rem; font-weight: 500; }
@media (max-width: 520px) { .devis-header-note { display: none; } }

.devis {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-7);
  align-items: start;
  padding-block: var(--space-7) var(--space-8);
}
.devis-main { min-width: 0; }
@media (max-width: 960px) {
  .devis { grid-template-columns: 1fr; gap: var(--space-5); padding-block: var(--space-5) var(--space-7); }
  .devis-aside { order: 2; }
}

/* Progression */
.progress { height: 6px; background: var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 12%; background: var(--petrol); border-radius: inherit; transition: width .35s ease; }
.progress-label { margin-top: var(--space-2); font-size: .85rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Étapes */
.step { display: grid; gap: var(--space-4); padding-top: var(--space-5); }
.step-title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 700; }
.step-help { color: var(--muted); font-size: 1.05rem; max-width: 46em; }
.step-note { color: var(--muted); font-size: .92rem; }
.step-error { color: var(--danger); font-weight: 600; font-size: .95rem; }
.optional { font-weight: 500; font-size: .82em; color: var(--muted); margin-left: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .step:not([hidden]) { animation: step-in .32s ease both; }
}
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Cartes de choix */
.choices { display: grid; gap: var(--space-4); margin-top: var(--space-2); }
.choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .choices-3 { grid-template-columns: 1fr; }
  .choices-3 .choice-body { grid-template-columns: 96px 1fr; grid-template-rows: 1fr auto auto 1fr; justify-items: start; text-align: left; column-gap: var(--space-4); row-gap: 2px; padding: var(--space-3) 48px var(--space-3) var(--space-3); min-height: 96px; }
  .choices-3 .choice-illu, .choices-compact .choice-illu { grid-column: 1; grid-row: 1 / -1; height: 72px; align-self: center; }
  .choices-3 .choice-title { grid-column: 2; grid-row: 2; }
  .choices-3 .choice-hint { grid-column: 2; grid-row: 3; }
}
@media (max-width: 420px) {
  .choices-2 { gap: var(--space-3); }
  .choices-4 { grid-template-columns: 1fr; }
}

.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body {
  display: grid; gap: 6px; justify-items: center; text-align: center;
  height: 100%;
  padding: var(--space-4) var(--space-4) var(--space-5);
  background: var(--raised);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.choice:hover .choice-body { border-color: var(--line-strong); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--focus); outline-offset: 3px; }
.choice input:checked + .choice-body { border-color: var(--petrol); background: var(--glass-soft); }
.choice input:checked + .choice-body::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--amber) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A2629' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8.5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.choice-illu { display: block; width: 100%; height: 132px; }
.choice-illu svg { width: 100%; height: 100%; display: block; }
.choice-illu-pane { height: 110px; }
.choices-compact .choice-illu { height: 96px; }
.choice-title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--petrol); line-height: 1.2; }
.choice-hint { font-size: .9rem; color: var(--muted); line-height: 1.35; }
.choices-text .choice-body { justify-items: start; text-align: left; padding: var(--space-5); padding-right: 48px; }
@media (max-width: 420px) { .choice-illu { height: 104px; } .choice-title { font-size: 1.05rem; } }

/* Compteurs */
.counters { display: grid; border-top: 1px solid var(--line); }
.counter { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-4); border-bottom: 1px solid var(--line); }
.counter-text { display: grid; gap: 2px; min-width: 0; }
.counter-label { font-weight: 600; color: var(--ink); }
.counter-hint { font-size: .9rem; color: var(--muted); }
.counter-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.counter-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--raised); color: var(--petrol);
  font: 600 1.4rem/1 var(--font-body); cursor: pointer;
  display: grid; place-items: center;
}
.counter-btn:hover { border-color: var(--petrol); }
.counter-ctrl input {
  width: 56px; height: 44px; text-align: center;
  font: 700 1.25rem/1 var(--font-display); color: var(--petrol);
  border: 0; background: transparent; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.counter-ctrl input::-webkit-outer-spin-button, .counter-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.counter.has-value .counter-ctrl input { color: var(--ink); }

/* Groupes, segments, puces */
.field-group { border: 0; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: var(--space-3); min-width: 0; }
.field-group legend { font-weight: 700; color: var(--ink); margin-bottom: var(--space-3); padding: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.segmented label, .chip { position: relative; cursor: pointer; }
.segmented input, .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span, .chip span {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  background: var(--raised); color: var(--ink); font-weight: 500; font-size: .96rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.segmented label:hover span, .chip:hover span { border-color: var(--line-strong); }
.segmented input:checked + span, .chip input:checked + span { border-color: var(--petrol); background: var(--glass-soft); color: var(--petrol); font-weight: 600; }
.chip input:checked + span::before { content: ""; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2A93B' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.segmented input:focus-visible + span, .chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Champs */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.field-label { font-weight: 600; font-size: .95rem; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: 400 1rem/1.4 var(--font-body); color: var(--ink);
  background: var(--raised);
  border: 2px solid var(--line-strong); border-radius: var(--radius-sm);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-date { max-width: 240px; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: var(--space-3); align-items: start; font-size: .95rem; color: var(--muted); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--petrol); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Photos */
.photo-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); }
.photo-tips li { padding-left: 22px; position: relative; }
.photo-tips li::before { content: ""; position: absolute; left: 0; top: .6em; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.photo-tips strong { color: var(--ink); font-weight: 600; }
.dropzone {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: var(--space-6) var(--space-5);
  border: 2px dashed var(--line-strong); border-radius: var(--radius-md);
  background: var(--raised); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--petrol); background: var(--glass-soft); }
.dropzone:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.dropzone svg { width: 44px; height: 44px; color: var(--petrol); }
.dropzone-title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--petrol); }
.dropzone-hint { color: var(--muted); font-size: .92rem; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-3); }
.thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--glass-soft); border: 1px solid var(--line); aspect-ratio: 1; max-width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-remove {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(10, 38, 41, .78); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.thumb-remove svg { width: 16px; height: 16px; }
.thumb-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: .75rem; color: #fff; background: linear-gradient(transparent, rgba(10, 38, 41, .75)); font-variant-numeric: tabular-nums; }
.thumb.is-loading::after { content: "Préparation…"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; color: var(--muted); background: var(--glass-soft); }

/* Récapitulatif */
.recap { margin: 0; display: grid; border-top: 1px solid var(--line); }
.recap-row { display: grid; grid-template-columns: 180px 1fr auto; gap: var(--space-4); padding-block: var(--space-4); border-bottom: 1px solid var(--line); align-items: start; }
.recap-row dt { font-weight: 600; color: var(--muted); font-size: .92rem; }
.recap-row dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.recap-edit { background: none; border: 0; padding: 0; color: var(--petrol); font: 600 .9rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.recap-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.recap-thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
@media (max-width: 560px) {
  .recap-row { grid-template-columns: 1fr auto; }
  .recap-row dt { grid-column: 1; }
  .recap-row dd { grid-column: 1 / -1; grid-row: 2; }
  .recap-edit { grid-column: 2; grid-row: 1; }
}

/* Navigation */
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); }
.step-nav .btn-primary { margin-left: auto; min-width: 180px; }
.step-nav .btn-primary.is-sending { pointer-events: none; opacity: .8; }
@media (max-width: 560px) {
  .step-nav { position: sticky; bottom: 0; background: var(--surface); margin-inline: -16px; padding: var(--space-3) 16px calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); z-index: 5; }
  .step-nav .btn-primary { min-width: 0; flex: 1; }
}

/* Envoyé */
.step-done { justify-items: start; padding-top: var(--space-7); }
.done-mark svg { width: 72px; height: 72px; display: block; }

/* Résumé latéral */
.devis-aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 96px); display: grid; gap: var(--space-4); min-width: 0; }
.summary { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-5); box-shadow: var(--shadow-pane); }
.summary-title { font-size: 1.15rem; margin-bottom: var(--space-3); }
.summary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.summary-list li { display: grid; grid-template-columns: 1fr; gap: 2px; padding-block: 10px; border-top: 1px solid var(--line); }
.summary-list li:first-child { border-top: 0; padding-top: 0; }
.summary-k { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.summary-v { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.summary-empty { color: var(--muted); font-size: .95rem; }
.aside-note { font-size: .92rem; color: var(--muted); padding-inline: var(--space-2); }
@media (max-width: 960px) {
  .devis-aside { position: static; }
  .page-devis.is-done .devis-aside { display: none; }
}
.is-recap .devis-aside .summary { display: none; }

/* Questions ajoutées pour le calcul du devis */
.choices-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choices-5 .choice-body { padding: var(--space-4) var(--space-3); padding-right: var(--space-3); }
@media (max-width: 860px) { .choices-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .choices-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choices-4:not(.choices-text) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .choices-4:not(.choices-text) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-surface { max-width: 280px; }
.field-inline { margin-top: 0; }
.field-inline legend { margin-bottom: 6px; font-weight: 600; font-size: .95rem; }
.sub-question { display: grid; gap: var(--space-2); margin-top: var(--space-3); padding: var(--space-4); background: var(--glass-soft); border-radius: var(--radius-md); }
.estimate { padding: var(--space-5); border-radius: var(--radius-md); background: var(--glass-soft); border: 1px solid var(--line); display: grid; gap: 4px; }
.estimate strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--petrol); }
.estimate p { color: var(--muted); font-size: .92rem; }
