/* Fiche de restitution — pensée pour un pouce, à l'atelier, parfois avec des gants. */
:root {
  color-scheme: light;
  --bleu: #0d4d8c;
  --bleu-clair: #e8f0f8;
  --rouge: #c0392b;
  --rouge-clair: #fbeceb;
  --vert: #1e8e4e;
  --orange: #e08a00;
  --gris: #6b7280;
  --trait: #d9dee5;
  --fond: #f2f4f7;
  --texte: #1a1a1a;
  --rayon: 14px;
  --pied: calc(128px + env(safe-area-inset-bottom));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }

/* --- barre du haut -------------------------------------------------------- */
.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: #fff; border-bottom: 1px solid var(--trait);
}
.logo { height: 34px; }
.barre-texte { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.barre-texte strong { color: var(--bleu); font-size: 17px; }
.barre-texte span { color: var(--gris); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pastille {
  font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: #fff4e0; color: #8a5300; white-space: nowrap;
}

.lien-admin {
  font-size: 13px; font-weight: 700; color: var(--bleu); text-decoration: none;
  padding: 6px 10px; border: 1.5px solid var(--bleu); border-radius: 999px; white-space: nowrap;
}

/* --- écrans et cartes ----------------------------------------------------- */
.ecran { padding: 12px 12px var(--pied); max-width: 640px; margin: 0 auto; }
#ecran-inscription { padding-bottom: 24px; }
.carte { background: #fff; border-radius: var(--rayon); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgb(0 0 0 / 6%); }
.carte.centre { text-align: center; padding: 28px 18px; }
h1 { font-size: 21px; margin: 0 0 8px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--bleu); margin: 0 0 12px; }
h2 small { text-transform: none; letter-spacing: 0; color: var(--gris); font-weight: 400; font-size: 13px; }
.erreur { color: var(--rouge); font-weight: 600; }
.etapes { padding-left: 22px; margin: 0 0 12px; }
.etapes li { margin-bottom: 8px; }
.code-invitation { text-align: center; font: 700 32px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; color: var(--bleu); background: var(--bleu-clair); border-radius: 12px; padding: 14px; margin: 8px 0; }
.aide { text-align: center; color: var(--gris); font-size: 14px; margin: 0; }
.form-code { display: grid; gap: 10px; margin-top: 14px; }
.form-code input { text-align: center; font: 700 24px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }

.installer { border: 2px solid var(--bleu); }
.installer p { margin: 6px 0 0; font-size: 15px; }
.installer-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.installer-actions .principal { flex: 1; min-height: 48px; }
.installer-actions .lien { margin: 0; }

/* --- champs ----------------------------------------------------------------- */
.champ { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 12px; }
.champ small { font-weight: 400; color: var(--gris); }
input, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 12px;
  font: inherit; font-size: 17px; /* 17 px : iOS ne zoome pas au focus */
  color: var(--texte); background: #fff;
  border: 1.5px solid var(--trait); border-radius: 10px; min-height: 48px;
}
input:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-clair); }
input[name="numero_or"], input[name="immatriculation"] { text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
textarea { resize: vertical; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.manque { border-color: var(--rouge) !important; box-shadow: 0 0 0 3px var(--rouge-clair) !important; }

.alerte-carburant {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1.5px solid var(--trait); border-radius: 10px; font-weight: 600; min-height: 52px;
}
.alerte-carburant input { width: 26px; height: 26px; min-height: 0; margin: 0; accent-color: var(--rouge); flex: none; }
.alerte-carburant:has(input:checked) { border-color: var(--rouge); background: var(--rouge-clair); color: var(--rouge); }

/* --- pneus : vue de dessus, avant en haut ----------------------------------- */
.pneus { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; }
.pneus .pneu:nth-of-type(1) { grid-column: 1; grid-row: 1; }
.pneus .pneu:nth-of-type(2) { grid-column: 3; grid-row: 1; }
.pneus .dot:nth-of-type(3) { grid-column: 2; grid-row: 1; }
.pneus .pneu:nth-of-type(4) { grid-column: 1; grid-row: 2; }
.pneus .pneu:nth-of-type(5) { grid-column: 3; grid-row: 2; }
.pneus .dot:nth-of-type(6) { grid-column: 2; grid-row: 2; }
.pneu, .dot { position: relative; font-size: 12px; font-weight: 700; color: var(--gris); text-align: center; text-transform: uppercase; }
.pneu input, .dot input { text-align: center; font-weight: 700; font-size: 20px; padding: 10px 6px; }
.pneu input { padding-right: 22px; background: var(--bleu-clair); }
.pneu span { position: absolute; right: 9px; bottom: 14px; color: var(--gris); font-size: 14px; }

/* --- vérifications : OK / NON / N/A --------------------------------------- */
.verif { padding: 12px 0; border-top: 1px solid var(--trait); }
.verif:first-child { border-top: 0; padding-top: 0; }
.verif-libelle { font-weight: 600; margin-bottom: 8px; }
.choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choix button {
  min-height: 50px; font: inherit; font-weight: 700; font-size: 16px;
  border: 1.5px solid var(--trait); border-radius: 10px; background: #fff; color: #374151;
}
.choix button[aria-pressed="true"][data-valeur="ok"] { background: var(--vert); border-color: var(--vert); color: #fff; }
.choix button[aria-pressed="true"][data-valeur="non"] { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.choix button[aria-pressed="true"][data-valeur="na"] { background: var(--gris); border-color: var(--gris); color: #fff; }
.choix.couleur button { font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.pastille-couleur { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgb(0 0 0 / 20%); }
.choix.couleur button[aria-pressed="true"] { border-color: var(--bleu); background: var(--bleu-clair); color: var(--bleu); box-shadow: 0 0 0 2px var(--bleu); }
.choix.manque button { border-color: var(--rouge); }
.note-lien { background: none; border: 0; padding: 8px 0 0; color: var(--bleu); font: inherit; font-size: 14px; font-weight: 600; }
.note { margin-top: 8px; }

/* --- ressenti --------------------------------------------------------------- */
.humeurs { display: flex; justify-content: space-around; }
.humeur {
  width: 72px; height: 72px; border-radius: 50%; font-size: 38px; line-height: 1;
  border: 3px solid transparent; background: var(--fond); filter: grayscale(1); opacity: .55;
}
.humeur[aria-pressed="true"] { filter: none; opacity: 1; }
.humeur[data-humeur="sad"][aria-pressed="true"] { background: #fde2df; border-color: var(--rouge); }
.humeur[data-humeur="neutral"][aria-pressed="true"] { background: #fff1d6; border-color: var(--orange); }
.humeur[data-humeur="happy"][aria-pressed="true"] { background: #dcf3e5; border-color: var(--vert); }

.lien { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--gris); font: inherit; font-size: 14px; text-decoration: underline; padding: 12px; }

/* --- pied collant : progression + certification ------------------------------ */
.pied {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--trait);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px;
}
.progression { height: 6px; background: var(--fond); border-radius: 99px; overflow: hidden; }
#jauge { height: 100%; width: 0; background: var(--vert); transition: width .2s; }
#compte { font-size: 13px; font-weight: 600; color: var(--gris); }
.principal {
  grid-column: 1 / -1; min-height: 54px; border: 0; border-radius: 12px;
  background: var(--bleu); color: #fff; font: inherit; font-weight: 700; font-size: 17px;
}
.principal:active { transform: translateY(1px); }
.principal.incomplet { background: #8aa6c4; }

/* --- message éphémère ---------------------------------------------------------- */
.toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--pied) + 8px); z-index: 20;
  max-width: 616px; margin: 0 auto; padding: 14px 16px; border-radius: 12px;
  background: #1f2937; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
}
.toast.ok { background: var(--vert); }
.toast.ko { background: var(--rouge); }
