:root {
  --vert: #1e7b34;
  --vert-fonce: #145a25;
  --vert-doux: #e3f0e5;
  --vert-bord: #bfdcc5;
  --orange: #f28c1b;
  --rouge: #c62828;
  --rouge-doux: #fdecea;
  --fond: #f4f7f4;
  --carte: #ffffff;
  --gris: #f1f4f1;
  --texte: #1b1f1c;
  --texte-2: #5f6b62;
  --texte-3: #9aa59d;
  --bord: #e3e8e4;
  --rayon: 18px;
  --ombre: 0 3px 12px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 22px; margin-bottom: 6px; }
h3 { font-size: 18px; margin-bottom: 12px; }
.mt { margin-top: 28px; }
.sous { color: var(--texte-2); margin: 0 0 18px; line-height: 1.4; }
.petit-txt { color: var(--texte-3); font-size: 13px; text-align: center; margin: 10px 0 0; }
.vue { min-height: 100%; }

/* Logo (points comme celui de la mutuelle) */
.logo { position: relative; width: 42px; height: 42px; display: inline-block; flex: none; }
.logo i { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--vert); }
.logo i:nth-child(1) { left: 0; top: 14px; background: var(--orange); }
.logo i:nth-child(2) { left: 14px; top: 0; }
.logo i:nth-child(3) { left: 28px; top: 14px; }
.logo i:nth-child(4) { left: 14px; top: 28px; }
.logo i:nth-child(5) { left: 14px; top: 14px; background: #7bb661; }
.logo.petit { transform: scale(0.7); margin: -6px; }

/* Connexion */
.connexion { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.marque { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.marque h1 { font-size: 30px; }
.marque p { margin: 2px 0 0; color: var(--texte-2); }
.aide { color: var(--texte-3); font-size: 13px; text-align: center; margin-top: 16px; }

/* Cartes, champs, boutons */
.carte { background: var(--carte); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: 14px; color: var(--texte-2); margin-bottom: 14px; }
input {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 17px; color: var(--texte);
  padding: 14px; border: 1px solid var(--bord); border-radius: 12px; background: var(--gris); outline: none;
}
input:focus { border-color: var(--vert); background: #fff; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 14px; padding: 15px; font: inherit; font-size: 16px;
  font-weight: 700; cursor: pointer; margin-top: 10px;
}
.btn-primaire { background: var(--vert); color: #fff; }
.btn-primaire:active { background: var(--vert-fonce); }
.btn-primaire:disabled { opacity: 0.55; cursor: default; }
.btn-secondaire { background: var(--vert-doux); color: var(--vert); }
.erreur { background: var(--rouge-doux); color: var(--rouge); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.ligne { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.ligne input { margin: 0; font-size: 14px; }
.ligne .btn { width: auto; margin: 0; padding: 13px 16px; }

/* En-tête + barre d'onglets */
.entete {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--bord);
}
.entete-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.entete-txt strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-txt small { color: var(--texte-2); }
.icone-btn { border: 0; background: var(--gris); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.icone-btn svg { width: 22px; height: 22px; fill: var(--texte-2); }
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 110px; }
.barre {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: #fff; border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom);
}
.barre button {
  flex: 1; border: 0; background: none; padding: 10px 0 12px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--texte-3); display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
}
.barre svg { width: 26px; height: 26px; fill: currentColor; }
.barre button.actif { color: var(--vert); }

/* Contrôle */
.gros-btn {
  width: 100%; border: 0; border-radius: 22px; background: var(--vert); color: #fff; padding: 34px 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 12px; font: inherit; font-size: 20px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(30, 123, 52, 0.25);
}
.gros-btn svg { width: 64px; height: 64px; fill: #fff; }
.test { margin-top: 22px; color: var(--texte-3); font-size: 14px; }
.test summary { cursor: pointer; }
.camera { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 65vh; margin: 0 auto; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viseur { position: absolute; inset: 18% 14%; border: 4px solid #fff; border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.camera-txt { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 600; margin: 0; }

/* Verdict */
.verdict { border-radius: 22px; padding: 22px; color: #fff; display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.verdict.ok { background: var(--vert); }
.verdict.ko { background: var(--rouge); }
.verdict .pastille { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; font-size: 30px; flex: none; }
.verdict b { font-size: 26px; display: block; letter-spacing: 0.5px; }
.verdict span { opacity: 0.95; }
.membre { display: flex; gap: 14px; align-items: center; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--vert-doux); color: var(--vert); display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.membre .nom { font-size: 18px; font-weight: 700; }
.membre .mat { color: var(--texte-2); margin: 2px 0 8px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--vert-doux); color: var(--vert); }
.pill.ko { background: var(--rouge-doux); color: var(--rouge); }

.offres { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.offre { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--bord); border-radius: 14px; cursor: pointer; margin: 0; color: var(--texte); font-size: 15px; }
.offre input { width: 20px; height: 20px; margin: 0; accent-color: var(--vert); flex: none; }
.offre .titre { flex: 1; font-weight: 600; }
.offre .badge { background: var(--orange); color: #fff; font-weight: 800; border-radius: 99px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.offre:has(input:checked) { border-color: var(--vert); background: var(--vert-doux); }
.calcul { background: var(--gris); border-radius: 14px; padding: 6px 14px; margin-bottom: 4px; }
.calcul div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--bord); }
.calcul div:last-child { border-bottom: 0; }
.calcul .vert { color: var(--vert); }
.calcul .total { font-size: 19px; }

.recu { text-align: center; }
.recu-ok { width: 72px; height: 72px; border-radius: 50%; background: var(--vert); color: #fff; font-size: 40px; display: grid; place-items: center; margin: 4px auto 12px; }
.recu .calcul { text-align: left; }

/* Historique / stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.stat { background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--ombre); }
.stat small { color: var(--texte-2); display: block; }
.stat b { font-size: 20px; }
.stat.vert b { color: var(--vert); }
.tx { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--ombre); margin-bottom: 10px; }
.tx .avatar { width: 44px; height: 44px; font-size: 15px; }
.tx .info { flex: 1; min-width: 0; }
.tx .info b { display: block; }
.tx .info small { color: var(--texte-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .montants { text-align: right; }
.tx .montants b { color: var(--vert); display: block; }
.tx .montants small { color: var(--texte-3); }
.vide { text-align: center; color: var(--texte-3); padding: 30px 10px; }
.mes-offres .offre { cursor: default; background: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--texte); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px);
}
