/* Collecte terrain Safe Tourist — charte « Indigo d'Abomey », mode sable (lisible en plein soleil).
   Maquettes CW1 → CW7 (canevas V2, rangée 8). Polices système de repli : aucune ressource externe. */
:root {
  --indigo: #16205b; --indigo-2: #1e2766; --night: #0b0f2e;
  --sand: #f3ece2; --sand-2: #f8f3eb; --sand-line: #efe6d8; --sand-border: #e7dcc8;
  --ink: #16205b; --ink-2: #3c4166; --ink-3: #5b6080; --ink-4: #7a7f9f;
  --terra: #e07a5f; --terra-2: #c4512f; --terra-dark: #b5482f; --terra-bg: #fbe6df;
  --mint: #2a8f7b; --mint-bg: #e3f6f1; --mint-2: #6fd3c0;
  --gold-text: #8a6514; --gold-bg: #fff4dc; --amber: #d49a1e;
  --red: #b5302a; --blue: #2f3fa0; --blue-bg: #e4e7fa;
  --radius: 24px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sand); color: var(--ink); font: 15px/1.45 var(--text); }
[hidden] { display: none !important; }
a { color: var(--terra-dark); text-decoration: none; }
a:hover { color: #8e3520; }
button { font: inherit; }
.d { font-family: var(--display); letter-spacing: -.015em; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--terra-dark); }
.error { color: var(--red); min-height: 20px; margin: 0; font-weight: 600; }
.pattern { position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M0 16 L8 8 L16 16 L24 8 L32 16' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3Cpath d='M16 22 L20 26 L16 30 L12 26 Z' fill='%23fff'/%3E%3C/svg%3E"); }
:focus-visible { outline: 3px solid #e6cb96; outline-offset: 2px; }

/* Marque */
.brand { position: relative; display: flex; align-items: center; gap: 10px; }
.brand b { display: block; font: 800 17px var(--display); }
.brand small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .16em; color: #f6d9b0; }
.logo { width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%23F3ECE2'/%3E%3Cpath d='M32 9 L51 16 V31 C51 44 43 52 32 56 C21 52 13 44 13 31 V16 Z' fill='%2316205B'/%3E%3Cpath d='M32 20 L43 32 L32 44 L21 32 Z' fill='%23E07A5F'/%3E%3Cpath d='M32 27 L37 32 L32 37 L27 32 Z' fill='%23F3ECE2'/%3E%3C/svg%3E") center/cover; }
.on-dark { color: #fff; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--sand-border); background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(150deg, #ee8a6e, var(--terra-2)); box-shadow: 0 14px 28px -16px var(--terra-2); }
.btn.primary:hover { color: #fff; filter: brightness(1.05); }
.btn.dark { border: 0; background: var(--indigo); color: #fff; }
.btn.ok { border: 0; background: var(--mint-2); color: #0b2b26; }
.btn.ghost-dark { background: transparent; border: 1px solid rgba(255,255,255,.24); color: #fff; }
.btn.big { height: 56px; font-size: 17px; border-radius: 18px; }
.btn.small { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.btn.terra-soft { border: 0; background: var(--terra-bg); color: var(--terra-dark); }

/* Champs */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 700; border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 8px; }
input, select, textarea { font: 500 15px var(--text); color: var(--ink); background: #fff; border: 1.5px solid var(--sand-border); border-radius: 14px; height: 48px; padding: 0 14px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 4px rgba(224,122,95,.18); }
.input-ic { position: relative; display: block; }
.input-ic .ic { position: absolute; left: 16px; top: 16px; color: var(--ink-4); }
.input-ic input { padding-left: 48px; height: 54px; font-weight: 700; font-size: 17px; letter-spacing: .06em; }
.pin { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pin input { height: 58px; padding: 0; text-align: center; font: 800 24px var(--text); }
.pin input:placeholder-shown { background: var(--sand-2); border-style: dashed; }

/* Connexion */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-visual { position: relative; flex: 1 1 520px; min-height: 380px; overflow: hidden; background: var(--indigo); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 48px clamp(24px, 5vw, 56px); }
.login-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-veil { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(22,32,91,.55), rgba(22,32,91,.85) 55%, var(--indigo)); }
.login-pitch { position: relative; max-width: 560px; padding: 24px 0; }
.login-pitch h1 { margin: 0; font-size: clamp(32px, 4.4vw, 58px); line-height: 1.03; font-weight: 800; }
.login-pitch p { margin: 16px 0 0; font-size: 17px; line-height: 1.5; color: #d7daf0; max-width: 460px; }
.login-form-wrap { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.login-form h2 { margin: 8px 0 0; font-size: 32px; font-weight: 800; }
.login-form p { margin: 6px 0 0; }
.note { padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--sand-line); display: flex; gap: 12px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.note b { color: var(--ink); }
.note-ic { width: 36px; height: 36px; border-radius: 12px; background: var(--mint-bg); color: var(--mint); display: flex; align-items: center; justify-content: center; flex: none; }

/* Coque : menu + contenu */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { position: relative; flex: 1 1 248px; max-width: 100%; overflow: hidden; background: var(--indigo); color: #fff; padding: 28px 18px; display: flex; flex-direction: column; gap: 24px; }
.side .brand { padding: 0 6px; }
.new-btn { position: relative; height: 52px; }
.nav { position: relative; display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 600; }
.nav a { height: 46px; padding: 0 12px; border-radius: 14px; display: flex; align-items: center; gap: 12px; color: #c9cef0; }
.nav a span { flex: 1; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.badge.red { background: var(--red); color: #fff; }
.badge.gold { background: #f2b544; color: #1e1505; }
.me-card { position: relative; margin-top: auto; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.me-card b { display: block; font-size: 14px; }
.me-card small { display: block; font-size: 12px; color: #a9afd6; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--terra); color: #1a0b05; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.main { flex: 999 1 640px; min-width: 0; padding: 32px clamp(16px, 3vw, 44px) 48px; }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; outline: none; }

/* Éléments communs */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.head h1 { margin: 4px 0 0; font-size: 34px; font-weight: 800; }
.card { background: #fff; border: 1px solid var(--sand-line); border-radius: var(--radius); }
.card.pad { padding: 20px 22px; }
.card h2 { margin: 0; font: 800 19px var(--display); }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.grow { flex: 999 1 520px; min-width: 0; }
.aside { flex: 1 1 300px; min-width: 0; }
.chip { height: 40px; padding: 0 14px; border-radius: 20px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.chip.online { background: var(--mint-bg); color: var(--mint); }
.chip.offline { background: var(--terra-bg); color: #8e3520; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; display: inline-block; flex: none; }
.pill { height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }
.pill.send { background: var(--gold-bg); color: var(--gold-text); }
.pill.pending { background: var(--blue-bg); color: var(--blue); }
.pill.valid { background: var(--mint-bg); color: var(--mint); }
.pill.rejected { background: var(--terra-bg); color: var(--red); }
.thumb { width: 40px; height: 40px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; font: 800 13px var(--text); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.empty { padding: 32px; text-align: center; color: var(--ink-3); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--indigo); color: #fff; font-weight: 600; box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); }
.skeleton { background: linear-gradient(90deg, #efe6d8 25%, #f8f3eb 50%, #efe6d8 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Carte or (objectif) */
.gold { position: relative; overflow: hidden; border-radius: 26px; padding: 24px 26px; color: #1e1505; background: linear-gradient(128deg, #f6ead0 0%, #e6cb96 46%, #c99e5c 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 20px 40px -26px rgba(22,32,91,.6); }
.gold::after { content: ""; position: absolute; right: -20px; top: -10px; width: 260px; height: 220px; opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cpath d='M13 3 L23 13 L13 23 L3 13 Z' fill='none' stroke='%235B4210' stroke-width='1.5'/%3E%3C/svg%3E"); }
.gold > * { position: relative; }
.gold .label { font-size: 12px; font-weight: 700; letter-spacing: .16em; color: #5b4210; }
.gold .big { margin: 10px 0 0; font: 800 56px/1 var(--display); letter-spacing: -.03em; }
.gold .big span { font-size: 26px; color: #6b4e16; }
.bar { height: 12px; border-radius: 6px; background: rgba(30,21,5,.14); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; background: var(--indigo); transition: width .4s; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { padding: 12px 14px; text-align: left; font-size: 12px; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; border-top: 1px solid var(--sand-line); }
table.list td { padding: 12px 14px; border-top: 1px solid var(--sand); vertical-align: middle; }
table.list tr:hover td { background: #fbf8f3; }
table.list .first { padding-left: 22px; }

/* Onglets de filtre */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { height: 42px; padding: 0 8px 0 14px; border-radius: 21px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 700 14px var(--text); background: #fff; color: var(--ink); border: 1px solid var(--sand-border); }
.tab[aria-selected="true"] { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.tab .n { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--sand); color: var(--ink-2); }
.tab[aria-selected="true"] .n { background: rgba(255,255,255,.18); color: #fff; }

/* Nouveau relevé */
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { height: 40px; padding: 0 14px 0 8px; border-radius: 20px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; background: #fff; color: var(--ink-3); border: 1px solid var(--sand-border); }
.steps li .n { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--sand); }
.steps li.done { background: var(--mint-bg); color: var(--mint); border-color: transparent; }
.steps li.done .n { background: var(--mint); color: #fff; }
.steps li.on { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.steps li.on .n { background: var(--terra); }
.sec-title { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--ink-3); }
.photo-zone { position: relative; margin-top: 12px; height: 220px; border-radius: 18px; overflow: hidden; border: 2px dashed var(--sand-border); background: var(--sand-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); cursor: pointer; text-align: center; padding: 12px; }
.photo-zone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-zone .tag { position: absolute; left: 10px; bottom: 10px; height: 28px; padding: 0 10px; border-radius: 14px; background: rgba(11,15,46,.78); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.item-pick { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.item-opt { width: 100%; min-height: 56px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--sand-line); background: #fff; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; color: var(--ink); }
.item-opt[aria-checked="true"] { border: 2px solid var(--terra); }
.item-opt b { display: block; font-size: 14px; }
.item-opt small { display: block; font-size: 12px; color: var(--ink-3); }
.price-box { flex: 1 1 260px; padding: 16px; border-radius: 18px; background: var(--sand-2); display: flex; flex-direction: column; gap: 10px; }
.price-line { display: flex; align-items: center; gap: 10px; }
.price-line input { flex: 1; min-width: 0; border: 0; background: transparent; text-align: center; font: 800 46px var(--display); height: 60px; padding: 0; letter-spacing: -.02em; }
.price-line input:focus { box-shadow: none; }
.round { width: 50px; height: 50px; border-radius: 16px; border: 1px solid var(--sand-border); background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.gauge { align-self: center; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13px; font-weight: 700; display: flex; align-items: center; }
.gauge.in { background: var(--mint-bg); color: #1f6e5e; }
.gauge.near { background: var(--gold-bg); color: var(--gold-text); }
.gauge.far { background: var(--terra-bg); color: #8e3520; }
.gauge.none { background: #fff; color: var(--ink-3); }
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kind { min-height: 60px; padding: 10px 12px; border-radius: 16px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; cursor: pointer; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--sand-border); }
.kind b { font-size: 14px; }
.kind small { font-size: 12px; opacity: .8; }
.kind[aria-checked="true"] { background: var(--indigo); color: #fff; border: 2px solid var(--indigo); }
.gps { padding: 12px 14px; border-radius: 14px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.gps.ok { background: var(--mint-bg); color: #1f6e5e; }
.gps.wait { background: var(--gold-bg); color: var(--gold-text); }
.recap { position: relative; overflow: hidden; padding: 22px; border-radius: 26px; background: var(--indigo); color: #fff; display: flex; flex-direction: column; gap: 14px; }
.recap > * { position: relative; }
.recap dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 14px; }
.recap dt { color: #a9afd6; }
.recap dd { margin: 0; text-align: right; font-weight: 600; }
.checks { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.checks span { display: flex; align-items: center; gap: 8px; }
.checks .ok { color: #fff; }
.checks .ok .ic { color: var(--mint-2); }
.checks .warn { color: #f7cf7e; }
.checks .miss { color: #a9afd6; }
.consent { display: flex; gap: 10px; font-size: 13px; line-height: 1.4; color: #e4e7fa; align-items: flex-start; }
.consent input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--mint-2); }

/* Confirmation */
.done-card { position: relative; overflow: hidden; padding: 32px; border-radius: 28px; background: var(--indigo); color: #fff; }
.done-card > * { position: relative; }
.ring { width: 72px; height: 72px; border-radius: 36px; flex: none; display: flex; align-items: center; justify-content: center; }
.ring .ic { width: 36px; height: 36px; stroke-width: 2.6; }
.ring.ok { background: var(--mint-2); color: #0b2b26; box-shadow: 0 0 0 8px rgba(111,211,192,.16); }
.ring.warn { background: #f2b544; color: #3a2a0b; box-shadow: 0 0 0 8px rgba(242,181,68,.16); }

/* Envoi */
.sync { position: relative; overflow: hidden; padding: 30px; border-radius: 28px; background: var(--indigo); color: #fff; }
.sync > * { position: relative; }
.counter { position: relative; width: 156px; height: 156px; flex: none; }
.counter span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.counter b { font: 800 48px/1 var(--display); }
.switch-row { min-height: 72px; padding: 0 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--sand-line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--mint); flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 20px; height: 20px; border-radius: 10px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }

/* Profil */
.rules { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rules li { padding: 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.45; }
.rules .n { width: 36px; height: 36px; border-radius: 12px; color: #fff; display: flex; align-items: center; justify-content: center; font: 800 16px var(--display); }

/* Téléphone : le menu passe en haut */
@media (max-width: 900px) {
  .side { flex-basis: 100%; padding: 14px 16px 10px; gap: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .brand { flex: 1; padding: 0; }
  .new-btn { height: 44px; font-size: 14px; }
  .nav { flex-basis: 100%; flex-direction: row; overflow-x: auto; gap: 4px; font-size: 14px; }
  .nav a { flex: none; height: 40px; }
  .me-card { display: none; }
  .main { padding: 20px 16px 40px; }
  .head h1 { font-size: 28px; }
  .gold .big { font-size: 44px; }
  .done-card, .sync { padding: 22px; }
}
