/* Borne de commande iPad – Bob VR Experience */

:root {
  --rouge: #EE1D25;          /* rouge du logo */
  --rouge-fonce: #C8141B;
  --rouge-pale: #FDE8E9;
  --noir: #111111;
  --gris-fonce: #3A3A3A;     /* bandeau de la carte client */
  --gris: #6B6B6B;
  --gris-clair: #E4E4E2;
  --fond: #F7F7F5;           /* fond de la carte client */
  --blanc: #FFFFFF;
  --nuit: #05070D;           /* ciel de la photo de fond */

  --rayon: 18px;
  --ombre: 0 10px 40px rgba(0, 0, 0, .12);
  --police: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--nuit);
  color: var(--noir);
  font-family: var(--police);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input { font: inherit; -webkit-user-select: text; user-select: text; }

h1 { font-size: 40px; font-weight: 700; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); }

.sous-titre { font-size: 20px; color: var(--gris); margin-top: 8px; }

/* ---------- Fond et écrans ---------- */

.fond {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% center;
}

.voile {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .25);
}

.ecran {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right))
           calc(24px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
}

.ecran.actif { display: flex; }
.ecran.actif .carte { animation: apparition .3s ease-out; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* Chaque écran est une carte posée sur la photo */
.carte {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  max-height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: var(--fond);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

.carte-large { max-width: 1080px; }

.contenu {
  flex: 1;
  padding: 32px 40px 36px;
  overflow-y: auto;
}

/* ---------- Boutons ---------- */

.bouton {
  display: block;
  border-radius: 999px;
  font-weight: 700;
  transition: transform .1s, background-color .15s;
}

.bouton:active { transform: scale(.97); }

.bouton-principal { background: var(--rouge); color: var(--blanc); }
.bouton-principal:active { background: var(--rouge-fonce); }

.bouton-geant { width: 100%; padding: 26px; font-size: 30px; letter-spacing: .02em; }
.bouton-large { width: 100%; padding: 22px; font-size: 24px; margin-top: 32px; }

.bouton-discret {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  font-size: 19px;
  font-weight: 600;
  color: var(--gris-fonce);
  border: 2px solid var(--gris-clair);
}

/* ---------- Écran 1 : Accueil ---------- */

.ecran-accueil { justify-content: flex-end; }

.accueil-panneau {
  display: block;
  width: 440px;
  margin-right: 5vw;
  padding: 36px 36px 30px;
  background: var(--blanc);
  text-align: center;
}

.accueil-logo { width: 190px; }

.accueil-accroche {
  margin: 4px 0 26px;
  font-size: 20px;
  font-weight: 500;
  color: var(--gris);
}

.langues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.langue {
  padding: 16px 8px;
  border-radius: 14px;
  border: 2px solid var(--gris-clair);
  font-size: 20px;
  font-weight: 600;
  transition: border-color .15s, background-color .15s;
}

.langue[aria-pressed="true"] {
  border-color: var(--rouge);
  background: var(--rouge-pale);
  color: var(--rouge-fonce);
}

.drapeau { font-size: 24px; vertical-align: -2px; margin-right: 4px; }

/* iPad en portrait : photo en haut (le bob reste visible), fondue dans le ciel de nuit */
@media (orientation: portrait) {
  .fond { height: 62%; object-position: 35% center; }
  .voile { background: linear-gradient(180deg, rgba(5, 7, 13, .15) 0%, rgba(5, 7, 13, .15) 45%, var(--nuit) 62%); }
  .ecran-accueil { flex-direction: column; justify-content: flex-end; }
  .accueil-panneau { margin: 0 0 4vh; width: min(480px, 100%); }
}

/* ---------- En-tête des écrans 2 à 4 ---------- */

.entete {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: none;
  height: 84px;
  padding: 0 20px;
  background: var(--blanc);
  border-bottom: 1px solid var(--gris-clair);
}

.retour {
  justify-self: start;
  padding: 12px 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--gris-fonce);
}

.entete-marque { display: flex; align-items: center; gap: 12px; }
.entete-marque img { height: 48px; }

.marque { font-size: 26px; font-weight: 800; line-height: .9; letter-spacing: .01em; }
.marque b { color: var(--rouge); }
.marque small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .42em;
}

.etapes {
  justify-self: end;
  display: flex;
  gap: 8px;
  list-style: none;
}

.etapes li {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gris-clair);
  font-size: 17px;
  font-weight: 700;
  color: var(--gris);
}

.etapes li.actif { border-color: var(--rouge); background: var(--rouge); color: var(--blanc); }
.etapes li.fait { border-color: var(--rouge); color: var(--rouge); }

/* ---------- Champs ---------- */

.champ { display: block; margin-top: 28px; }

.champ span {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--gris-fonce);
}

.champ input {
  width: 100%;
  padding: 18px 20px;
  font-size: 26px;
  border: 2px solid var(--gris-clair);
  border-radius: 14px;
  background: var(--blanc);
  color: var(--noir);
  -webkit-text-fill-color: var(--noir);
  outline: none;
  transition: border-color .15s;
}

.champ input:focus { border-color: var(--rouge); }

.message-erreur {
  min-height: 28px;
  margin-top: 12px;
  font-size: 19px;
  font-weight: 600;
  color: var(--rouge-fonce);
}

/* « Vouliez-vous dire … ? » */
.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 10px 10px 10px 18px;
  border: 2px solid var(--rouge);
  border-radius: 16px;
  background: var(--blanc);
  animation: apparition .2s ease-out;
}

.suggestion[hidden] { display: none; }
.suggestion p { flex: 1; font-size: 19px; color: var(--gris-fonce); word-break: break-all; }
.suggestion b { color: var(--noir); }

.suggestion-oui, .suggestion-non {
  flex: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
}

.suggestion-oui { background: var(--rouge); color: var(--blanc); }
.suggestion-non { border: 2px solid var(--gris-clair); color: var(--gris-fonce); }

/* Pendant une suggestion, la ligne d'erreur (vide) ne prend pas de place */
.contenu:has(.suggestion:not([hidden])) .message-erreur { display: none; }

.bouton:disabled { opacity: .6; }

.case {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 19px;
  color: var(--gris-fonce);
}

.case input { position: absolute; opacity: 0; pointer-events: none; }

.case-coche {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid var(--gris-clair);
  background: var(--blanc);
  transition: background-color .15s, border-color .15s;
}

.case input:checked + .case-coche {
  border-color: var(--rouge);
  background: var(--rouge) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 22px no-repeat;
}

/* ---------- Écran 3 : Références ---------- */

/* La carte occupe toute la hauteur et le pavé prend la place restante :
   tout reste visible sans défilement, quelle que soit la taille de l'écran */
#references .carte { height: 100%; }

.contenu-references {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  min-height: 0;
  overflow: hidden;
  padding-top: 24px;
  padding-bottom: 28px;
}

.contenu-references h1 { font-size: clamp(26px, 4vh, 36px); }
.contenu-references .sous-titre { font-size: 17px; margin-top: 4px; }

.references-saisie, .references-liste {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.afficheur {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: clamp(64px, 10vh, 96px);
  margin-top: 16px;
  padding: 0 20px;
  border: 2px solid var(--rouge);
  border-radius: 16px;
  background: var(--blanc);
}

.afficheur-code, .afficheur-attente { font-size: clamp(32px, 5vh, 44px); font-weight: 700; letter-spacing: .06em; line-height: 1.1; }
.afficheur-attente { color: var(--gris-clair); }
.afficheur-aide { font-size: 17px; color: var(--gris); }

.references-saisie .message-erreur { flex: none; min-height: 24px; margin: 6px 0; font-size: 17px; }

.pave {
  flex: 1;
  min-height: 0;
  max-height: 420px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
}

@media (orientation: portrait) {
  .contenu-references { display: flex; flex-direction: column; gap: 16px; }
  .references-saisie { flex: none; }
  .pave { flex: none; height: clamp(250px, 30vh, 380px); }
  .references-liste { flex: 1; }
}

.touche {
  min-height: 0;
  border-radius: 14px;
  background: var(--blanc);
  border: 2px solid var(--gris-clair);
  font-size: 32px;
  font-weight: 600;
  transition: transform .08s, background-color .1s;
}

.touche:active { transform: scale(.95); background: var(--gris-clair); }

.touche-engin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-color: var(--rouge);
  color: var(--rouge-fonce);
}

.touche-engin b { font-size: 32px; line-height: 1; }
.touche-engin small { font-size: 14px; font-weight: 600; }
.touche-engin:active { background: var(--rouge-pale); }

.touche-effacer { color: var(--gris); }
.touche-ajouter { background: var(--noir); border-color: var(--noir); color: var(--blanc); font-size: 22px; }
.touche-ajouter:active { background: var(--gris-fonce); }

.references-liste h2 { flex: none; }

.puces {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin-top: 12px;
}

.puce {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 12px 12px 12px 20px;
  border-radius: 14px;
  background: var(--blanc);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  animation: apparition .2s ease-out;
}

.puce-code { font-size: 30px; font-weight: 700; letter-spacing: .04em; }
.puce-aide { font-size: 17px; color: var(--gris); }

.puce-retirer {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 30px;
  color: var(--gris);
  background: var(--fond);
}

.liste-vide { flex: 1; margin-top: 12px; font-size: 19px; color: var(--gris); }
.liste-vide[hidden] { display: none; }

.references-liste .bouton-large { flex: none; margin-top: 16px; }

/* ---------- Écran 4 : Paiement ---------- */

.contenu-paiement { text-align: center; }

.recap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
  padding: 16px 24px;
  border-radius: var(--rayon);
  background: var(--blanc);
}

.recap-nombre { font-size: 24px; font-weight: 700; }
.recap-references { font-size: 22px; font-weight: 600; letter-spacing: .04em; color: var(--gris-fonce); }

.total { margin: 28px 0 20px; }

.total-montant {
  display: block;
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: var(--rouge);
}

.total-detail { font-size: 20px; color: var(--gris); }

.moyens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.moyen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 170px;
  border-radius: 24px;
  border: 3px solid var(--rouge);
  background: var(--blanc);
  font-size: 28px;
  font-weight: 700;
  transition: transform .1s, background-color .15s, color .15s;
}

.moyen svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--rouge);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.moyen:disabled { opacity: .5; }

/* ---------- Mode gratuit caché ---------- */

.badge-offert {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--noir);
  color: var(--blanc);
  font-size: 16px;
  font-weight: 700;
}

.badge-offert[hidden] { display: none; }

#email.saisie-code .champ-confirmation { display: none; }
.valider-offert { display: none; }
#paiement.mode-offert .valider-offert { display: block; }
#paiement.mode-offert .moyens,
#paiement.mode-offert .paiement-question { display: none; }
.source-qr #merci.mode-offert .merci-accueil { display: none; }

/* ---------- Mode Entreprise ---------- */

.grille-formulaire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
}

.grille-formulaire .large { grid-column: 1 / -1; }

.ligne-ville {
  display: grid;
  grid-template-columns: 170px 1fr 1fr;
  column-gap: 20px;
}

#entreprise .champ, #entreprise-contact .champ { margin-top: 14px; }
#entreprise .champ span, #entreprise-contact .champ span { margin-bottom: 6px; font-size: 16px; }
#entreprise .champ input, #entreprise-contact .champ input { padding: 12px 16px; font-size: 21px; }

.champ input.invalide { border-color: var(--rouge); background: var(--rouge-pale); }

.quantite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 10px 12px 10px 24px;
  border-radius: var(--rayon);
  background: var(--blanc);
}

.quantite-libelle { font-size: 20px; font-weight: 600; }
.compteur { display: flex; align-items: center; gap: 8px; }
.compteur output { min-width: 64px; font-size: 34px; font-weight: 700; text-align: center; }

.compteur-bouton {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--rouge);
  color: var(--rouge);
  font-size: 32px;
  line-height: 1;
}

.compteur-bouton:disabled { border-color: var(--gris-clair); color: var(--gris-clair); }

#entreprise-contact .sous-titre + .moyens { margin-top: 10px; }
.moyens-trois { grid-template-columns: repeat(3, 1fr); }
#entreprise-contact .moyen { height: 116px; gap: 8px; font-size: 22px; }
#entreprise-contact .moyen svg { width: 46px; height: 46px; }

.contenu-paiement .message-erreur { margin-top: 10px; min-height: 24px; color: var(--gris-fonce); }
.moyen:active { transform: scale(.97); background: var(--rouge); color: var(--blanc); }
.moyen:active svg { stroke: var(--blanc); }

/* ---------- Écran 5 : Merci ---------- */

.merci {
  display: block;
  max-width: 820px;
  padding: 56px 48px 44px;
  background: var(--blanc);
  text-align: center;
}

.merci-coche {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin: 0 auto 32px;
  border-radius: 50%;
  background: var(--rouge);
  animation: rebond .45s cubic-bezier(.3, 1.6, .5, 1);
}

.merci-coche svg {
  width: 72px;
  fill: none;
  stroke: var(--blanc);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes rebond { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

.merci-numero {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--noir);
  color: var(--blanc);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .03em;
}

.merci-numero:empty { display: none; }

.merci h1 { font-size: 52px; }
.merci-email { margin-top: 10px; font-size: 26px; font-weight: 700; }
.merci-recap { margin-top: 6px; font-size: 20px; color: var(--gris-fonce); }
.merci-retour { margin-top: 40px; font-size: 18px; color: var(--gris); }

.merci-accueil {
  display: none;
  margin-top: 28px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--rouge-pale);
  color: var(--rouge-fonce);
  font-size: 20px;
  font-weight: 700;
}

/* ---------- QR code de l'accueil ---------- */

.qr-carte {
  position: absolute;
  left: calc(24px + env(safe-area-inset-left));
  bottom: calc(24px + env(safe-area-inset-bottom));
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: auto;
  max-width: 340px;
  padding: 14px 20px 14px 14px;
  background: var(--blanc);
  border-radius: 20px;
}

.qr { flex: none; width: 116px; height: 116px; }
.qr svg { display: block; width: 100%; height: 100%; }

.qr-texte { font-size: 16px; line-height: 1.3; color: var(--gris-fonce); }
.qr-titre { font-size: 20px; font-weight: 700; color: var(--noir); margin-bottom: 4px; }

@media (orientation: portrait) {
  .qr-carte {
    left: auto;
    right: calc(24px + env(safe-area-inset-right));
    bottom: auto;
    top: calc(24px + env(safe-area-inset-top));
  }
}

/* Le QR code n'a pas de sens sur le téléphone du client */
.source-qr .qr-carte, .source-qr .merci-retour { display: none; }
.source-qr .merci-accueil { display: block; }

/* ---------- Écrans peu hauts (Safari avec barre d'adresse, petits iPad) ---------- */

@media (max-height: 820px) {
  .contenu { padding: 24px 36px 28px; }
  h1 { font-size: 34px; }
  .champ { margin-top: 18px; }
  .champ input { padding: 14px 18px; }
  .bouton-large { margin-top: 20px; padding: 18px; }
  .recap { margin-top: 16px; padding-top: 12px; padding-bottom: 12px; }
  .total { margin: 16px 0 12px; }
  .total-montant { font-size: 72px; }
  .moyen { height: 130px; font-size: 24px; }
  .moyen svg { width: 52px; height: 52px; }
  .accueil-panneau { padding: 26px 32px 24px; }
  .accueil-logo { width: 150px; }
  .accueil-accroche { margin-bottom: 18px; }
  .bouton-geant { padding: 20px; font-size: 26px; }
}

/* ---------- Téléphone (client arrivé par le QR code) ---------- */

@media (max-width: 600px) {
  .ecran { padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
  .carte { border-radius: 20px; }
  .contenu, .contenu-references { padding: 20px 18px 22px; }
  h1, .contenu-references h1 { font-size: 26px; }
  .sous-titre { font-size: 16px; }

  .entete { height: 64px; padding: 0 10px; }
  .retour { padding: 8px; font-size: 17px; }
  .entete-marque img { height: 36px; }
  .marque { display: none; }
  .etapes li { width: 30px; height: 30px; font-size: 15px; }

  .accueil-panneau { margin: 0 0 2vh; padding: 24px 20px 20px; }
  .accueil-logo { width: 130px; }
  .langue { font-size: 17px; padding: 12px 6px; }
  .bouton-geant { padding: 18px; font-size: 24px; }

  .champ span { font-size: 16px; }
  .champ input { font-size: 19px; padding: 13px 14px; }
  .case { font-size: 16px; }
  .suggestion { flex-wrap: wrap; padding: 12px; }
  .suggestion p { flex-basis: 100%; font-size: 17px; }
  .suggestion-oui, .suggestion-non { flex: 1; padding: 10px; font-size: 16px; }
  .bouton-large { font-size: 20px; padding: 16px; }

  .pave { height: clamp(220px, 34vh, 320px); gap: 6px; }
  .touche { font-size: 26px; }
  .touche-engin b { font-size: 24px; }
  .touche-engin small { font-size: 11px; }
  .touche-ajouter { font-size: 18px; }
  .puce { gap: 10px; padding: 8px 8px 8px 14px; }
  .puce-code { font-size: 22px; }
  .puce-aide { font-size: 14px; }
  .puce-retirer { width: 40px; height: 40px; }

  .recap-nombre { font-size: 20px; }
  .recap-references { font-size: 18px; }
  .total-montant { font-size: 60px; }
  .moyens { gap: 10px; }
  .moyen { height: 110px; font-size: 20px; border-radius: 18px; }
  .moyen svg { width: 42px; height: 42px; }

  .grille-formulaire { grid-template-columns: 1fr; }
  .ligne-ville { grid-template-columns: 110px 1fr; column-gap: 10px; }
  .ligne-ville .champ:last-child { grid-column: 1 / -1; }
  #entreprise .champ input, #entreprise-contact .champ input { font-size: 18px; padding: 11px 12px; }
  .quantite { padding-left: 14px; }
  .quantite-libelle { font-size: 16px; text-align: left; }
  .compteur-bouton { width: 46px; height: 46px; font-size: 26px; }
  .compteur output { min-width: 46px; font-size: 26px; }
  #entreprise-contact .moyen { height: 96px; font-size: 16px; }
  #entreprise-contact .moyen svg { width: 36px; height: 36px; }

  .merci { padding: 36px 20px 28px; }
  .merci-coche { width: 96px; height: 96px; margin-bottom: 20px; }
  .merci-coche svg { width: 54px; }
  .merci h1 { font-size: 32px; }
  .merci-email { font-size: 19px; word-break: break-all; }
  .merci-recap { font-size: 17px; }
  .merci-accueil { font-size: 17px; }
}
