@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap");

/* Style shadcn/ui : gris zinc, bordures fines, Geist, rayon 8px */
:root {
  --background: #ffffff;
  --foreground: #09090b;
  --muted: #f4f4f5;
  --muted-fg: #71717a;
  --subtle: #fafafa;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --primary: #18181b;      /* couleur principale : change-la ici */
  --primary-fg: #fafafa;
  --ok: #15803d;
  --warn-bg: #fffbeb; --warn-border: #fde68a; --warn-fg: #78350f;
  --danger: #dc2626;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  color-scheme: light;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--background); color: var(--foreground); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2 { letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 6vw, 2.2rem); margin: 0 0 10px; }
h2 { font-size: 1.5rem; margin: 0 0 6px; }
.muted { color: var(--muted-fg); }
.small { font-size: .85rem; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- Wizard ---------- */
.wizard { max-width: 560px; margin: 0 auto; padding: 0 20px 120px; min-height: 100vh; }
.progress { position: sticky; top: env(safe-area-inset-top, 0px); background: var(--background); padding: 18px 0 12px; z-index: 5; }
.progress-top { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted-fg); margin-bottom: 8px; }
.bar { height: 6px; background: var(--muted); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .35s ease; }

.step { display: none; padding-top: 18px; }
.step.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step.active { animation: none; } .bar > i { transition: none; } }
.step-intro { margin: 0 0 24px; color: var(--muted-fg); font-size: .92rem; }

.field { margin-bottom: 20px; }
label, .label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 8px; }
.opt { font-weight: 400; color: var(--muted-fg); }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=url], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; font-size: 16px; /* évite le zoom auto sur iPhone */
  height: 44px; padding: 0 12px; border: 1px solid var(--input); border-radius: var(--radius);
  background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm);
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a1a1aa; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(161,161,170,.25); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

/* Badge */
.badge-soft { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid var(--border); border-radius: 99px; font-size: .75rem; font-weight: 500; color: #3f3f46; }

/* Toggle (puces) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: .84rem; height: 36px; padding: 0 12px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border); background: var(--background); color: #3f3f46;
}
.chip:hover { background: var(--subtle); }
.chip[aria-pressed=true] { border-color: var(--primary); background: var(--muted); color: var(--foreground); font-weight: 500; }
.chip[aria-pressed=true]::before {
  content: ""; width: 14px; height: 14px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Radio cards (logo) */
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: center; text-align: left; font: inherit; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); color: var(--foreground);
}
.choice:hover { background: var(--subtle); }
.choice .ico { width: 36px; height: 36px; border-radius: var(--radius); background: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.choice > span:nth-child(2) { flex: 1; min-width: 0; }
.choice b { display: block; font-weight: 500; font-size: .9rem; }
.choice span.muted { font-size: .82rem; }
.choice::after { content: ""; width: 18px; height: 18px; border-radius: 99px; border: 1px solid var(--ring); flex-shrink: 0; box-sizing: border-box; }
.choice[aria-pressed=true] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--subtle); }
.choice[aria-pressed=true]::after { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 4.5px, transparent 5px); }

/* Zone de dépôt */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 1px dashed #d4d4d8; border-radius: 10px; padding: 22px 16px; background: var(--subtle); cursor: pointer; color: var(--muted-fg); font-size: .85rem; font-weight: 400; margin: 0;
}
.drop.row { flex-direction: row; padding: 0; height: 44px; font-weight: 500; color: #3f3f46; }
.drop:hover { border-color: var(--ring); }
.drop input { display: none; }
.drop .circle { width: 36px; height: 36px; border-radius: 99px; background: var(--background); border: 1px solid var(--border); display: grid; place-items: center; color: var(--foreground); }
.drop b { color: var(--foreground); font-weight: 500; font-size: .9rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--muted); display: grid; place-items: center; font-size: .72rem; font-weight: 500; color: var(--muted-fg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 99px; border: 0; background: rgba(9,9,11,.75); color: #fff; cursor: pointer; font-size: 11px; line-height: 1; }

/* Couleurs */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 99px; border: 2px solid var(--background); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--foreground); }
.swatch.custom { display: grid; place-items: center; background: var(--background); border: 1px dashed var(--ring); box-shadow: none; position: relative; overflow: hidden; color: #52525b; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #3f3f46; font-weight: 400; margin-top: 12px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.sep { height: 1px; background: var(--border); margin: 4px 0 20px; }

/* Produits */
.item-list { display: grid; gap: 8px; margin-bottom: 14px; }
.item-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; background: var(--background); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.item-card .ph { width: 48px; height: 48px; border-radius: var(--radius); background: var(--muted); object-fit: cover; display: grid; place-items: center; color: var(--muted-fg); }
.item-card b { display: block; font-weight: 500; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card > div:nth-child(2) { min-width: 0; }
.item-meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: .8rem; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.tag { height: 20px; padding: 0 8px; border-radius: 6px; background: var(--muted); font-size: .7rem; font-weight: 500; line-height: 20px; color: #3f3f46; }
.tag.outline { background: transparent; border: 1px solid var(--border); line-height: 18px; }
.item-card .acts { display: flex; }
.icon-btn { border: 0; background: transparent; cursor: pointer; width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; color: #52525b; }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }
.editor { background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }
.editor .row-photo { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; }
.editor input[type=text], .editor input[type=number] { height: 38px; font-size: 15px; }
.photo-pick { width: 76px; height: 76px; border-radius: var(--radius); border: 1px dashed #d4d4d8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; overflow: hidden; background: var(--subtle); color: var(--muted-fg); font-size: .7rem; font-weight: 400; margin: 0; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick input { display: none; }
.seg { display: inline-flex; background: var(--muted); border-radius: var(--radius); padding: 3px; }
.seg button { font: inherit; font-size: .82rem; border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 6px; cursor: pointer; color: var(--muted-fg); }
.seg button[aria-pressed=true] { background: var(--background); color: var(--foreground); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Récap */
.recap { border: 1px solid var(--border); border-radius: 12px; }
.recap-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.recap-row:last-child { border-bottom: 0; }
.recap-row > div { min-width: 0; }
.recap-row .k { color: var(--muted-fg); font-size: .78rem; }
.recap-row .v { font-size: .9rem; font-weight: 500; }
.link { background: none; border: 0; color: var(--foreground); font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; flex-shrink: 0; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--warn-border); border-radius: 10px; background: var(--warn-bg); color: var(--warn-fg); font-size: .85rem; margin-top: 16px; }

/* Barre de navigation fixe */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--background); border-top: 1px solid var(--border); padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 10; }
.nav-in { max-width: 520px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.btn { font: inherit; font-size: .94rem; font-weight: 500; border: 0; border-radius: var(--radius); height: 44px; padding: 0 18px; cursor: pointer; background: var(--primary); color: var(--primary-fg); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { opacity: .9; }
.btn.ghost { background: var(--background); color: var(--foreground); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--subtle); opacity: 1; }
.btn.sm { height: 36px; padding: 0 12px; font-size: .84rem; }
.btn.icon { width: 44px; padding: 0; }
.btn.full { flex: 1; }
.btn:disabled { opacity: .5; cursor: wait; }
.err { color: var(--danger); font-size: .85rem; margin-top: 6px; min-height: 1em; }

/* Accueil */
.hero { padding-top: 36px; }
.perks { list-style: none; padding: 0; margin: 24px 0 16px; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.perks li { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--border); }
.perks li:last-child { border-bottom: 0; }
.perks .ico { width: 36px; height: 36px; border-radius: var(--radius); background: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.perks b { display: block; font-weight: 500; font-size: .9rem; }
.perks span { font-size: .82rem; color: var(--muted-fg); }
.done-ico { width: 52px; height: 52px; border-radius: 99px; background: #dcfce7; color: var(--ok); display: grid; place-items: center; margin: 48px 0 16px; }
.done-ico svg.i { width: 26px; height: 26px; }

/* ---------- Admin ---------- */
.admin-body { background: var(--subtle); min-height: 100vh; }
.adm-top { background: var(--background); border-bottom: 1px solid var(--border); }
.adm-top-in { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand .mark { width: 28px; height: 28px; border-radius: var(--radius); background: var(--primary); color: var(--primary-fg); display: grid; place-items: center; font-size: .8rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px 64px; }
.card { background: var(--background); border: 1px solid var(--border); border-radius: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.topbar h1 { font-size: 1.6rem; margin: 0 0 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--background); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat span { font-size: .8rem; font-weight: 500; color: var(--muted-fg); }
.stat b { display: block; font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 240px; max-width: 340px; }
.search svg.i { position: absolute; left: 11px; top: 11px; color: var(--muted-fg); width: 15px; height: 15px; }
.search input { height: 36px; padding-left: 34px; font-size: 14px; }
.biz { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start; padding: 16px; border-bottom: 1px solid var(--border); }
.biz:last-child { border-bottom: 0; }
.biz > div:nth-child(2) { min-width: 0; }
@media (max-width: 720px) { .biz { grid-template-columns: 44px 1fr; } .biz .actions { grid-column: 1 / -1; } }
.logo { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; background: var(--muted); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 600; font-size: .8rem; color: #3f3f46; }
.biz h2 { font-size: 1rem; margin: 0; letter-spacing: -0.01em; }
.biz .line { font-size: .84rem; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.biz .line a { color: var(--foreground); text-underline-offset: 3px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); font-size: .74rem; font-weight: 500; white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--dot, #a1a1aa); }
.s-recu { --dot: #f59e0b; } .s-en_cours { --dot: #3b82f6; } .s-livre { --dot: #22c55e; }
.actions { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.actions select, .actions input { height: 36px; font-size: 14px; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 13px; height: 13px; border-radius: 99px; border: 1px solid var(--border); display: inline-block; }
details summary { cursor: pointer; font-weight: 500; font-size: .84rem; margin-top: 10px; text-decoration: underline; text-underline-offset: 3px; }
.detail-grid { margin-top: 10px; display: grid; gap: 4px; font-size: .84rem; }
.items-list { margin-top: 12px; display: grid; gap: 8px; }
.it { display: flex; gap: 10px; align-items: center; font-size: .84rem; }
.it img, .it .noimg { width: 40px; height: 40px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--border); background: var(--muted); flex-shrink: 0; }
.empty { text-align: center; color: var(--muted-fg); padding: 40px; }
.login-card { max-width: 400px; margin: 80px auto; padding: 24px; }
