:root {
  --bleu: #0b4ea2; --bleu-pale: #e8effa; --encre: #14213d; --pale: #5b6478;
  --fond: #f5f7fb; --trait: #d6dce8; --rouge: #b42318; --vert: #067647; --jaune: #f7b500;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--encre);
  background: var(--fond); min-height: 100vh; display: flex; flex-direction: column; }
.barre { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bleu); color: #fff;
  font-weight: 700; font-size: 18px; padding-top: max(12px, env(safe-area-inset-top)); }
/* Liseré aux couleurs du drapeau */
.logo { width: 22px; height: 22px; border-radius: 6px; background:
  linear-gradient(135deg, #007fff 0 42%, #f7d618 42% 48%, #ce1021 48% 56%, #f7d618 56% 62%, #007fff 62%); }
main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 16px 8px; }
h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 12px; }
p { margin: 8px 0; }
.intro { font-size: 18px; }
.pale { color: var(--pale); font-size: 15px; }
.centre { text-align: center; }
.vue { display: flex; flex-direction: column; gap: 10px; }
.vue[hidden] { display: none; }

button, .principal, .second { font: inherit; }
.principal, .second { min-height: 52px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-weight: 700; text-decoration: none; cursor: pointer; padding: 0 16px; }
.principal { background: var(--bleu); color: #fff; border: 0; }
.principal:disabled { background: #9db4d6; cursor: not-allowed; }
.second { background: #fff; color: var(--bleu); border: 2px solid var(--bleu); }
.lien { background: none; border: 0; color: var(--bleu); text-decoration: underline; min-height: 44px; cursor: pointer; }

.exemple { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; margin: 6px 0 10px;
  background: #fff; border: 1px dashed var(--trait); border-radius: 12px; }
.exemple strong { font: 700 22px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; }

.liste { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.case { display: flex; gap: 10px; align-items: center; min-height: 48px; font-weight: 600; }
.case input { width: 22px; height: 22px; accent-color: var(--bleu); }

.etat { padding: 10px 12px; border-radius: 10px; background: #fff7e0; border: 1px solid var(--jaune); margin: 0; }
.etat.ok { background: #e7f6ee; border-color: var(--vert); }
.carte { height: 46vh; min-height: 260px; border-radius: 12px; border: 1px solid var(--trait); }

.photo-zone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 170px;
  border: 2px dashed var(--bleu); border-radius: 12px; background: var(--bleu-pale); color: var(--bleu);
  font-weight: 700; cursor: pointer; overflow: hidden; text-align: center; padding: 10px; }
.photo-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-zone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.etiquette { font-weight: 600; font-size: 15px; margin-top: 4px; }
input:not([type]), input[type=text], textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--trait);
  border-radius: 10px; background: #fff; min-height: 48px; }
details { background: #fff; border: 1px solid var(--trait); border-radius: 10px; padding: 8px 12px; }
details[open] { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choix button { min-height: 48px; border-radius: 10px; border: 1px solid var(--trait); background: #fff; font-weight: 600;
  cursor: pointer; color: var(--encre); }
.choix button[aria-checked=true] { background: var(--bleu); color: #fff; border-color: var(--bleu); }

.erreur { color: var(--rouge); font-weight: 600; margin: 4px 0; }
.erreur:empty { display: none; }
.info { background: var(--bleu-pale); padding: 10px 12px; border-radius: 10px; }
.photo-doublon { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; }

.code-grand { font: 800 30px/1.1 ui-monospace, Menlo, Consolas, monospace; text-align: center; letter-spacing: .5px;
  margin: 2px 0; word-break: break-all; }
.qr { display: flex; justify-content: center; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--trait); }
.qr img, .qr svg { width: 200px; height: 200px; image-rendering: pixelated; }
.boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.adresse { background: #fff; border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px; }
.adresse .code { font: 700 19px ui-monospace, Menlo, Consolas, monospace; }
.adresse .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adresse .actions > * { flex: 1 1 120px; min-height: 44px; font-size: 15px; }
.supprimer { color: var(--rouge); border-color: var(--rouge); }

footer { text-align: center; font-size: 12px; color: var(--pale); padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
