/* ANIMSOUND — questionnaire de devis.
   Charte relevée sur la carte de visite : fond quasi noir (#16130d), or (#d0c297), blanc cassé (#fffffb), Montserrat.
   Thème sombre par défaut (formulaire client). L'administration surcharge ces variables en clair (admin.css).
   Contrastes calculés (WCAG) : texte ≥ 8:1, or sur fond ≥ 9:1, bordures de champs ≥ 4:1. */

@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat.woff") format("woff");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --accent: #d0c297;               /* or du logo et des filets de la carte */
  --accent-survol: #e4d8b0;
  --sur-accent: #16130d;           /* texte posé sur un bouton or */
  --texte: #fffffb;
  --texte-doux: #b8b2a6;
  --fond: #16130d;
  --carte: #201b13;
  --champ: #120f0a;
  --bordure: #8a7c58;              /* contour des champs et des boutons (≥ 3:1) */
  --filet: #3a3322;                /* séparateurs et cadres décoratifs */
  --erreur: #ff9b8f;
  --erreur-fond: #3b1612;
  --ok: #7fe0a6;
  --ok-fond: #10301e;
  --choix-actif: #2e2819;
  --surface-douce: #2a2418;
  --barre-fond: #3a3322;
  --bouton-secondaire-fond: transparent;
  --bandeau-fond: #3a2f0f;
  --bandeau-bordure: #e3b341;
  --bandeau-texte: #ffe08a;
  --rayon: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.conteneur { max-width: 680px; margin: 0 auto; padding: 0 16px; }

.entete { background: var(--carte); border-bottom: 1px solid var(--accent); }
.entete-contenu { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
.marque { display: flex; align-items: center; gap: 10px; }
.logo { height: 40px; width: auto; display: block; flex: none; }
.logo-texte { font-weight: 800; letter-spacing: .12em; font-size: 1.05rem; color: var(--accent); }

main { padding-top: 20px; padding-bottom: 32px; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 0 0 16px; }
h2:focus, h1:focus { outline: none; }
h3 { font-size: 1rem; margin: 0 0 8px; }

.intro { color: var(--texte-doux); margin: 0 0 20px; }

.bandeau-demo {
  background: var(--bandeau-fond); border: 1px solid var(--bandeau-bordure); color: var(--bandeau-texte);
  padding: 10px 12px; border-radius: var(--rayon); margin-bottom: 16px; font-weight: 600;
}

/* Progression */
.progression { margin-bottom: 20px; }
.progression-texte { margin: 0 0 6px; font-weight: 600; font-size: .95rem; }
.barre { height: 8px; background: var(--barre-fond); border-radius: 99px; overflow: hidden; }
.barre-remplie { height: 100%; width: 25%; background: var(--accent); border-radius: 99px; transition: width .25s ease; }

/* Formulaire */
.etape { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 18px 16px; }
.etape[hidden], [hidden] { display: none !important; }

.champ { margin-bottom: 16px; border: 0; padding: 0; min-width: 0; }
fieldset.champ { margin-left: 0; margin-right: 0; }
label, legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.oblig { color: var(--erreur); }
.facultatif, .aide-legende { font-weight: 400; color: var(--texte-doux); font-size: .9rem; }
.aide, .aide-bloc { color: var(--texte-doux); font-size: .9rem; margin: 4px 0 0; }
.aide-bloc { margin: 0 0 14px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="date"],
input[type="time"], input[type="search"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 48px;           /* cible tactile confortable */
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;            /* évite le zoom automatique d'iOS */
  color: var(--texte);
  background: var(--champ);
  border: 1px solid var(--bordure);
  border-radius: 8px;
}
textarea { resize: vertical; min-height: 84px; }
::placeholder { color: var(--texte-doux); opacity: 1; }

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, .case input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--erreur); border-width: 2px;
}

.erreur { color: var(--erreur); font-size: .92rem; margin: 6px 0 0; font-weight: 600; }
.erreur:empty { display: none; }
.erreur-globale { padding: 10px 12px; background: var(--erreur-fond); border-radius: 8px; }

.ligne-deux { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 520px) { .ligne-deux { grid-template-columns: 1fr 1fr; } }

/* Cases et boutons radio */
.choix { display: grid; gap: 8px; }
.case, .choix label {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--bordure); border-radius: 8px; background: var(--champ);
  font-weight: 400; margin: 0; cursor: pointer;
}
.case input, .choix input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.choix label:has(input:checked) { border-color: var(--accent); background: var(--choix-actif); }
.champ-case .case { align-items: flex-start; }

/* Leurre anti-robot */
.leurre { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Récapitulatif */
.recap-section { border: 1px solid var(--filet); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: var(--champ); }
.recap-entete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.recap-entete h3 { margin: 0; }
.lien-modifier {
  min-height: 44px; padding: 0 12px; background: none; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
}
.recap-liste { margin: 0; }
.recap-liste div { padding: 6px 0; border-top: 1px solid var(--filet); }
.recap-liste div:first-child { border-top: 0; }
.recap-liste dt { font-size: .85rem; color: var(--texte-doux); }
.recap-liste dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.non-renseigne { color: var(--texte-doux); font-style: italic; }

.info-donnees { background: var(--surface-douce); border-radius: 8px; padding: 12px; margin: 16px 0; font-size: .92rem; }
.info-donnees p { margin: 0 0 8px; }
.info-donnees p:last-child { margin-bottom: 0; }

/* Actions */
.actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 20px; }
@media (min-width: 520px) { .actions { flex-direction: row; justify-content: space-between; } .actions .bouton { min-width: 180px; } }

.bouton {
  min-height: 52px; padding: 0 20px; font: inherit; font-weight: 700; font-size: 1rem;
  border-radius: 10px; border: 2px solid var(--accent); cursor: pointer; width: 100%;
}
@media (min-width: 520px) { .bouton { width: auto; } }
.bouton.principal { background: var(--accent); color: var(--sur-accent); }
.bouton.principal:hover { background: var(--accent-survol); border-color: var(--accent-survol); }
.bouton.secondaire { background: var(--bouton-secondaire-fond); color: var(--accent); }
.bouton:disabled { opacity: .6; cursor: wait; }

/* Confirmation */
.confirmation { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 22px 16px; }
.numero {
  font-size: 1.4rem; font-weight: 800; letter-spacing: .04em; color: var(--ok);
  background: var(--ok-fond); border-radius: 8px; padding: 10px 12px; display: inline-block;
}

.pied { color: var(--texte-doux); font-size: .85rem; padding: 16px 0 32px; text-align: center; }

@media (prefers-reduced-motion: reduce) { .barre-remplie { transition: none; } }

.sous-titre-etape { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
