/* Caisse Event Solutions — design de l'app CRM (nuit + indigo), taillé pour le
   TACTILE : tablette 10" = grille + panier côte à côte ; téléphone = panier en
   bandeau bas. Grandes cibles, gros chiffres. */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
/* Nos écrans/voiles posent leur propre display (grid/flex) qui ÉCRASE l'attribut
   hidden — sans cette règle, la caméra noire recouvrait la page au chargement
   (bug vécu 25/08, même leçon que la modale photo du site). */
[hidden] { display: none !important; }
:root {
  --nuit: #0e1230; --nuit2: #171c40; --shell: #eef1f7; --encre: #0f172a;
  --gris: #64748b; --liseret: #e2e8f0; --indigo: #4f46e5; --bleu: #2563eb;
  --vert: #059669; --rouge: #dc2626;
}
html, body { height: 100%; }
body { background: var(--shell); color: var(--encre); font: 15px/1.4 'Inter', system-ui, sans-serif;
  user-select: none; overscroll-behavior: none; }
.mono { font-family: 'JetBrains Mono', monospace; }
button { font: inherit; border: 0; cursor: pointer; background: none; }

/* ── Ouverture ── */
#ecranLogin { min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(160deg, var(--nuit), var(--nuit2)); }
.login-carte { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4); display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.brand-es { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo), var(--bleu)); color: #fff; font-size: 14px; }
.brand-tag { margin-left: auto; background: #eef2ff; color: var(--indigo); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em; padding: 4px 10px; border-radius: 99px; }
.login-carte label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.login-carte input { border: 1px solid var(--liseret); border-radius: 14px; padding: 16px; font: inherit;
  font-family: 'JetBrains Mono', monospace; font-size: 20px; text-align: center; letter-spacing: .12em; outline: none; }
.login-carte input:focus { border-color: var(--indigo); }
.btn-xl { padding: 18px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, var(--indigo), var(--bleu)); }
.err { color: var(--rouge); font-weight: 600; font-size: 14px; }

/* ── Caisse ── */
#ecranCaisse { display: flex; flex-direction: column; height: 100dvh; }
.haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  background: linear-gradient(90deg, var(--nuit), var(--nuit2)); color: #fff; }
.haut-infos { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.haut-infos b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.haut-infos .mono { color: #a5b4fc; font-size: 12px; }
.btn-lien { color: rgba(255,255,255,.7); font-weight: 700; font-size: 14px; padding: 8px 10px; }

.onglets { display: flex; gap: 8px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.onglets button { flex: 0 0 auto; padding: 12px 20px; border-radius: 14px 14px 0 0; font-weight: 800; font-size: 15px;
  color: var(--gris); background: #e3e8f2; }
.onglets button.actif { background: #fff; color: var(--indigo); }

.corps { flex: 1; display: flex; min-height: 0; background: #fff; }
.grille { flex: 1; overflow-y: auto; display: grid; gap: 10px; padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; }
.article { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 96px;
  border: 1px solid var(--liseret); border-radius: 16px; padding: 12px; text-align: left;
  background: var(--shell); transition: transform .06s; }
.article:active { transform: scale(.96); background: #e0e7ff; }
.article b { font-size: 15px; line-height: 1.25; }
.article .prix { display: flex; align-items: baseline; gap: 6px; }
.article .prix b { font-family: 'JetBrains Mono', monospace; font-size: 18px; color: var(--indigo); }
.article .prix span { font-size: 12px; color: var(--gris); }
.article.pack { background: #eef2ff; border-color: #c7d2fe; }

/* Panier : colonne à droite (tablette paysage), bandeau bas (portrait/téléphone) */
.panier { display: flex; flex-direction: column; width: 340px; border-left: 1px solid var(--liseret); background: #fff; }
.panier-lignes { flex: 1; overflow-y: auto; padding: 10px 14px; display: grid; gap: 8px; align-content: start; }
.ligne { display: flex; align-items: center; gap: 8px; }
.ligne b { flex: 1; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .qte { display: flex; align-items: center; gap: 2px; }
.ligne .qte button { width: 34px; height: 34px; border-radius: 10px; background: var(--shell); font-weight: 800; font-size: 17px; }
.ligne .qte span { min-width: 26px; text-align: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.ligne .lj { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--indigo); min-width: 44px; text-align: right; }
.panier-vide { padding: 20px; color: #94a3b8; text-align: center; font-weight: 600; }
.panier-pied { border-top: 1px solid var(--liseret); padding: 12px 14px; display: grid; gap: 10px; }
.total { display: flex; align-items: baseline; justify-content: space-between; }
.total-jetons b { font-family: 'JetBrains Mono', monospace; font-size: 28px; color: var(--encre); }
.total-euros { color: var(--gris); font-size: 14px; }
.panier-btns { display: flex; gap: 8px; }
.btn-vider { width: 56px; border-radius: 14px; background: #fee2e2; color: var(--rouge); font-weight: 800; font-size: 18px; }
.btn-payer { flex: 1; padding: 18px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 20px;
  letter-spacing: .06em; background: linear-gradient(135deg, var(--indigo), var(--bleu)); }
.btn-payer:disabled { opacity: .4; }

@media (max-width: 760px), (orientation: portrait) and (max-width: 1000px) {
  .corps { flex-direction: column; }
  .grille { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .panier { width: auto; max-height: 42dvh; border-left: 0; border-top: 2px solid var(--liseret); }
}

/* ── Caméra ── */
#voileCam { position: fixed; inset: 0; z-index: 50; background: #000; display: grid; place-items: center; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-cadre { position: relative; width: min(62vmin, 340px); height: min(62vmin, 340px);
  border: 3px solid rgba(255,255,255,.9); border-radius: 24px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.45); }
.cam-aide { position: absolute; bottom: 96px; color: #fff; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.btn-cam-stop { position: absolute; top: 18px; right: 18px; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; font-size: 22px; font-weight: 800; backdrop-filter: blur(4px); }

/* ── Verdict ── */
#voileOk { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
#voileOk.ok  { background: rgba(5,150,105,.96); }
#voileOk.ko  { background: rgba(220,38,38,.96); }
.verdict { text-align: center; color: #fff; }
.v-icone { font-size: 84px; line-height: 1; }
.v-titre { margin-top: 10px; font-size: 26px; font-weight: 800; }
.v-detail { margin-top: 4px; font-size: 16px; opacity: .85; }
.v-solde { margin-top: 16px; font-family: 'JetBrains Mono', monospace; font-size: 34px; font-weight: 700; }
