/* ============================================================
   Application de modélisation 3D — design system
   ============================================================ */

:root {
  --bg: #f5f6fb;
  --bg-soft: #eceef8;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --ink: #14172b;
  --ink-2: #3b4257;
  --muted: #6a7089;
  --line: #e4e7f2;
  --line-2: #eef0f8;

  --brand: #5b4be8;
  --brand-dark: #4438c4;
  --brand-soft: #eeecff;
  --accent: #00b0c4;
  --accent-soft: #e2f7fa;
  --grad: linear-gradient(135deg, #5b4be8 0%, #00b0c4 100%);
  --grad-soft: linear-gradient(135deg, #eeecff 0%, #e2f7fa 100%);

  --ok: #14875a;
  --ok-soft: #e3f6ed;
  --warn: #b3690a;
  --warn-soft: #fdf1dd;
  --danger: #c72c2c;
  --danger-soft: #fdecec;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 23, 43, .06), 0 1px 3px rgba(20, 23, 43, .05);
  --shadow: 0 8px 24px rgba(20, 23, 43, .08);
  --shadow-lg: 0 24px 60px rgba(20, 23, 43, .16);

  --nav-h: 64px;
  --top-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }

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

/* ---------------- Barre supérieure ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--top-h);
  padding: 8px 0;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad);
  display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(91, 75, 232, .28);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-txt strong { display: block; font-size: .98rem; line-height: 1.15; letter-spacing: -.01em; }
.brand-txt span { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.topbar-spacer { flex: 1 1 auto; }

.top-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------- Navigation basse ---------------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-in {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: var(--nav-h);
  max-width: 620px;
  margin: 0 auto;
}
.bn-item {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: color .15s;
}
.bn-item:hover { text-decoration: none; color: var(--ink-2); }
.bn-item svg { width: 23px; height: 23px; }
.bn-item.is-active { color: var(--brand); }
.bn-item.is-active svg { filter: drop-shadow(0 3px 6px rgba(91, 75, 232, .35)); }
.bn-item.is-action .bn-ic {
  background: var(--grad);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 5px 18px;
}

/* ---------------- Structure de page ---------------- */

.page { padding: 20px 0 calc(var(--nav-h) + 34px + env(safe-area-inset-bottom, 0px)); }
.page-hero { padding: 8px 0 4px; }

.section { margin: 0 0 34px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); font-size: .92rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft);
  padding: 5px 12px; border-radius: var(--r-pill);
  margin-bottom: 12px;
}

.lead { font-size: 1.04rem; color: var(--ink-2); }

/* ---------------- Boutons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
  box-shadow: var(--shadow-sm);
  min-height: 46px;
  line-height: 1.2;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn svg { width: 19px; height: 19px; flex: 0 0 auto; }

.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(91, 75, 232, .3); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(91, 75, 232, .38); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface); border-color: #cfd4e8; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); box-shadow: none; }
.btn-danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn-ok { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.btn-block { width: 100%; }
.btn-lg { font-size: 1.05rem; padding: 16px 26px; min-height: 56px; }
.btn-xl { font-size: 1.12rem; padding: 20px 28px; min-height: 64px; border-radius: var(--r-lg); }
.btn-sm { padding: 8px 14px; font-size: .85rem; min-height: 36px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 160px; }

/* ---------------- Cartes ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-lg { border-radius: var(--r-lg); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-sub { color: var(--muted); font-size: .88rem; margin: 2px 0 0; }
.card + .card { margin-top: 14px; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }

/* ---------------- Statistiques ---------------- */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}
.stat-v { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat-l { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.stat-ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 10px;
}
.stat-ic svg { width: 18px; height: 18px; }
.stat.is-accent .stat-ic { background: var(--accent-soft); color: #0b7f8e; }

/* ---------------- Étapes ---------------- */

.steps { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.step-chip {
  flex: 1 1 0; min-width: 108px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.step-chip b {
  width: 21px; height: 21px; border-radius: 50%; background: var(--bg-soft);
  display: grid; place-items: center; font-size: .72rem; color: var(--muted); flex: 0 0 auto;
}
.step-chip.is-active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.step-chip.is-active b { background: var(--brand); color: #fff; }
.step-chip.is-done { color: var(--ok); border-color: #c7e9d8; background: var(--ok-soft); }
.step-chip.is-done b { background: var(--ok); color: #fff; }

/* ---------------- Choix du nombre de photos ---------------- */

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice {
  position: relative; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 12px; text-align: center;
  transition: border-color .15s, box-shadow .2s, transform .12s;
}
.choice:hover { border-color: #c9c4f5; transform: translateY(-2px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.is-selected { border-color: var(--brand); background: var(--grad-soft); box-shadow: 0 12px 26px rgba(91, 75, 232, .16); }
.choice-n { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.choice-t { font-size: .84rem; color: var(--muted); margin-top: 6px; }
.choice.is-selected .choice-t { color: var(--brand-dark); }

/* ---------------- Emplacements photo ---------------- */

.slots { display: grid; grid-template-columns: 1fr; gap: 14px; }
.slot {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.slot-title { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.slot-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: .76rem; font-weight: 700;
}
.slot-preview {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: var(--bg-soft); aspect-ratio: 4 / 3; display: grid; place-items: center;
  border: 1px dashed #cfd4e8;
}
.slot-preview img { width: 100%; height: 100%; object-fit: cover; }
.slot-preview canvas { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.slot-empty { text-align: center; color: var(--muted); padding: 14px; font-size: .86rem; }
.slot-empty svg { width: 30px; height: 30px; margin-bottom: 6px; opacity: .6; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.slot-actions .btn { flex: 1 1 120px; }
.slot-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.thumb-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(20, 23, 43, .72); color: #fff;
  font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill);
}
.thumb-del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(20, 23, 43, .7); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.thumb-del svg { width: 15px; height: 15px; }

.slot-analysis { margin-top: 10px; font-size: .82rem; color: var(--ink-2); }
.check-line { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.check-line svg { width: 15px; height: 15px; flex: 0 0 auto; }
.check-ok svg { color: var(--ok); }
.check-warn svg { color: var(--warn); }

/* ---------------- Badges & pastilles ---------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--ink-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-accent { background: var(--accent-soft); color: #0b7f8e; }

/* ---------------- Formulaires ---------------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(91, 75, 232, .12);
}
.textarea { min-height: 100px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7089' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .87rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: 0 0 auto; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 11px 14px; border-radius: var(--r); font-size: .88rem; margin-bottom: 14px; }
.form-success { background: var(--ok-soft); color: var(--ok); padding: 11px 14px; border-radius: var(--r); font-size: .88rem; margin-bottom: 14px; }

.segmented { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: var(--r-pill); }
.segmented button {
  flex: 1 1 0; border: none; background: none; font: inherit; font-size: .87rem; font-weight: 600;
  padding: 9px 8px; border-radius: var(--r-pill); color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.segmented button.is-active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow-sm); }

/* ---------------- Visualiseur 3D ---------------- */

.viewer-shell {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(180deg, #1a1f38 0%, #0e1220 100%);
  border: 1px solid #262c45;
}
.viewer-shell canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 62vh; }
.viewer-tools {
  position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 3;
}
.vt-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(20, 23, 43, .62); color: #e7e9f7; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.vt-btn:hover { background: rgba(91, 75, 232, .8); }
.vt-btn.is-active { background: var(--brand); color: #fff; border-color: transparent; }
.vt-btn svg { width: 18px; height: 18px; }
.viewer-info {
  position: absolute; left: 10px; bottom: 10px; z-index: 3;
  background: rgba(20, 23, 43, .68); backdrop-filter: blur(6px);
  border-radius: var(--r); padding: 8px 12px; color: #d9dcf0; font-size: .76rem; line-height: 1.5;
}
.viewer-info b { color: #fff; }
.viewer-legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.viewer-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------------- Progression ---------------- */

.progress { height: 8px; border-radius: var(--r-pill); background: var(--bg-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .3s; }
.progress-label { display: flex; justify-content: space-between; font-size: .83rem; color: var(--muted); margin-bottom: 7px; }
.progress-label b { color: var(--ink-2); }

.log { margin-top: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px; max-height: 150px; overflow: auto; }
.log div { padding: 1px 0; }

/* ---------------- Listes / modèles ---------------- */

.model-card { display: flex; gap: 14px; align-items: center; }
.model-thumb {
  width: 76px; height: 76px; border-radius: var(--r); flex: 0 0 auto; overflow: hidden;
  background: linear-gradient(180deg, #1a1f38, #0e1220); display: grid; place-items: center; color: #8f97bd;
}
.model-thumb canvas, .model-thumb img { width: 100%; height: 100%; object-fit: cover; }
.model-body { flex: 1 1 auto; min-width: 0; }
.model-name { font-weight: 700; margin: 0 0 3px; }
.model-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.model-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px;
}
.list-row .lr-body { flex: 1 1 auto; min-width: 0; }
.list-row .lr-title { font-weight: 600; margin: 0; font-size: .95rem; }
.list-row .lr-sub { font-size: .8rem; color: var(--muted); margin: 2px 0 0; word-break: break-word; }

.empty {
  text-align: center; padding: 40px 20px; background: var(--surface);
  border: 1px dashed #d4d8ec; border-radius: var(--r-lg); color: var(--muted);
}
.empty svg { width: 42px; height: 42px; margin-bottom: 12px; opacity: .55; }

/* ---------------- Tableaux ---------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); }
table.data th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data td.actions { white-space: nowrap; }
table.data td.actions .btn { margin-right: 6px; }

/* ---------------- Alertes ---------------- */

.alert { display: flex; gap: 10px; padding: 12px 15px; border-radius: var(--r); font-size: .88rem; margin-bottom: 14px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------- Toasts ---------------- */

.toast-zone { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 24px)); }
.toast {
  background: #171b2e; color: #fff; padding: 12px 16px; border-radius: var(--r);
  font-size: .89rem; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out;
}
.toast.is-ok { background: #10633f; }
.toast.is-error { background: #8f1f1f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- Modales ---------------- */

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(14, 18, 32, .55); }
.modal-box { background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%); max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.modal-close { border: none; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; }
.modal-close svg { width: 20px; height: 20px; }

/* ---------------- Admin ---------------- */

.admin-shell { padding: 18px 0 calc(var(--nav-h) + 30px + env(safe-area-inset-bottom, 0px)); }
.admin-panel { display: none; }
.admin-panel.is-active { display: block; }
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; }
.admin-tabs button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: .85rem; font-weight: 600; padding: 9px 16px; border-radius: var(--r-pill);
  cursor: pointer; white-space: nowrap;
}
.admin-tabs button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.login-shell { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0 calc(var(--nav-h) + 40px); }
.login-card { width: min(440px, 100%); margin: 0 auto; }

/* ---------------- Public / vitrine ---------------- */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #14172b 0%, #232a4d 55%, #123a45 100%);
  color: #fff; padding: 46px 0 40px;
}
.hero::after {
  content: ""; position: absolute; width: 460px; height: 460px; right: -180px; top: -200px;
  background: radial-gradient(circle, rgba(91, 75, 232, .55), transparent 68%);
  pointer-events: none;
}
.hero-in { position: relative; z-index: 2; }
.hero h1 { font-size: 2rem; margin-bottom: 12px; color: #fff; }
.hero p { color: #c3c9e4; font-size: 1.02rem; max-width: 56ch; }
.hero .eyebrow { background: rgba(255, 255, 255, .12); color: #cfd6ff; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-cta .btn { flex: 1 1 210px; }
.hero-cta .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.hero-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; position: relative; z-index: 2; }
.hero-fact b { display: block; font-size: 1.35rem; letter-spacing: -.03em; }
.hero-fact span { font-size: .78rem; color: #a7aecd; }

.steps-view { display: grid; gap: 12px; grid-template-columns: 1fr; counter-reset: s; }
.steps-view .sv {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; display: flex; gap: 13px; box-shadow: var(--shadow-sm);
}
.sv-n { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto; }
.sv h4 { margin: 0 0 3px; font-size: .98rem; }
.sv p { margin: 0; color: var(--muted); font-size: .87rem; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery figure { margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.gallery figcaption { padding: 8px 11px; font-size: .8rem; color: var(--muted); }

/* ---------------- Footer ---------------- */

.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0; margin-top: 10px; }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.foot-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.foot-grid a { display: block; color: var(--ink-2); font-size: .88rem; padding: 3px 0; }
.foot-bottom { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* ---------------- Install PWA ---------------- */

.install-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.install-note { font-size: .78rem; color: var(--muted); }
.store-icons { display: flex; gap: 10px; }
.store-icons svg { width: 22px; height: 22px; color: var(--ink-2); }

/* ---------------- Utilitaires ---------------- */

.muted { color: var(--muted); }
.small { font-size: .84rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Responsive ---------------- */

@media (min-width: 620px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .choice-grid { grid-template-columns: repeat(4, 1fr); }
  .slots { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 2.5rem; }
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .steps-view { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr; }
  .page { padding-bottom: 60px; }
  .viewer-stage { aspect-ratio: 16 / 10; max-height: 70vh; }
  .wrap { padding: 0 24px; }
}

@media (max-width: 767px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.62rem; }
  .hero { padding: 32px 0 30px; }
  .brand-txt strong { font-size: .9rem; }
  .top-actions .btn span.lbl { display: none; }
  .top-actions .btn { padding: 10px 13px; }
  .model-card { flex-wrap: wrap; }
  .slots { grid-template-columns: 1fr !important; }
}

@media print {
  .topbar, .bottom-nav, .site-foot { display: none !important; }
}

/* ---------------- Accueil : hero à deux colonnes ---------------- */

.hero-grid { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
.hero-visual { display: flex; justify-content: center; }
.hero-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--r-lg);
  padding: 14px;
  width: min(340px, 100%);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .28);
}
.hero-card img { border-radius: var(--r); width: 100%; height: auto; }
.hero-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

details.card summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after {
  content: ""; width: 10px; height: 10px; flex: 0 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .18s; margin-top: -4px;
}
details.card[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }

.photo-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-strip img { border-radius: var(--r); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

.analysis-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.analysis-line:last-child { border-bottom: none; }
.analysis-line b { font-weight: 600; }

.measure-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.measure { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.measure-v { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.measure-l { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.admin-bottom .bn-item.is-active { color: #14172b; }

@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 40px; }
  .photo-strip { grid-template-columns: repeat(4, 1fr); }
  .measure-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 767px) {
  .hero-grid { gap: 20px; }
  .hero-visual { order: 2; }
  .analysis-line { flex-wrap: wrap; }
}
