/* BeRun — UI mobile-first (Lot 5). Clair/sombre auto, gros boutons tactiles. */
:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1a1f26; --muted: #667085;
  --line: #e4e7ec; --brand: #0f766e; --brand-ink: #ffffff;
  --ok: #067647; --warn: #b54708; --bad: #b42318; --accent: #0e7490;
  --radius: 16px; --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0c0f14; --card:#151a21; --ink:#e7ebf0; --muted:#98a2b3;
          --line:#252c36; --brand:#2dd4bf; --brand-ink:#04211d; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--brand); color: var(--brand-ink);
}
.brand { color: var(--brand-ink); font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.brand span { font-weight: 500; opacity: .8; margin-left: 6px; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-ro { background: rgba(255,255,255,.18); color: #fff; }
.badge-armed { background: #fef3f2; color: var(--bad); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }

h1 { font-size: 22px; margin: 6px 0 4px; }
.lead { color: var(--muted); margin: 0 0 16px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 108px;
  padding: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink);
}
.tile b { font-size: 17px; }
.tile small { color: var(--muted); }
.tile .emoji { font-size: 26px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 8px; font-size: 17px; }
.muted { color: var(--muted); }

label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
input[type=file] { padding: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 700;
  border: 0; border-radius: 12px; background: var(--brand); color: var(--brand-ink);
  cursor: pointer; margin-top: 14px;
}
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: var(--bad); color: #fff; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { margin-top: 0; }

.pill { display:inline-block; font-size:12px; font-weight:700; padding:3px 9px; border-radius:999px; }
.p-100 { background:#ecfdf3; color:var(--ok); }
.p-8099 { background:#eff8ff; color:var(--accent); }
.p-low  { background:#fffaeb; color:var(--warn); }
.p-0    { background:#fef3f2; color:var(--bad); }

.item { border-top: 1px solid var(--line); padding: 12px 0; }
.item:first-child { border-top: 0; }
.item .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.item .sub { color: var(--muted); font-size: 14px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.flash-info { background:#eff8ff; color:var(--accent); }
.flash-ok { background:#ecfdf3; color:var(--ok); }
.flash-warn { background:#fffaeb; color:var(--warn); }
.flash-bad { background:#fef3f2; color:var(--bad); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters a { font-size: 14px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card); color: var(--ink); }
.filters a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

#reader { width: 100%; }
#reader video, #reader canvas { width: 100% !important; height: auto !important; border-radius: 12px; display: block; }
#reader img { display: none; }            /* masque le logo html5-qrcode */
#reader { border-radius: 12px; overflow: hidden; }
.empty { text-align: center; color: var(--muted); padding: 32px 8px; }

.steps { counter-reset: step; }
.step { position: relative; padding: 14px 0 14px 44px; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 12px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-weight: 800;
}
.step b { display: block; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; font-size: 11px; color: var(--muted); font-weight: 600;
}
.tabbar a span { font-size: 20px; }
.tabbar a.on { color: var(--brand); }
