:root {
  --sapin: #1d3b2a;
  --sapin-2: #28503a;
  --creme: #fbf5ea;
  --papier: #fffdf8;
  --rouge: #b3261e;
  --rouge-2: #8f1d17;
  --or: #d6a443;
  --bois: #c99a66;
  --bois-fonce: #5b3a1e;
  --texte: #2b2118;
  --doux: #7a6a5a;
  --ligne: #e8dcc8;
  --rayon: 16px;
  --ombre: 0 6px 20px rgba(29, 59, 42, .12);
  --titre: "Georgia", "Times New Roman", serif;
  --corps: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--corps);
  color: var(--texte);
  background: var(--creme);
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- En-tête ---------- */
.entete {
  background: var(--sapin);
  background-image:
    radial-gradient(circle at 12% 30%, rgba(255,255,255,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 20%, rgba(255,255,255,.15) 0 2px, transparent 3px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.12) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 90% 70%, rgba(255,255,255,.15) 0 2px, transparent 3px),
    radial-gradient(circle at 60% 45%, rgba(255,255,255,.10) 0 1.5px, transparent 2.5px);
  background-size: 140px 120px;
  color: var(--creme);
  text-align: center;
  padding: 22px 16px 26px;
  border-bottom: 4px solid var(--or);
}
.entete .logo { font-size: 30px; line-height: 1; }
.entete h1 {
  font-family: var(--titre);
  font-weight: 700;
  font-size: 30px;
  margin: 6px 0 4px;
  letter-spacing: .5px;
}
.entete p { margin: 0; opacity: .85; font-size: 15px; }

.page { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; }

/* ---------- Blocs ---------- */
.carte {
  background: var(--papier);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--ombre);
}
.etape-titre {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--titre);
  font-size: 20px;
  margin: 0 0 12px;
}
.etape-num {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--rouge); color: #fff;
  display: grid; place-items: center;
  font-family: var(--corps); font-size: 15px; font-weight: 700;
}

/* Grille des formes */
.formes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.choix {
  border: 2px solid var(--ligne);
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  transition: border-color .15s, transform .1s, background .15s;
}
.choix:active { transform: scale(.97); }
.choix .emoji { font-size: 32px; display: block; line-height: 1.2; }
.choix .nom { font-size: 14px; font-weight: 600; }
.choix[aria-pressed="true"] { border-color: var(--rouge); background: #fff3f1; }

/* Liste des phrases */
.phrases { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.phrases .choix { text-align: left; padding: 12px; font-weight: 600; font-size: 15px; }
@media (max-width: 360px) { .phrases { grid-template-columns: 1fr; } }

/* Champs */
label.champ { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 6px; color: var(--doux); }
.ligne-prenom { display: flex; gap: 8px; margin-bottom: 8px; }
input[type="text"], input[type="password"], input[type="search"] {
  width: 100%;
  border: 2px solid var(--ligne);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 18px;
  background: #fff;
  outline: none;
}
input:focus { border-color: var(--sapin-2); }
.compteur { font-size: 12px; color: var(--doux); text-align: right; margin-top: -4px; }
.case {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; font-weight: 600;
  padding: 12px; border-radius: 12px; background: #f6efe2;
}
.case input { width: 22px; height: 22px; accent-color: var(--rouge); }

/* Boutons */
.btn {
  border: 0; border-radius: 14px;
  padding: 15px 18px;
  font-weight: 700; font-size: 17px;
  width: 100%;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-rouge { background: var(--rouge); color: #fff; box-shadow: 0 4px 0 var(--rouge-2); }
.btn-vert { background: var(--sapin); color: #fff; box-shadow: 0 4px 0 #11261a; }
.btn-clair { background: #fff; border: 2px solid var(--ligne); color: var(--texte); }
.btn-petit { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn-icone { width: 48px; flex: none; padding: 0; font-size: 20px; }

/* Aperçu */
.apercu {
  display: grid; place-items: center;
  padding: 10px 0 4px;
}
.deco {
  position: relative;
  width: 230px; height: 230px;
  display: grid; place-items: center;
  text-align: center;
  color: var(--bois-fonce);
}
.deco .fond {
  position: absolute; inset: 0;
  background:
    repeating-radial-gradient(circle at 35% 40%, rgba(255,255,255,.0) 0 7px, rgba(120,75,35,.10) 8px 9px),
    radial-gradient(circle at 35% 30%, #e7c495, var(--bois) 70%);
  border: 3px solid #a87a49;
  box-shadow: inset 0 0 18px rgba(91,58,30,.35), 0 10px 22px rgba(0,0,0,.18);
}
.deco.rond .fond { border-radius: 50%; }
.deco.flocon .fond { clip-path: polygon(50% 0, 61% 30%, 93% 25%, 70% 50%, 93% 75%, 61% 70%, 50% 100%, 39% 70%, 7% 75%, 30% 50%, 7% 25%, 39% 30%); border: 0; }
.deco .attache {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 22px; background: var(--rouge);
}
.deco .badge {
  position: absolute; right: -6px; top: -6px;
  font-size: 30px;
  background: #fff; border-radius: 50%;
  width: 48px; height: 48px; display: grid; place-items: center;
  box-shadow: var(--ombre);
}
.deco .gravure {
  position: relative;
  padding: 0 34px;
  font-family: var(--titre);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.deco .g-phrase { font-size: 17px; font-style: italic; }
.deco .g-prenoms { font-size: 26px; font-weight: 700; line-height: 1.15; margin: 4px 0; word-break: break-word; }
.deco .g-annee { font-size: 16px; letter-spacing: 2px; }
.note { font-size: 12px; color: var(--doux); text-align: center; margin-top: 6px; }

/* Barre panier en bas */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--papier);
  border-top: 1px solid var(--ligne);
  box-shadow: 0 -6px 20px rgba(0,0,0,.08);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 10;
}
.barre-in { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.barre .total { flex: none; font-weight: 700; line-height: 1.2; }
.barre .total small { display: block; font-weight: 500; color: var(--doux); font-size: 13px; }

/* Panier */
.article {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px dashed var(--ligne);
}
.article:last-child { border-bottom: 0; }
.article .emoji { font-size: 30px; }
.article .infos { flex: 1; min-width: 0; }
.article .infos b { display: block; font-size: 17px; }
.article .infos span { color: var(--doux); font-size: 14px; }
.tarifs { font-size: 13px; color: var(--doux); text-align: center; margin-top: 8px; }
.ligne-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; padding-top: 12px; }

/* Ticket */
.ticket { text-align: center; }
.ticket .numero-label { text-transform: uppercase; letter-spacing: 3px; font-size: 13px; color: var(--doux); }
.ticket .numero { font-family: var(--titre); font-size: 72px; font-weight: 700; color: var(--rouge); line-height: 1; margin: 4px 0; }
.ticket .consigne { font-size: 16px; margin: 8px 0 0; }
.qr-carte { text-align: center; }
.qr-carte .entete-deco { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 18px; }
.qr-carte .phrase-gros { font-family: var(--titre); font-size: 24px; margin: 6px 0 2px; }
.qr-carte .annee-tag { display: inline-block; background: var(--or); color: #3b2a0c; border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 14px; margin: 4px 0; }
.qr-carte .prenoms-gros { font-size: 22px; font-weight: 700; margin: 6px 0 10px; }
.qr { display: inline-block; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--ligne); }
.qr svg { display: block; width: 230px; height: 230px; }
.pastille { display: inline-block; background: #e9f3ec; color: var(--sapin); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; }
.pastille.alerte { background: #fdecea; color: var(--rouge-2); }

.masque { display: none !important; }
.centre { text-align: center; }
.mt { margin-top: 12px; }
.erreur { color: var(--rouge); font-weight: 600; font-size: 14px; margin-top: 8px; }
