/* Layout: mobile-first funnel — one question per screen, progress on top, Retour / Continuer pinned to the thumb zone; a "Suivi" tab holds the shared follow-up list. */
:root {
  --bg: #ffffff;
  --sand: #f7f3f1;
  --card: #ffffff;
  --ink: #00155e;
  --muted: #474554;
  --line: #e6e0dc;
  --lilac: #deabff;
  --lilac-ink: #00155e;
  --focus: #7c27b2;
  --android: #2f9e5b;
  --danger: #c4161c;
  --danger-bg: #fdeceb;
  --warn: #9a4b00;
  --warn-bg: #fff1e3;
  --ok: #11702c;
  --ok-bg: #e7f6ea;
  --info: #0b5cad;
  --info-bg: #e7f1fc;
  --display: "Bricolage Grotesque", "Poppins", system-ui, sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1030; --sand: #141a42; --card: #111739; --ink: #eef0fb; --muted: #b9bbd3;
    --line: #2a3163; --lilac: #deabff; --lilac-ink: #00155e; --focus: #deabff; --android: #5fd98f;
    --danger: #ff8a85; --danger-bg: #3a1620; --warn: #ffb870; --warn-bg: #36240f;
    --ok: #7fdc95; --ok-bg: #12301d; --info: #8cc3ff; --info-bg: #13284a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1030; --sand: #141a42; --card: #111739; --ink: #eef0fb; --muted: #b9bbd3;
  --line: #2a3163; --lilac: #deabff; --lilac-ink: #00155e; --focus: #deabff; --android: #5fd98f;
  --danger: #ff8a85; --danger-bg: #3a1620; --warn: #ffb870; --warn-bg: #36240f;
  --ok: #7fdc95; --ok-bg: #12301d; --info: #8cc3ff; --info-bg: #13284a;
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
img { max-width: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: 0;
}
.app { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 12px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.5px; }
.logo span { background: var(--lilac); color: var(--lilac-ink); border-radius: 999px; padding: 0 5px; }
.tabs { display: flex; background: var(--sand); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 21, 94, 0.12); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Funnel */
.panel-form { display: flex; flex-direction: column; gap: 16px; flex: 1; }
#bug-form { display: flex; flex-direction: column; flex: 1; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; width: 0; transition: width .25s ease; }
.step { display: flex; flex-direction: column; gap: 18px; flex: 1; padding-block: 8px 24px; }
.eyebrow { font-weight: 600; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(30px, 8vw, 40px); }
h2 { font-size: clamp(26px, 7vw, 32px); }
.lede { margin: 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.label { font-weight: 600; font-size: 15px; }
.label.spaced { margin-top: 6px; }
.label.more { margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 14px; margin: -2px 0 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="url"], input[type="password"], input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; min-height: 52px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { min-height: 132px; resize: vertical; }
textarea.short { min-height: 88px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }

.choices { display: grid; gap: 12px; }
.choices.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); cursor: pointer; min-height: 64px; min-width: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice b { font-size: 16px; font-weight: 600; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choices.three .choice { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 10px; }
.choices.three .choice b { font-size: 15px; }
.choices.three .choice small { font-size: 12px; line-height: 1.35; hyphens: auto; overflow-wrap: anywhere; }
.choice.os { flex-direction: column; justify-content: center; text-align: center; padding: 22px 12px; gap: 10px; }
.choice.os svg { width: 44px; height: 44px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.bloquant { background: var(--danger); }
.dot.genant { background: var(--warn); }
.dot.detail { background: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; font-size: 15px; }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.urgent { background: var(--danger-bg); color: var(--danger); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; align-self: flex-start; min-height: 32px; }

.recap { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.recap li { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.recap li:first-child { border-top: 0; }
.recap .k { color: var(--muted); }
.recap .v { overflow-wrap: anywhere; white-space: pre-line; }
.recap button { background: none; border: 0; color: var(--ink); text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; padding: 0; }

.nav { position: sticky; bottom: 0; background: var(--bg); display: flex; gap: 10px; padding-top: 12px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.btn { flex: 1; font: inherit; font-weight: 600; font-size: 16px; border-radius: 12px; min-height: 54px; padding: 12px 18px; cursor: pointer; border: 0; background: var(--ink); color: var(--bg); }
.btn.ghost { flex: 0 0 auto; background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.msg { font-size: 14px; color: var(--danger); margin: 0; min-height: 1em; }
.msg.neutral { color: inherit; }

.done { display: flex; flex-direction: column; gap: 14px; padding-block: 24px; }
.badge-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.ref-big { font-family: var(--display); font-weight: 700; font-size: 34px; font-variant-numeric: tabular-nums; margin: 0; }
.fallback { background: var(--warn-bg); color: var(--warn); border-radius: 14px; padding: 14px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.fallback textarea { font-size: 13px; min-height: 180px; color: var(--ink); }

/* Code d'accès */
.gate { display: flex; flex-direction: column; gap: 18px; padding-block: 24px; }
.gate form { display: flex; flex-direction: column; gap: 14px; }

/* Suivi */
.follow { display: flex; flex-direction: column; gap: 14px; padding-bottom: 32px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--sand); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .n { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .t { font-size: 12px; color: var(--muted); line-height: 1.3; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--card); min-width: 0; }
.item-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ref { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.item p { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.item .what { color: var(--muted); }
.tag { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.s-bloquant { background: var(--danger-bg); color: var(--danger); }
.s-genant { background: var(--warn-bg); color: var(--warn); }
.s-detail { background: var(--sand); color: var(--muted); }
.st-recu { background: var(--sand); color: var(--ink); }
.st-jira { background: var(--info-bg); color: var(--info); }
.st-encours { background: var(--warn-bg); color: var(--warn); }
.st-corrige { background: var(--ok-bg); color: var(--ok); }
.st-nonrepro { background: var(--sand); color: var(--muted); }
.admin { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; }
.admin select, .admin input { width: auto; min-height: 40px; padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.admin select { padding-right: 34px; background-position: calc(100% - 18px) 17px, calc(100% - 12px) 17px; }
.admin input { width: 110px; }
.admin button { min-height: 40px; padding: 6px 14px; font: inherit; font-size: 14px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.admin .msg { color: var(--muted); }
.empty { background: var(--sand); border-radius: 14px; padding: 18px; color: var(--muted); font-size: 14px; margin: 0; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
@media (min-width: 640px) { body { padding-top: 32px; } }
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
