/* =========================================================
   BATIVO — Devis adaptatif (wizard)
   Styles du formulaire multi-étapes. Prefixe : .dw
   ========================================================= */

.dw {
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

/* ---------- Progression ---------- */
.dw__head { margin-bottom: 1.8rem; }
.dw__count {
  font-size: .85rem;
  color: var(--c-muted);
  margin-bottom: .55rem;
}
.dw__count strong { color: var(--c-accent); }
.dw__bar {
  height: 6px;
  background: var(--c-bg-alt);
  border-radius: 99px;
  overflow: hidden;
}
.dw__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-light));
  border-radius: 99px;
  transition: width .4s cubic-bezier(.2, .7, .3, 1);
}

/* ---------- Corps de l'étape ---------- */
.dw__body { animation: dw-in .3s ease both; }
@keyframes dw-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .dw__body { animation: none; }
}

.dw__title {
  font-family: var(--ff-head);
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 .4rem;
  color: var(--c-text);
}
.dw__opt-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: .5rem;
  padding: .15rem .6rem;
  font-family: var(--ff-sans);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-muted);
  background: var(--c-bg-alt);
  border-radius: 99px;
}
.dw__subtitle {
  font-size: .92rem;
  color: var(--c-muted);
  margin: 0 0 .5rem;
}
.dw__subtitle--hint {
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-accent-dark);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.dw__title-wrap { margin-bottom: 1.3rem; }

/* ---------- Options (choix unique) ---------- */
.dw__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}
.dw__option {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: 100%;
  padding: .95rem 1.05rem;
  font-family: inherit;
  font-size: .92rem;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text);
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr), transform var(--tr);
}
.dw__option:hover {
  border-color: var(--c-accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.dw__option:focus-visible {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .15);
}
.dw__option.is-selected {
  border-color: var(--c-accent);
  background: #fff7ed;
  box-shadow: 0 0 0 1px var(--c-accent);
}
.dw__option-ico {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--c-bg-alt);
  color: var(--c-primary);
  border-radius: 10px;
  transition: background var(--tr), color var(--tr);
}
.dw__option-ico svg { width: 22px; height: 22px; }
.dw__option.is-selected .dw__option-ico {
  background: var(--c-accent);
  color: #fff;
}
.dw__option-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.dw__option-txt strong { font-weight: 600; }
.dw__option-txt small { color: var(--c-muted); font-size: .78rem; line-height: 1.35; }
.dw__option-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--c-border);
  border-radius: 50%;
  color: transparent;
  transition: all var(--tr);
}
.dw__option-check svg { width: 12px; height: 12px; }
.dw__option.is-selected .dw__option-check {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

/* ---------- Chips (choix multiples) ---------- */
.dw__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.dw__chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.05rem;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 500;
  background: #fff;
  border: 1.5px solid var(--c-border);
  border-radius: 99px;
  color: var(--c-text);
  cursor: pointer;
  transition: all var(--tr);
}
.dw__chip:hover { border-color: var(--c-accent-light); }
.dw__chip:focus-visible {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .15);
}
.dw__chip.is-selected {
  border-color: var(--c-accent);
  background: var(--c-accent);
  color: #fff;
}
.dw__chip-check {
  display: none;
  width: 14px;
  height: 14px;
}
.dw__chip-check svg { width: 14px; height: 14px; }
.dw__chip.is-selected .dw__chip-check { display: inline-grid; place-items: center; }

/* ---------- Champ "précisez" (option Autre) ---------- */
.dw__other { margin-top: .9rem; }
.dw__other input {
  width: 100%;
  padding: .85rem 1rem;
  font-family: inherit;
  font-size: .95rem;
  border: 1.5px solid var(--c-accent);
  border-radius: var(--radius-sm);
  background: #fff7ed;
  color: var(--c-text);
}
.dw__other input:focus {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .15);
}

/* ---------- Note d'information ---------- */
.dw__note {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  margin-top: 1.1rem;
  padding: .9rem 1.1rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--c-primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
}
.dw__note a { color: var(--c-accent-dark); font-weight: 600; text-decoration: underline; }
.dw__note-ico {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #3b82f6;
}
.dw__note-ico svg { width: 18px; height: 18px; }

/* ---------- Champs (coordonnées, texte libre) ---------- */
.dw__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dw__field { grid-column: 1 / -1; }
.dw__field--half { grid-column: span 1; }
.dw__field label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--c-text);
}
.dw__field input,
.dw__field textarea {
  width: 100%;
  padding: .85rem 1rem;
  font-family: inherit;
  font-size: 16px; /* évite le zoom iOS */
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
  transition: all var(--tr);
}
.dw__field textarea { resize: vertical; min-height: 90px; }
.dw__field input:focus,
.dw__field textarea:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .15);
}
.dw__field.has-error input,
.dw__field.has-error textarea { border-color: var(--c-danger); }
.dw__field-error {
  display: block;
  margin-top: .3rem;
  font-size: .78rem;
  color: var(--c-danger);
  min-height: 0;
}
.dw__chips--inline .dw__chip { padding: .55rem .95rem; }

/* ---------- Erreur d'étape ---------- */
.dw__error {
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
}

/* ---------- Navigation ---------- */
.dw__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
}
.dw__back {
  padding: .7rem 1rem;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-muted);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--tr), background var(--tr);
}
.dw__back:hover { color: var(--c-text); background: var(--c-bg-alt); }
.dw__next { min-width: 170px; }

.dw__notice {
  margin: 1.4rem 0 0;
  font-size: .78rem;
  color: var(--c-muted);
  text-align: center;
}

/* ---------- Récapitulatif ---------- */
.dw__recap {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.4rem;
}
.dw__recap-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .75rem 1.1rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--c-border);
}
.dw__recap-row:nth-child(odd) { background: var(--c-bg-alt); }
.dw__recap-row:last-child { border-bottom: 0; }
.dw__recap-label {
  flex: 0 0 38%;
  color: var(--c-muted);
  font-weight: 500;
}
.dw__recap-value {
  flex: 1;
  color: var(--c-text);
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.dw__recap-edit {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
  padding: .25rem .5rem;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-accent-dark);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--tr);
}
.dw__recap-edit:hover { background: #fff7ed; }
.dw__recap-edit svg { width: 13px; height: 13px; }
.dw__recap-edit--ghost { visibility: hidden; min-width: 70px; }

.dw__rgpd {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  font-size: .85rem;
  color: var(--c-muted);
}
.dw__rgpd input { width: auto; margin-top: 3px; }
.dw__send { width: 100%; justify-content: center; }

/* ---------- Succès ---------- */
.dw__success {
  text-align: center;
  padding: 2rem 1rem;
  animation: dw-in .3s ease both;
}
.dw__success-ico {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.4rem;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: var(--c-success);
  border-radius: 50%;
}
.dw__success-ico svg { width: 34px; height: 34px; }
.dw__success h3 {
  font-family: var(--ff-head);
  font-size: 1.5rem;
  margin: 0 0 .7rem;
}
.dw__success p {
  color: var(--c-muted);
  max-width: 46ch;
  margin: 0 auto 1rem;
}
.dw__success-call { font-weight: 600; color: var(--c-text) !important; }
.dw__success-tel {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--c-accent-dark);
  font-weight: 700;
  white-space: nowrap;
}
.dw__success-tel svg { width: 16px; height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dw__options { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  /* Sur mobile, le formulaire passe avant la carte Coordonnées */
  .contact-grid .contact-info { order: 2; }
  .contact-grid #devis-app { order: 1; }

  .dw { padding: 1.4rem 1.1rem; }
  .dw__title { font-size: 1.15rem; }
  .dw__fields { grid-template-columns: 1fr; }
  .dw__field--half { grid-column: 1 / -1; }
  .dw__recap-row { flex-wrap: wrap; gap: .2rem .8rem; }
  .dw__recap-label { flex-basis: 100%; }
  .dw__nav { flex-wrap: wrap; }
  .dw__next { flex: 1; min-width: 0; }
}
