:root {
  --bg: #0f0d0c;
  --surface: #191614;
  --surface-2: #221e1b;
  --line: #322c27;
  --text: #f1e9de;
  --muted: #a69a8b;
  --accent: #d9a35b;
  --accent-ink: #1a1206;
  --danger: #e2705e;
  --ok: #8fc79a;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding: 20px 0 120px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -10%, #2a1f14 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #1d1712 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; flex: 1; }

/* ---------- En-tête ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 640px; width: 100%; margin: 0 auto; padding: 18px 16px 8px;
}
.logo { font-family: "Pirata One", serif; font-size: 30px; color: var(--text); text-decoration: none; letter-spacing: .5px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: none; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

.foot { text-align: center; padding: 28px 16px 36px; }
.foot a { color: var(--muted); text-decoration: none; font-size: 14px; }

/* ---------- Textes ---------- */
h1 { font-family: "Pirata One", serif; font-weight: 400; font-size: clamp(64px, 18vw, 104px); line-height: .95; margin: 6px 0 18px; }
h2 { font-size: 28px; line-height: 1.2; margin: 4px 0 22px; font-weight: 700; letter-spacing: -.01em; }
.kicker { margin: 0; color: var(--accent); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 22px; }
.muted { color: var(--muted); }
.help { color: var(--muted); font-size: 14px; margin: -4px 0 10px; }

.intro { padding: 10vh 0 calc(110px + env(safe-area-inset-bottom)); }
.intro .lead { max-width: 30em; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; text-decoration: none; transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #e6b36d; }
.btn.ghost { background: none; }
.btn:disabled { opacity: .6; cursor: default; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 2px 0; font-size: 14px; font-weight: 500; margin-left: auto; }

/* ---------- Étapes (une page par étape, pensé pour le téléphone) ---------- */
body[data-screen="step"] .foot { display: none; }
body[data-screen="step"] .top { padding-top: 12px; padding-bottom: 0; }
body[data-screen="step"] .logo { font-size: 24px; }
.step { padding: 6px 0 calc(110px + env(safe-area-inset-bottom)); }
.step h2 { margin: 10px 0 18px; }

.stepper { padding: 8px 0 4px; }
.stepper ol { position: relative; display: flex; align-items: center; justify-content: space-between; height: 32px; list-style: none; margin: 0 -9px 6px; padding: 0; }
.stepper ol::before, .stepper ol::after {
  content: ""; position: absolute; left: 16px; top: 15px; height: 2px; border-radius: 2px;
}
.stepper ol::before { right: 16px; background: var(--line); }
.stepper ol::after { width: calc((100% - 32px) * var(--fill) / 100%); background: var(--accent); transition: width .3s; }
.stepper li { position: relative; z-index: 1; }
/* Bouton de 32 px (zone de tap) avec un point de 14 px au centre. */
.stepper li button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.stepper li button::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg);
  box-sizing: border-box; transition: transform .2s, background .2s, border-color .2s;
}
.stepper li button:disabled { cursor: default; }
.stepper li.is-done button::before { background: var(--accent); border-color: var(--accent); }
.stepper li.is-current button::before { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(217, 163, 91, .22); transform: scale(1.2); }
.stepper .kicker { font-size: 12px; }

.fields { display: flex; flex-direction: column; gap: 26px; }
.field .label { font-weight: 600; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.opt { color: var(--muted); font-weight: 400; font-size: 13px; }
.error { color: var(--danger); font-size: 14px; margin: 6px 0 0; min-height: 0; }
.error:empty { display: none; }
.field.invalid .input, .field.invalid .chips, .field.invalid .body-picker { outline: 1px solid var(--danger); outline-offset: 3px; border-radius: 10px; }

/* Barre du bas : gros bouton Suivant toujours sous le pouce. */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 10px;
  padding: 12px max(16px, calc((100% - 640px) / 2 + 16px)) calc(12px + env(safe-area-inset-bottom));
  background: rgba(15, 13, 12, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.nav .btn { min-height: 56px; }
.nav .back { width: 56px; padding: 0; flex: none; font-size: 20px; }
.nav .next, .nav .primary { flex: 1; font-size: 17px; }

/* ---------- Silhouette ---------- */
.body-picker { display: flex; justify-content: center; gap: 28px; margin-bottom: 6px; }
.body-view { margin: 0; flex: 1; max-width: 170px; display: flex; flex-direction: column; align-items: center; }
.body { width: 100%; height: auto; display: block; touch-action: manipulation; }
.part { fill: var(--surface-2); stroke: #4a4139; stroke-width: .6; cursor: pointer; transition: fill .15s; -webkit-tap-highlight-color: transparent; }
.part:hover { fill: #3a322b; }
.part:focus-visible { outline: none; stroke: var(--accent); stroke-width: 1.2; }
.part.on { fill: var(--accent); stroke: var(--accent); }
.part.deco { cursor: default; fill: #1d1a17; }
.body-view figcaption { display: flex; justify-content: space-between; width: 100%; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.body-view figcaption span { color: #6f6559; }
.body-chosen { text-align: center; font-weight: 600; margin: 10px 0 4px; }
.zone-list { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.zone-list summary { padding: 13px 16px; cursor: pointer; color: var(--muted); font-size: 15px; }
.zone-list[open] summary { border-bottom: 1px solid var(--line); }
.zone-list .zones { padding: 14px 16px; }

/* ---------- Choix ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 9px 15px; cursor: pointer; text-align: left; transition: background .15s, border-color .15s;
  display: flex; flex-direction: column;
}
.chip:hover { border-color: #4a4139; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips.big { display: grid; grid-template-columns: 1fr; gap: 8px; }
.chips.big .chip { border-radius: var(--radius); padding: 14px 16px; }
@media (min-width: 520px) { .chips.big { grid-template-columns: 1fr 1fr; } }
.chip-main { font-weight: 500; }
.chip-hint { font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] .chip-hint { color: #5a4220; }

.zones { display: flex; flex-direction: column; gap: 14px; }
.zone-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Champs ---------- */
.input {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; outline: none; transition: border-color .15s; resize: vertical;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #6f6559; }
.prefix { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.prefix span { padding-left: 14px; color: var(--muted); }
.prefix .input { border: 0; background: none; padding-left: 4px; }
.prefix:focus-within { border-color: var(--accent); }
.dims { display: flex; align-items: center; gap: 10px; }
.dims label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.times { color: var(--muted); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; color: var(--muted); font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

/* ---------- Images ---------- */
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.thumbs:empty { display: none; }
.thumbs.small { grid-template-columns: repeat(6, 1fr); }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}
.add-img {
  width: 100%; min-height: 110px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--muted); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.add-img:hover { border-color: var(--accent); color: var(--text); }
.add-img .plus { font-size: 30px; line-height: 1; color: var(--accent); }

/* ---------- Récap / fiche ---------- */
.recap { display: flex; flex-direction: column; gap: 10px; }
.recap-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.recap-who a { text-decoration: none; font-weight: 600; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.row-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.row-head .link { text-transform: none; letter-spacing: 0; }
.row-val { white-space: pre-wrap; overflow-wrap: anywhere; }
.row .thumbs { margin: 8px 0 0; }

/* ---------- Fin ---------- */
.done { padding-top: 8vh; display: flex; flex-direction: column; gap: 12px; }
.done h2 { margin-bottom: 0; }
.done .lead { margin-bottom: 8px; }
.message { font-size: 14px; color: var(--muted); }
.ok { color: var(--ok); margin: 0; font-weight: 500; }
.ok:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1; }

/* ---------- Page projet ---------- */
.project { padding: 18px 0 48px; }
.project-title { font-family: Inter, system-ui, sans-serif; font-weight: 700; font-size: clamp(32px, 8vw, 44px); line-height: 1.1; letter-spacing: -.02em; margin: 8px 0 10px; }
.project-meta { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.project-meta a { text-decoration: none; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 14px; background: var(--surface); }
.project-block { margin: 0 0 30px; }
.project-block h3, .spec dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px; }
.project-block p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea { font-size: 20px; line-height: 1.5; border-left: 2px solid var(--accent); padding-left: 16px; }
.specs { margin: 0 0 30px; border-top: 1px solid var(--line); }
.spec { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.spec dt { margin: 3px 0 0; }
.spec dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 380px) { .spec { grid-template-columns: 1fr; gap: 4px; } }
.gallery { display: grid; gap: 10px; }
.gallery .thumb { aspect-ratio: auto; border-radius: var(--radius); }
.gallery img { width: 100%; height: auto; display: block; }
