:root {
  --marine: #1B2A4A;
  --rouge: #C2362B;
  --creme: #F4EEE3;
  --lin: #D8D0C2;
  --blanc: #FFFFFF;
  --vert: #1F7A4D;
  --orange: #C77700;
  --encre: #1B2A4A;
  --doux: #5B6680;
  --rayon: 22px;
  --ombre: 0 10px 30px rgba(27, 42, 74, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  color: var(--encre);
  background: var(--creme);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
#app { height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 68px; padding: 0 30px; border-radius: 999px;
  font-size: 23px; font-weight: 800; letter-spacing: .01em;
  transition: transform .12s ease, background .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn-rouge { background: var(--rouge); color: #fff; box-shadow: 0 6px 0 #8E2219; }
.btn-rouge:active { box-shadow: 0 2px 0 #8E2219; transform: translateY(4px); }
.btn-marine { background: var(--marine); color: var(--creme); }
.btn-clair { background: var(--blanc); color: var(--marine); border: 3px solid var(--lin); }
.btn-lien { min-height: 56px; padding: 0 14px; font-size: 20px; font-weight: 700; color: var(--doux); }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* ---------- Accueil ---------- */
.accueil {
  flex: 1; background: var(--marine); color: var(--creme);
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 2vw; padding: 4vh 5vw;
  position: relative; overflow: hidden;
}
.accueil::before {
  content: ""; position: absolute; inset: -20%;
  background: radial-gradient(circle at 75% 45%, rgba(194, 54, 43, .35), transparent 45%);
  pointer-events: none;
}
.accueil-texte { position: relative; z-index: 1; }
.accueil-logo { width: min(330px, 34vw); transform: rotate(-2deg); margin-bottom: 4vh; }
.accueil h1 { font-size: clamp(44px, 6.4vw, 92px); line-height: .95; margin: 0 0 2.4vh; font-weight: 800; letter-spacing: -.02em; }
.accueil h1 em { font-style: normal; color: #F5C242; }
.accueil p.sous { font-size: clamp(20px, 2.3vw, 30px); margin: 0 0 5vh; opacity: .9; font-weight: 500; }
.accueil .btn { font-size: 28px; min-height: 84px; padding: 0 44px; }
.accueil-etapes { display: flex; gap: 22px; margin-top: 5vh; font-size: 19px; font-weight: 700; opacity: .85; flex-wrap: wrap; }
.accueil-etapes span b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--creme); color: var(--marine); margin-right: 8px; }
.accueil-vitrine { position: relative; z-index: 1; height: 78vh; display: grid; place-items: center; }
.accueil-vitrine .apercu-svg { width: 100%; height: 100%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); animation: entree .6s cubic-bezier(.2, .9, .3, 1.2); }
.accueil-touche { position: absolute; bottom: 3vh; left: 0; right: 0; text-align: center; font-size: 18px; opacity: .7; animation: pulse 2s infinite; }
@keyframes entree { from { opacity: 0; transform: scale(.9) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Barre du haut ---------- */
.barre {
  height: 82px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--blanc); border-bottom: 2px solid var(--lin);
}
.barre .logo { height: 54px; }
.progression { flex: 1; display: flex; justify-content: center; gap: 6px; }
.progression span {
  display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; color: #A9A397;
  padding: 7px 12px; border-radius: 999px;
}
.progression span i { width: 10px; height: 10px; border-radius: 50%; background: var(--lin); }
.progression span.fait { color: var(--marine); }
.progression span.fait i { background: var(--marine); }
.progression span.actif { background: var(--creme); color: var(--rouge); }
.progression span.actif i { background: var(--rouge); }

/* ---------- Corps ---------- */
.corps { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; }
.scene {
  position: relative; border-radius: var(--rayon); min-height: 0;
  background: radial-gradient(circle at 50% 40%, #FFFFFF 0, #EFE8DB 70%);
  display: grid; place-items: center; overflow: hidden;
}
.scene .apercu-svg { width: 92%; height: 86%; filter: drop-shadow(0 18px 24px rgba(27, 42, 74, .18)); transition: opacity .2s; }
.scene-prix {
  position: absolute; top: 18px; left: 18px; background: var(--marine); color: var(--creme);
  padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: 20px;
}
.scene-vues { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; background: var(--blanc); border-radius: 999px; padding: 5px; box-shadow: var(--ombre); }
.scene-vues button { min-height: 50px; padding: 0 22px; border-radius: 999px; font-size: 18px; font-weight: 800; color: var(--doux); }
.scene-vues button.on { background: var(--marine); color: var(--creme); }

.panneau {
  background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.panneau-tete { padding: 26px 28px 8px; }
.panneau-tete h2 { margin: 0; font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.015em; line-height: 1.05; }
.panneau-tete p { margin: 8px 0 0; font-size: 20px; color: var(--doux); }
.panneau-contenu { flex: 1; overflow-y: auto; padding: 16px 28px 20px; -webkit-overflow-scrolling: touch; }
.panneau-pied { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 2px solid var(--creme); }

/* ---------- Cartes de choix ---------- */
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grille.large { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.carte {
  background: var(--creme); border: 3px solid transparent; border-radius: 20px; padding: 12px 10px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  transition: transform .12s, border-color .15s, background .15s;
}
.carte:active { transform: scale(.96); }
.carte.on { border-color: var(--rouge); background: #FBF3EF; }
.carte .vignette { width: 100%; aspect-ratio: 1; display: grid; place-items: center; }
.carte .vignette svg { width: 100%; height: 100%; }
.carte .vignette.ronde svg { border-radius: 14px; }
.carte b { font-size: 21px; font-weight: 800; }
.carte small { font-size: 18px; color: var(--doux); font-weight: 700; }

.pastille { width: 96px; height: 96px; border-radius: 50%; border: 4px solid rgba(0, 0, 0, .08); box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .15); }

.deux-choix { display: grid; grid-template-columns: 1fr; gap: 16px; }
.gros-choix {
  display: flex; align-items: center; gap: 20px; text-align: left; padding: 20px;
  background: var(--creme); border-radius: 24px; border: 3px solid transparent; min-height: 150px;
}
.gros-choix:active { transform: scale(.98); border-color: var(--rouge); }
.gros-choix .icone { width: 120px; height: 120px; flex: none; display: grid; place-items: center; border-radius: 20px; background: var(--blanc); overflow: hidden; }
.gros-choix .icone svg { width: 100%; height: 100%; }
.gros-choix b { display: block; font-size: 27px; font-weight: 800; line-height: 1.1; }
.gros-choix span { display: block; font-size: 19px; color: var(--doux); margin-top: 6px; }

/* ---------- Champs ---------- */
.champ { margin-bottom: 18px; }
.champ label { display: block; font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.champ input[type=text], .champ input[type=email] {
  width: 100%; font: inherit; font-size: 28px; font-weight: 700; color: var(--marine);
  padding: 14px 18px; border-radius: 16px; border: 3px solid var(--lin); background: var(--creme); outline: none;
}
.champ input:focus { border-color: var(--marine); background: #fff; }
.champ .aide { font-size: 16px; color: var(--doux); margin-top: 6px; }
.puces { display: flex; flex-wrap: wrap; gap: 10px; }
.puce {
  min-height: 60px; min-width: 76px; padding: 0 20px; border-radius: 16px; font-size: 21px; font-weight: 800;
  background: var(--creme); border: 3px solid transparent;
}
.puce.on { background: var(--marine); color: var(--creme); }
.titre-petit { font-size: 18px; font-weight: 800; margin: 18px 0 8px; }
.compteur { display: flex; align-items: center; gap: 16px; }
.compteur button { width: 64px; height: 64px; border-radius: 50%; background: var(--creme); font-size: 34px; font-weight: 800; }
.compteur b { font-size: 34px; min-width: 40px; text-align: center; }
.case { display: flex; gap: 14px; align-items: flex-start; font-size: 18px; line-height: 1.35; padding: 14px; border-radius: 16px; background: var(--creme); }
.case input { width: 30px; height: 30px; flex: none; accent-color: var(--rouge); margin: 0; }
.erreur { color: var(--rouge); font-weight: 800; font-size: 18px; margin: 4px 0 12px; }

/* ---------- Photo ---------- */
.qr-bloc { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.qr { width: 250px; height: 250px; padding: 12px; background: #fff; border-radius: 20px; border: 4px solid var(--marine); }
.qr svg { width: 100%; height: 100%; display: block; }
.etapes-qr { list-style: none; padding: 0; margin: 0; counter-reset: e; }
.etapes-qr li { counter-increment: e; display: flex; gap: 12px; align-items: center; font-size: 20px; font-weight: 700; margin-bottom: 14px; line-height: 1.2; }
.etapes-qr li::before { content: counter(e); flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--rouge); color: #fff; font-weight: 800; }
.attente { margin-top: 18px; padding: 14px 18px; border-radius: 16px; background: var(--creme); font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.attente.ok { background: #E3F2EA; color: var(--vert); }
.point { width: 14px; height: 14px; border-radius: 50%; background: var(--rouge); animation: pulse 1.2s infinite; flex: none; }
.attente.ok .point { background: var(--vert); }
.qualite { padding: 14px 16px; border-radius: 16px; font-size: 18px; font-weight: 700; margin-bottom: 16px; line-height: 1.3; }
.qualite.top { background: #E3F2EA; color: var(--vert); }
.qualite.ok { background: #FFF3DC; color: var(--orange); }
.qualite.flou { background: #FBE4E1; color: var(--rouge); }

/* ---------- Récap & paiement ---------- */
.recap { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; background: var(--creme); border-radius: 18px; padding: 12px; margin-bottom: 18px; }
.recap svg { width: 110px; height: 110px; }
.recap p { margin: 2px 0; font-size: 18px; }
.recap .total { font-size: 26px; font-weight: 800; color: var(--rouge); }
.paiement { display: grid; grid-template-columns: 1fr; gap: 16px; }
.paiement .qr { width: 230px; height: 230px; }
.ou { text-align: center; font-weight: 800; color: var(--doux); font-size: 18px; }

/* ---------- Merci ---------- */
.merci { flex: 1; background: var(--marine); color: var(--creme); display: grid; place-items: center; text-align: center; padding: 5vh 6vw; }
.merci h1 { font-size: clamp(44px, 6vw, 80px); margin: 0 0 2vh; font-weight: 800; }
.merci .numero { display: inline-block; background: var(--creme); color: var(--marine); font-size: clamp(54px, 8vw, 110px); font-weight: 800; padding: 6px 40px; border-radius: 26px; transform: rotate(-3deg); box-shadow: 10px 10px 0 var(--rouge); margin: 2vh 0 4vh; }
.merci p { font-size: clamp(20px, 2.3vw, 28px); margin: 0 auto 1.4vh; max-width: 900px; }

/* ---------- Veille ---------- */
.veille { position: fixed; inset: 0; background: rgba(27, 42, 74, .75); display: grid; place-items: center; z-index: 10; }
.veille[hidden] { display: none; }
.veille-carte { background: #fff; border-radius: 28px; padding: 40px 50px; text-align: center; font-size: 22px; }
.veille-titre { font-size: 40px; font-weight: 800; margin: 0 0 10px; }

.charge { display: inline-block; width: 22px; height: 22px; border: 4px solid rgba(0,0,0,.15); border-top-color: var(--rouge); border-radius: 50%; animation: tourne .8s linear infinite; vertical-align: middle; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Tablette en portrait ---------- */
@media (orientation: portrait) {
  .corps { grid-template-columns: 1fr; grid-template-rows: 40% 60%; }
  .accueil { grid-template-columns: 1fr; text-align: center; }
  .accueil-logo { margin-inline: auto; }
  .accueil-etapes { justify-content: center; }
  .accueil-vitrine { height: 40vh; order: -1; }
  .progression span { font-size: 0; padding: 7px; }
}
@media (max-width: 1100px) and (orientation: landscape) {
  .progression span { font-size: 0; padding: 7px; gap: 0; }
  .progression span.actif { font-size: 15px; gap: 7px; padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
