/* Unifid — écran caisse. Gros boutons, contrastes forts, doigts pleins de farine.
   Mode kiosque tablette, safe-area, pas de sélection de texte parasite. */
:root {
  --vert: #0f6e56;
  --vert-clair: #1d9e75;
  --fond: #f4f6f5;
  --carte: #ffffff;
  --texte: #14201c;
  --texte-doux: #5a6b64;
  --bordure: #d5ddd9;
  --danger: #b3341b;
  --ombre: 0 2px 10px rgba(0, 0, 0, .08);
  --rayon: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}

#app { min-height: 100dvh; }

.ecran {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  gap: 18px;
}
[hidden] { display: none !important; }

.entete { text-align: center; }
.titre { font-size: clamp(26px, 4.2vw, 40px); font-weight: 800; margin: 0; line-height: 1.15; }
.sous-titre { font-size: clamp(17px, 2.4vw, 22px); color: var(--texte-doux); margin: 6px 0 0; }

.bloc-centre {
  margin: auto; width: 100%; max-width: 640px; text-align: center;
  display: flex; flex-direction: column; gap: 18px; align-items: stretch;
}

/* Affichages montant / téléphone */
.affichage-montant, .affichage-tel {
  background: var(--carte); border: 2px solid var(--bordure); border-radius: var(--rayon);
  box-shadow: var(--ombre);
  font-variant-numeric: tabular-nums; text-align: center;
  padding: 20px; margin: 4px auto 0; width: 100%; max-width: 640px;
}
.affichage-montant { font-size: clamp(44px, 9vw, 76px); font-weight: 800; }
.affichage-tel { font-size: clamp(30px, 6vw, 48px); font-weight: 700; letter-spacing: 2px; min-height: 1.4em; }
.rappel-achat { font-size: clamp(18px, 2.6vw, 24px); color: var(--texte-doux); margin: 0 0 4px; }

/* Pavé numérique */
.pave {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: 100%; max-width: 640px; margin: 0 auto;
}
.touche {
  font-size: clamp(28px, 5vw, 40px); font-weight: 700;
  background: var(--carte); color: var(--texte);
  border: 2px solid var(--bordure); border-radius: var(--rayon);
  padding: clamp(14px, 3.2vh, 28px) 0; cursor: pointer;
  box-shadow: var(--ombre); transition: transform .05s;
}
.touche:active { transform: scale(.96); background: #eef2f0; }
.touche-effacer { color: var(--danger); }

/* Boutons */
.actions { display: flex; gap: 12px; width: 100%; max-width: 640px; margin: 4px auto 0; }
.actions .btn { flex: 1; }
.btn {
  font-size: clamp(19px, 2.8vw, 24px); font-weight: 700;
  border: 2px solid transparent; border-radius: var(--rayon);
  padding: 18px 22px; cursor: pointer; box-shadow: var(--ombre);
  transition: transform .05s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-large { padding: 22px; font-size: clamp(20px, 3vw, 26px); }
.btn-primaire { background: var(--vert); color: #fff; }
.btn-secondaire { background: var(--carte); color: var(--texte); border-color: var(--bordure); }
.btn-lien, .lien-admin {
  background: none; border: none; box-shadow: none; color: var(--texte-doux);
  font-size: 16px; text-decoration: underline; cursor: pointer; padding: 12px;
}
.lien-admin { margin: auto auto 0; }
.btn-retour { align-self: center; max-width: 320px; margin-top: 6px; }

/* Résultat */
.gros-chiffre { font-size: clamp(34px, 6vw, 56px); font-weight: 800; color: var(--vert-clair); margin: 4px 0; }
.ligne-solde { font-size: clamp(20px, 3vw, 26px); font-weight: 700; margin: 0; }
.ligne-progression { font-size: clamp(16px, 2.4vw, 20px); color: var(--texte-doux); margin: 0; }

.recompenses {
  background: #eafaf3; border: 2px solid var(--vert-clair); border-radius: var(--rayon);
  padding: 16px; margin-top: 6px;
}
.recompenses-titre { font-weight: 700; margin: 0 0 12px; }
.liste-recompenses { display: flex; flex-direction: column; gap: 10px; }
.reco-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: clamp(18px, 2.6vw, 22px); font-weight: 700;
  background: #fff; color: var(--texte); border: 2px solid var(--vert-clair);
  border-radius: 14px; padding: 16px 18px; cursor: pointer; text-align: left;
}
.reco-btn:active { transform: scale(.98); }
.reco-prix { color: var(--vert); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Formulaire */
.bloc-formulaire {
  margin: auto; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: 14px;
}
.label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 17px; }
.champ {
  font-size: 22px; padding: 16px; border: 2px solid var(--bordure);
  border-radius: 14px; background: var(--carte); color: var(--texte); width: 100%;
}
.champ:focus { outline: none; border-color: var(--vert-clair); }
.case { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 500; }
.case input { width: 26px; height: 26px; }
.facultatif { color: var(--texte-doux); font-weight: 400; }

/* Message plein écran */
.icone-message { font-size: 64px; margin: 0; }

/* Voile de chargement */
.voile {
  position: fixed; inset: 0; background: rgba(255, 255, 255, .6);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.spinner {
  width: 56px; height: 56px; border: 6px solid var(--bordure);
  border-top-color: var(--vert); border-radius: 50%; animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #101613; --carte: #18201d; --texte: #eaf1ee; --texte-doux: #9fb0aa;
    --bordure: #2c3a35;
  }
  .touche:active { background: #202b27; }
  .recompenses { background: #14261f; }
  .reco-btn { background: #18201d; }
}
