/* Sur téléphone, le simulateur garde toute la place de l'en-tête. */
@media (max-width: 799px) {
  body[data-page="simulateur"] .header-cta { display: none; }
  body[data-page="simulateur"] .menu-toggle { margin-inline-start: auto; }
}
.sim-page { padding-bottom: 64px; min-height: 75vh; }

/* Progression */
.progress { padding-block: 22px 18px; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted-dark); font-size: 15px; }
.progress-top strong { color: var(--red-light); }
.progress-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--line); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--red-dark), var(--red-light)); transform-origin: left; transform: scaleX(0); transition: transform .45s ease; }
.step-nav { display: none; }

/* Panneau */
.panel { display: flex; flex-direction: column; min-width: 0; border-radius: 8px; background: var(--paper); color: var(--ink); }
.step { flex: 1; min-width: 0; padding: 26px 18px 32px; }
.step.enter-next { animation: enter-next .32s ease; }
.step.enter-prev { animation: enter-prev .32s ease; }
@keyframes enter-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes enter-prev { from { opacity: 0; transform: translateX(-18px); } }
.step h1 { font-size: clamp(23px, 3.3vw, 34px); margin-bottom: 10px; }
.step h1:focus { outline: none; }
.hint { max-width: 62ch; margin-bottom: 26px; color: var(--muted); }
.note { margin-top: 18px; color: var(--muted); font-size: 15px; }

/* Cartes de choix */
.choice { position: relative; min-width: 0; padding: 0; overflow: hidden; border: 2px solid var(--line-light); border-radius: 8px; background: #fff; text-align: start; transition: border-color .2s, background .2s; }
.choice:hover { border-color: var(--navy-soft); }
.choice[aria-pressed="true"] { border-color: var(--red); background: var(--red-tint); }
.site-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-card { display: flex; flex-direction: column; }
.site-card .scene { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s var(--ease); }
.choice-body { padding: 11px 12px 14px; line-height: 1.3; }
.choice-body strong { display: block; }
.choice-body small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.yes-no { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.yes-no .choice { padding: 20px 16px; }
.yes-no strong { display: block; font: 700 26px var(--display); }
.yes-no span { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.35; }

/* Compteurs */
.round { display: grid; place-items: center; width: 56px; height: 56px; flex: none; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font-size: 28px; line-height: 1; touch-action: manipulation; }
.round:hover:not(:disabled) { background: var(--red-tint); }
.round:disabled { opacity: .3; cursor: default; }
.count { display: flex; align-items: center; justify-content: center; gap: 18px; padding-block: 12px 24px; }
.count-value { width: 140px; text-align: center; }
.count-value input { width: 100%; padding: 0; border: 0; background: none; font: 800 72px/1.1 var(--display); text-align: center; -moz-appearance: textfield; appearance: textfield; }
.count-value input::-webkit-inner-spin-button { -webkit-appearance: none; }
.count-value span { color: var(--muted); }
.range { width: 100%; height: 44px; margin: 0; accent-color: var(--red); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { min-width: 50px; min-height: 44px; padding: 8px 15px; border: 1px solid #AEB7C5; border-radius: 4px; background: #fff; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

.split-row { display: flex; align-items: center; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line-light); }
.split-row .round { width: 46px; height: 46px; }
.split-name { flex: 1; min-width: 0; line-height: 1.25; }
.split-name strong { display: flex; align-items: center; gap: 8px; }
.split-name small { display: block; margin-top: 3px; color: var(--muted); }
.split-row output { width: 38px; font: 700 27px var(--display); text-align: center; }
.split-bar { display: flex; height: 16px; margin-top: 28px; overflow: hidden; border-radius: 3px; background: var(--red); }
.split-bar i { background: var(--night); transition: width .2s; }
.legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 14px; }
.sum { margin-top: 12px; font-weight: 600; }

/* Résolution */
.apply-grid { display: grid; gap: 10px; }
.apply { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px; }
.apply strong { font: 700 22px var(--display); }
.apply .gamme { font-weight: 600; }
.apply small { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.apply em { grid-column: 1 / -1; margin-top: 6px; color: var(--red); font: 600 15px var(--body); text-decoration: underline; }
.popular { align-self: center; padding: 3px 9px; border-radius: 3px; color: #fff; background: var(--red); font-size: 12px; font-weight: 700; }
.camera-group { margin-top: 28px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.group-head h2 { font-size: 22px; }
.group-all { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.group-all button { min-height: 40px; padding: 5px 11px; border: 1px solid #AEB7C5; border-radius: 4px; background: #fff; }
.camera-list { max-height: 430px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.camera-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 3px; border-bottom: 1px solid var(--line-light); }
.camera-row > span { font-size: 15px; }
.segments { display: flex; gap: 5px; flex: none; }
.segments button { min-width: 54px; min-height: 44px; padding: 5px 7px; border: 1px solid #AEB7C5; border-radius: 4px; background: #fff; font-size: 14px; white-space: nowrap; }
.segments button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Stockage et wilaya */
.reveal { margin-top: 28px; animation: enter-next .3s ease; }
.reveal h2, .field-title { margin-bottom: 12px; font-size: 22px; }
.durations { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
.capacity { margin-top: 18px; padding: 15px; border-radius: 6px; background: var(--night); color: #F3F5F8; }
.capacity strong { color: var(--red-light); }
.combo summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 12px 15px; border: 2px solid #AEB7C5; border-radius: 6px; background: #fff; font-weight: 600; cursor: pointer; list-style: none; }
.combo summary::-webkit-details-marker { display: none; }
.combo summary .icon { transform: rotate(90deg); }
.combo[open] summary { border-color: var(--red); }
.combo[open] summary .icon { transform: rotate(-90deg); }
.combo-panel { margin-top: 6px; overflow: hidden; border: 1px solid #AEB7C5; border-radius: 6px; background: #fff; }
.combo-search { display: flex; align-items: center; gap: 10px; padding-inline-start: 14px; border-bottom: 1px solid var(--line-light); }
.combo-search input { width: 100%; min-width: 0; height: 52px; padding: 0 10px; border: 0; background: none; font-size: 16px; }
.combo-search input:focus-visible { outline-offset: -3px; }
.wilaya-list { max-height: 280px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.wilaya-list button { display: flex; gap: 14px; width: 100%; min-height: 48px; align-items: center; padding: 8px 15px; border: 0; background: none; text-align: start; }
.wilaya-list button:hover, .wilaya-list button[aria-pressed="true"] { background: var(--red-tint); }
.wilaya-list button:focus-visible { outline-offset: -3px; }
.wilaya-list b { width: 24px; color: var(--red); }
.empty { padding: 15px; color: var(--muted); }

/* Numéro de commande */
.numero-commande { display: grid; gap: 6px; padding: 14px; border: 2px solid var(--red-light); border-radius: 6px; }
.numero-commande span { color: var(--muted-dark); }
.numero-commande strong { color: #fff; font: 800 24px/1.2 var(--display); letter-spacing: .5px; overflow-wrap: anywhere; }
.numero-commande p { margin: 0; }
.numero-commande .btn { min-height: 44px; }

/* Enregistrement de la demande */
.accord .consent { cursor: pointer; color: var(--ink); }
.accord input[aria-invalid="true"] { outline: 2px solid #A32626; outline-offset: 2px; }
.send .depot { padding: 10px 12px; border-radius: 4px; }
.send .depot-ok { background: #D5F3DF; color: #11592B; }
.send .depot-non { border: 1px solid var(--red-light); color: #fff; }
.controls .next:disabled { opacity: .65; cursor: progress; }

/* Métrage du câble */
.cable-field { max-width: 460px; }
.field .cable-input { display: flex; align-items: center; gap: 12px; }
.field .cable-input input { max-width: 220px; font: 700 24px var(--display); }
.cable-input span { color: var(--muted); }
.capacity { line-height: 1.6; }

/* Formulaire */
.fields { display: grid; gap: 18px; max-width: 560px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.field label small { color: var(--muted); font-weight: 400; }
.field input { width: 100%; height: 54px; padding: 0 14px; border: 2px solid #AEB7C5; border-radius: 5px; background: #fff; font-size: 17px; }
.field input[aria-invalid="true"] { border-color: #A32626; }
.field-error, .step-error { color: #A32626; font-weight: 600; font-size: 15px; }
.field-error:not(:empty) { margin-top: 5px; }
.step-error { padding: 0 18px; }
.step-error:not(:empty) { padding-bottom: 12px; }
.consent { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 15px; }
.consent input { width: 22px; height: 22px; flex: none; accent-color: var(--red); }

/* Commandes, toujours visibles au pouce */
.controls { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; padding: 12px 18px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line-light); border-radius: 0 0 8px 8px; background: var(--paper); }
.controls .btn { white-space: nowrap; }
.controls .next { flex: 1; background: var(--ink); color: #fff; }
.controls .next:hover { background: var(--navy); }
.controls .prev { padding-inline: 15px; border-color: #AEB7C5; }

@media (max-width: 599px) {
  .controls { gap: 8px; padding-inline: 12px; }
  .controls .btn { gap: 6px; padding-inline: 10px; font-size: 15px; }
  .controls .next .icon { display: none; }
  .quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .quick .chip { min-width: 0; padding-inline: 0; }
}
@media (max-width: 359px) {
  .camera-row { flex-direction: column; align-items: stretch; }
  .segments button { flex: 1; }
  .split-row { flex-wrap: wrap; }
  .split-name { flex-basis: 100%; }
  .yes-no .choice { padding-inline: 12px; }
}

/* Récapitulatif */
.result { padding-top: 32px; }
.result > h1 { margin-bottom: 10px; font-size: clamp(28px, 4.5vw, 46px); }
.result > h1:focus { outline: none; }
.result > .lead { margin-bottom: 26px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.quote { overflow: hidden; border-radius: 8px; background: #fff; color: var(--ink); }
.quote-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 22px 18px; border-bottom: 3px solid var(--red); }
.quote-logo { width: 112px; }
.quote-meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.quote-section { padding: 18px; border-bottom: 1px solid var(--line-light); }
.quote-section h2 { margin-bottom: 10px; font-size: 22px; }
.facts { display: grid; gap: 7px; margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { min-width: 0; margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; }
.total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 20px 18px; background: var(--night); color: #F3F5F8; }
.total strong { color: var(--red-light); font: 800 29px/1.2 var(--display); white-space: nowrap; }
.disclaimer { padding: 12px 18px; color: var(--muted); font-size: 13px; }
.send { display: grid; gap: 11px; order: -1; }
.send-total { padding-bottom: 8px; }
.send-total span { display: block; color: var(--muted-dark); }
.send-total strong { color: var(--red-light); font: 800 36px/1.2 var(--display); white-space: nowrap; }
.send p { color: var(--muted-dark); font-size: 14px; }
.send .warning { padding: 10px 12px; border: 1px solid var(--red); border-radius: 4px; color: var(--red-light); }

@media (min-width: 600px) {
  .step { padding: 38px 34px 42px; }
  .apply-grid { grid-template-columns: repeat(3, 1fr); }
  .apply { align-content: start; }
  .apply .gamme, .apply .popular { grid-column: 1 / -1; justify-self: start; }
  .apply .popular { position: absolute; top: 12px; right: 12px; }
  .durations { grid-template-columns: repeat(4, 1fr); }
  .controls { padding-inline: 34px; }
  .controls .next { flex: none; min-width: 230px; margin-inline-start: auto; }
  .step-error { padding-inline: 34px; }
  .choice-body { padding: 14px 16px 16px; }
  .quote-head, .quote-section, .total { padding-inline: 28px; }
}

@media (min-width: 960px) {
  .sim-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; padding-top: 36px; align-items: start; }
  .sim-side { position: sticky; top: 108px; }
  .progress { padding-block: 0 20px; }
  .step-nav { display: block; margin: 0; padding: 0; list-style: none; }
  .step-nav button { display: grid; grid-template-columns: 26px 1fr; width: 100%; padding: 8px 0; border: 0; background: none; color: var(--muted-dark); text-align: start; line-height: 1.25; }
  .step-nav button small { grid-column: 2; color: #8EA2BA; font-size: 13px; }
  .step-nav button.current { color: var(--red-light); font-weight: 700; }
  .step-nav button:disabled { opacity: .5; cursor: default; }
  .panel { min-height: 560px; }
  .site-grid { gap: 16px; max-width: 660px; }
  .result-grid { grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; }
  .send { order: 0; position: sticky; top: 108px; }
}

/* Solution IP / analogique */
.solution-grid { display: grid; gap: 14px; max-width: 700px; }
.solution { display: grid; grid-template-columns: 38% 1fr; align-items: stretch; }
.solution-photo { position: relative; min-height: 150px; overflow: hidden; }
.solution-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.solution strong { margin-top: 10px; color: var(--navy); font: 700 20px/1.2 var(--display); }
.solution:disabled { background: #E7EBF0; cursor: not-allowed; }
.solution:disabled:hover { border-color: var(--line-light); }
.solution:disabled img { filter: grayscale(1); opacity: .5; }
.solution:disabled strong { color: var(--muted); }
.status { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: 12px; font-weight: 700; }
.status.on { background: #D5F3DF; color: #11592B; }
.status.off { background: var(--red-dark); color: #fff; }

/* Mouvement */
.choice:hover:not(:disabled) img { transform: scale(1.07); }
.choice { transition: border-color .2s, background .2s, transform .25s var(--ease); }
.choice:active:not(:disabled) { transform: scale(.98); }
.choice[aria-pressed="true"] { animation: selected .45s var(--ease); }
.round:active:not(:disabled), .chip:active { transform: scale(.9); }
.step[class*="enter-"] .choice, .step[class*="enter-"] .split-row, .step[class*="enter-"] .field { animation: option-in .5s var(--ease) backwards; }
.step[class*="enter-"] :is(.choice, .split-row, .field):nth-child(2) { animation-delay: .08s; }
.step[class*="enter-"] :is(.choice, .split-row, .field):nth-child(3) { animation-delay: .16s; }
.step[class*="enter-"] :is(.choice, .split-row, .field):nth-child(4) { animation-delay: .24s; }
.quote { animation: option-in .7s var(--ease) both; }
.send > * { animation: option-in .6s .15s var(--ease) backwards; }
.send .btn-line { color: #F4F7FA; }
.send .btn-line:hover { border-color: var(--red-light); }
@keyframes selected { 40% { transform: scale(1.03); } }
@keyframes option-in { from { opacity: 0; transform: translateY(22px); } }

@media (min-width: 600px) { .quote-logo { width: 140px; } }