/* Cabine Capsule — esthétique cabine d'essayage : papier chaud, encre, lettrage d'étiquette. */
:root {
  --paper: #F4F2EE;
  --surface: #FFFFFF;
  --ink: #141414;
  --ink-2: #4E4C48;
  --muted: #8A8780;
  --line: #E3E0DA;
  --line-2: #D5D1CA;
  --ok: #3E6B45;
  --warn: #9A6A12;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --r: 6px;
  --bar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Barre ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 22px; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 2px; }
.brand sup { font-size: 9px; font-weight: 500; }
.brand span {
  margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line-2);
  font-weight: 400; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.steps { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.steps li { display: flex; gap: 8px; align-items: center; white-space: nowrap; transition: color .3s; }
.steps li span { font-variant-numeric: tabular-nums; color: var(--line-2); transition: color .3s; }
.steps li.is-current { color: var(--ink); }
.steps li.is-current span, .steps li.is-done span { color: var(--ink); }
body[data-screen="welcome"] .steps { visibility: hidden; }
body[data-screen="capture"] .bar { display: none; }

/* ---------- Écrans ---------- */
.screen { display: none; min-height: calc(100dvh - var(--bar)); }
.screen.is-active { display: block; animation: enter .45s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.wrap { max-width: 1120px; margin: 0 auto; padding: 56px 24px 72px; }
.wrap.two { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }

.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(44px, 7vw, 88px); line-height: 1.02; }
h1 em, h2 em { font-style: italic; color: var(--ink-2); }
h2 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; margin-bottom: 12px; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 30em; margin: 24px 0 36px; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin-top: 24px; max-width: 34em; }
.row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 36px; }
.hint { font-size: 13px; color: var(--muted); letter-spacing: .04em; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px;
  background: var(--ink); color: #fff; border-radius: var(--r);
  font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  transition: transform .15s var(--ease), background .2s;
}
.btn:hover { background: #2b2b2b; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.link { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; color: var(--ink-2); }

/* ---------- Accueil ---------- */
#s-welcome.is-active { display: grid; grid-template-columns: 1.3fr 1fr; }
.welcome { padding: clamp(40px, 8vw, 110px) clamp(24px, 6vw, 80px); align-self: center; }
.facts { display: flex; gap: 40px; list-style: none; padding: 0; margin: 64px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.facts b { display: block; font-family: var(--serif); font-weight: 400; font-size: 40px; color: var(--ink); line-height: 1; margin-bottom: 8px; }
.curtain { display: flex; background: #E9E6E0; border-left: 1px solid var(--line); overflow: hidden; }
.curtain span {
  flex: 1; border-right: 1px solid rgba(0,0,0,.05);
  background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(255,255,255,.35) 40%, rgba(0,0,0,.035));
  transform-origin: top; animation: sway 7s ease-in-out infinite alternate;
}
.curtain span:nth-child(2n) { animation-delay: -2s; }
.curtain span:nth-child(3n) { animation-delay: -4s; }
@keyframes sway { to { transform: scaleX(1.06) skewX(.6deg); } }

/* ---------- Formulaires ---------- */
.field { margin-top: 28px; }
.field > label { display: block; font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.opt { color: var(--muted); letter-spacing: .08em; text-transform: none; font-weight: 400; margin-left: 6px; }
input[type="text"], input[type="number"] {
  width: 100%; height: 50px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s;
}
input[type="text"]:focus, input[type="number"]:focus { border-color: var(--ink); outline: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 3px; flex-wrap: wrap; }
.seg button { min-height: 42px; padding: 0 20px; border-radius: 4px; font-size: 14px; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.height { display: flex; gap: 20px; align-items: center; }
.height input[type="range"] { flex: 1; accent-color: var(--ink); height: 32px; }
.height .num { display: flex; align-items: center; gap: 8px; width: 130px; }
.height .num input { text-align: right; font-variant-numeric: tabular-nums; }
.height .num span { color: var(--muted); }

.pieces { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.pieces.single { grid-template-columns: 1fr; }
.piece, .mode {
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; text-align: left;
  padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .2s, transform .15s var(--ease);
}
.piece:active, .mode:active { transform: scale(.99); }
.piece svg { grid-row: span 2; width: 52px; height: 52px; fill: #EEEBE6; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.piece svg .d { fill: none; }
.piece b, .mode b { font-weight: 500; font-size: 16px; }
.piece small, .mode small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.piece[aria-pressed="true"], .mode[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.piece[aria-pressed="true"] svg { fill: var(--ink); stroke: var(--ink); }
.piece[aria-pressed="true"] svg .d { stroke: #fff; }
.single .piece[aria-pressed="true"] b::after { content: '  ✓'; }
.modes { display: grid; gap: 12px; }
.mode { grid-template-columns: 1fr; row-gap: 4px; }

.swatches { display: flex; gap: 14px; flex-wrap: wrap; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.swatch i { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 0 0 3px var(--paper); transition: box-shadow .2s; }
.swatch[aria-pressed="true"] { color: var(--ink); }
.swatch[aria-pressed="true"] i { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--ink); }

.howto { counter-reset: h; list-style: none; padding: 0; margin: 28px 0 0; }
.howto li { counter-increment: h; position: relative; padding: 18px 0 18px 56px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.howto li::before { content: counter(h, decimal-leading-zero); position: absolute; left: 0; top: 14px; font-family: var(--serif); font-size: 28px; color: var(--ink); }
.howto b { color: var(--ink); font-weight: 500; }

.toggle { display: flex; align-items: center; gap: 12px; margin-top: 24px; font-size: 15px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 42px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .2s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Capture ---------- */
#s-capture { min-height: 100dvh; }
.stage { position: fixed; inset: 0; background: #0E0E0E; overflow: hidden; color: #fff; }
.stage video, .stage canvas#overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage.mirror video, .stage.mirror canvas#overlay { transform: scaleX(-1); }
.guide { position: absolute; left: 50%; top: 50%; height: 78%; transform: translate(-50%, -50%); fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.5; stroke-dasharray: 6 6; transition: opacity .4s; pointer-events: none; }
.guide.is-hidden { opacity: 0; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

.hud-top, .hud-bottom { position: absolute; left: 0; right: 0; display: flex; align-items: center; padding: 16px max(16px, env(safe-area-inset-left)); }
.hud-top { top: 0; justify-content: space-between; padding-top: max(16px, env(safe-area-inset-top)); background: linear-gradient(rgba(0,0,0,.45), transparent); }
.hud-bottom { bottom: 0; flex-direction: column; gap: 14px; padding-bottom: max(22px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.chip { min-height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(255,255,255,.14); color: #fff; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; backdrop-filter: blur(8px); }
.chip[aria-pressed="false"] { opacity: .55; }
.poses { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.poses li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .5; transition: opacity .3s; }
.poses li canvas { width: 40px; height: 54px; border-radius: 4px; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.06); }
.poses li.is-current { opacity: 1; }
.poses li.is-current canvas { border-color: #fff; border-width: 2px; }
.poses li.is-done { opacity: .9; }
.msg { margin: 0; font-family: var(--serif); font-size: clamp(22px, 3.2vw, 34px); line-height: 1.2; text-align: center; text-shadow: 0 1px 12px rgba(0,0,0,.5); max-width: 22em; min-height: 1.2em; }
.controls { display: flex; align-items: center; gap: 44px; }
.round { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.round svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 3px solid #fff; background: rgba(255,255,255,.2); position: relative; transition: transform .15s var(--ease); }
.shutter::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.shutter:active { transform: scale(.94); }
.shutter.rec::after { inset: 20px; border-radius: 6px; background: #E5484D; }
.skip { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); text-decoration: underline; text-underline-offset: 4px; }
.skip[hidden] { display: none; }
.count { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); font-family: var(--serif); font-size: min(34vw, 260px); line-height: 1; text-shadow: 0 4px 40px rgba(0,0,0,.35); pointer-events: none; }
.count:not(:empty) { animation: pop 1s ease-out infinite; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.ring { position: absolute; left: 50%; top: 44%; width: 160px; height: 160px; transform: translate(-50%, -50%) rotate(-90deg); fill: none; stroke-width: 3; opacity: 0; transition: opacity .3s; pointer-events: none; }
.ring circle { stroke: rgba(255,255,255,.25); }
.ring .p { stroke: #fff; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; }
.ring.on { opacity: 1; }

/* ---------- Analyse ---------- */
.processing { max-width: 560px; margin: 0 auto; padding: 18vh 24px; text-align: center; }
.processing .row { justify-content: center; margin-top: 32px; }
.bar-line { height: 1px; background: var(--line-2); margin-bottom: 40px; overflow: hidden; }
.bar-line span { display: block; width: 30%; height: 100%; background: var(--ink); animation: slide 1.4s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.processing.error .bar-line span { animation: none; width: 100%; background: #9F2F2D; }

/* ---------- Résultat ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 40px; max-width: 1360px; margin: 0 auto; padding: 32px 24px 64px; align-items: start; }
.lookbook { margin: 0; position: sticky; top: calc(var(--bar) + 24px); background: var(--surface); border: 1px solid var(--line); }
.lookbook canvas { display: block; width: 100%; height: auto; }
.lookbook-wait { aspect-ratio: 3 / 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center; }
.lookbook-wait strong { font-weight: 500; letter-spacing: .04em; }
.lookbook-wait em { font-style: normal; color: var(--muted, #6b6b6b); max-width: 32ch; }
.lookbook-wait .spin { width: 34px; height: 34px; border: 2px solid var(--line); border-top-color: currentColor; border-radius: 50%; animation: lbspin 1s linear infinite; }
@keyframes lbspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lookbook-wait .spin { animation: none; } }
.panel { min-width: 0; }
.sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.size-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.size-card[hidden] { display: none; }
.size-card small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.size-card strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 64px; line-height: 1.1; }
.size-card p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.confidence { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.confidence .dots { display: inline-flex; gap: 4px; }
.confidence .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.confidence .dots i.on { background: var(--ink); }
.confidence ul { flex-basis: 100%; margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.block { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 4px; }
.block summary { list-style: none; cursor: pointer; padding: 14px 0; font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 12px; }
.block summary::-webkit-details-marker { display: none; }
.block summary::after { content: '+'; font-weight: 300; font-size: 20px; line-height: 1; }
.block[open] summary::after { content: '−'; }
.block summary .muted { font-weight: 400; letter-spacing: .06em; text-transform: none; margin-left: auto; }
.block .field:first-child { margin-top: 4px; }
.measures { display: grid; }
.measures label { display: grid; grid-template-columns: 1fr 96px 24px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #EFEDE9; font-size: 15px; }
.measures input { height: 40px; text-align: right; font-variant-numeric: tabular-nums; padding: 0 10px; }
.measures label span:last-child { color: var(--muted); font-size: 13px; }
.adjust-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #EFEDE9; }
.adjust-row .dots { display: inline-flex; gap: 6px; margin-right: 10px; }
.adjust-row .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.adjust-row .dots i.on { background: var(--ink); }
.adjust-row em { font-style: normal; color: var(--muted); font-size: 14px; }
.actions { display: grid; gap: 10px; margin-top: 28px; }
.actions .link { justify-self: center; margin-top: 8px; }
.actions [hidden] { display: none; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); z-index: 50; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Adaptatif ---------- */
@media (max-width: 960px) {
  .steps { gap: 14px; }
  .steps li { font-size: 0; gap: 0; }
  .steps li span { font-size: 12px; }
  .steps li.is-current { font-size: 11px; gap: 6px; }
  .wrap.two { grid-template-columns: 1fr; gap: 48px; }
  #s-welcome.is-active { grid-template-columns: 1fr; }
  .curtain { height: 120px; border-left: 0; border-top: 1px solid var(--line); }
  .result { grid-template-columns: 1fr; }
  .lookbook { position: static; }
}
@media (max-width: 560px) {
  .bar { gap: 12px; }
  .brand span { display: none; }
  .wrap { padding: 36px 16px 56px; }
  .welcome { padding: 48px 16px; }
  .facts { gap: 20px; margin-top: 44px; }
  .facts b { font-size: 32px; }
  .pieces { grid-template-columns: 1fr; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 0 10px; }
  .row.end { justify-content: stretch; }
  .row.end .btn { flex: 1; }
  .result { padding: 16px 16px 48px; gap: 24px; }
  .controls { gap: 32px; }
  .poses li canvas { width: 32px; height: 43px; }
}
/* ---------- Pages du lookbook et scènes ---------- */
.lb-col { position: sticky; top: calc(var(--bar) + 24px); min-width: 0; }
.lb-col .lookbook { position: static; }
.pages { display: inline-flex; gap: 4px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 3px; }
.pages[hidden] { display: none; }
.pages button { min-height: 40px; padding: 0 18px; border-radius: 4px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.pages button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.small { font-size: 14px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chips button { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); font-size: 14px; color: var(--ink-2); }
.chips button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.chips button:disabled { opacity: .4; }
#btn-ai { margin-top: 16px; width: 100%; }
.ai-status { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; }
.ai-status li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #EFEDE9; }
.ai-status em { font-style: normal; color: var(--muted); }
.ai-status .ok em { color: var(--ok); }
.ai-status .ko em { color: #9F2F2D; }
.ai-status .run em::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 1.5px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.range { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; }
.range input { accent-color: var(--ink); }
#calib-out { width: 100%; margin-top: 14px; font: 12px/1.5 ui-monospace, monospace; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; background: var(--surface); }
select { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font: inherit; }
@media (max-width: 960px) { .lb-col { position: static; } }

.ai-opt { margin-top: 28px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ai-opt b { display: block; color: var(--ink); font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.ai-opt[hidden] { display: none; }
.ai-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.ai-banner[hidden] { display: none; }
.ai-banner b { display: block; font-weight: 500; }
.ai-banner em { font-style: normal; color: var(--muted); }
.ai-banner .link { margin-left: auto; }
.ai-banner .spin { width: 18px; height: 18px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.ai-banner.done .spin { animation: none; border-color: var(--ok); background: var(--ok); }
.ai-banner.warn .spin { animation: none; border-color: var(--warn); }

.ai-banner.offer { flex-wrap: wrap; border-color: var(--ink); }
.ai-banner.offer .spin { animation: none; border-color: var(--ink); background: transparent; }
.ai-offer { flex-basis: 100%; display: grid; gap: 12px; }
.ai-offer[hidden] { display: none; }
.ai-offer .check { margin-top: 4px; }

/* ---------- Mode borne ---------- */
body:not(.kiosk) #s-attract, body:not(.kiosk) .kiosk-lead { display: none !important; }
body.kiosk .actions, body.kiosk #s-result .panel > .fine { display: none; }
body.kiosk[data-screen="attract"] .bar { display: none; }
body.kiosk { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.kiosk input { user-select: text; -webkit-user-select: text; }
body.kiosk .btn { min-height: 60px; }
body.kiosk .steps li:nth-child(2) { display: none; }
body.kiosk .kiosk-lead { margin-bottom: 8px; }
body.kiosk .seg button { min-height: 50px; }

#s-attract.is-active { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 100dvh; cursor: pointer; }
.attract { padding: clamp(40px, 8vw, 120px); align-self: center; }
.attract h1 { font-size: clamp(56px, 8.5vw, 120px); }
.tap { display: inline-flex; align-items: center; gap: 14px; margin: 16px 0 0; font-size: 14px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
.tap span { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.8); opacity: .35; } }
.attract-visual { display: grid; place-items: center; align-content: center; gap: 18px; background: #E9E6E0; border-left: 1px solid var(--line); }
#attract-tunic { width: min(34vw, 420px); height: auto; --tunic: #171717; --tunic-ink: #F4F3EF; }
#attract-tunic path { fill: var(--tunic); stroke: var(--tunic); stroke-width: .6; stroke-linejoin: round; transition: fill .9s var(--ease), stroke .9s var(--ease); }
#attract-tunic path.d { fill: none; stroke: var(--tunic-ink); stroke-width: .5; opacity: .6; }
#attract-tunic .logo { fill: var(--tunic-ink); transition: fill .9s; }
#attract-color { margin: 0; font-family: var(--serif); font-size: 32px; font-style: italic; }
#attract-colors { display: flex; gap: 10px; }
#attract-colors i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); transition: transform .3s; }
#attract-colors i.on { transform: scale(1.35); box-shadow: 0 0 0 2px #E9E6E0, 0 0 0 3px var(--ink); }

.kiosk-lead { margin-top: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 16px; }
.kiosk-lead h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.15; }
.kiosk-lead p { margin: 0 0 14px; }
.kiosk-lead .field { margin-top: 16px; }
.kiosk-lead .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kiosk-lead .grid2 .field { margin-top: 0; }
.kiosk-lead .row { margin-top: 18px; }
.seg.wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.seg.wrap button { flex: 1 1 auto; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; margin-top: 14px; font-size: 14px; color: var(--ink-2); line-height: 1.45; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }
input[type="email"], input[type="password"] { width: 100%; height: 50px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
input[type="email"]:focus, input[type="password"]:focus { border-color: var(--ink); outline: none; }
.error { color: #9F2F2D; font-size: 14px; margin: 12px 0 0; }
#lead-done:not([hidden]) { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
#qr { display: block; border: 1px solid var(--line); border-radius: 6px; }

.idle { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(244,242,238,.94); backdrop-filter: blur(6px); text-align: center; padding: 24px; }
.idle[hidden] { display: none; }
.idle h2 { font-size: clamp(40px, 6vw, 64px); }
.idle b { font-variant-numeric: tabular-nums; }
.idle .btn { margin-top: 24px; }

.staff { border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: min(480px, calc(100% - 32px)); background: var(--paper); color: var(--ink); }
.staff::backdrop { background: rgba(20,20,20,.45); }
.staff h2 { margin-bottom: 16px; }
.staff input[type="password"] { font-size: 24px; letter-spacing: .4em; text-align: center; }
.staff .row.end { margin-top: 24px; }
.staff-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 8px; }
.staff-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 11px; color: var(--muted); line-height: 1.3; }
.staff-stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--ink); }

@media (max-width: 960px) {
  #s-attract.is-active { grid-template-columns: 1fr; }
  .attract-visual { padding: 32px 0 48px; border-left: 0; border-top: 1px solid var(--line); }
  #attract-tunic { width: 44vw; }
}
@media (max-width: 560px) {
  .kiosk-lead .grid2, .staff-stats { grid-template-columns: 1fr 1fr; }
  #lead-done:not([hidden]) { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
