/* Coupe d'avance : module client du salon */

:root {
  --accent: var(--cuivre);
  --texte-2: #655B53;          /* taupe assombri pour le texte courant (AA sur lin) */
  --cuivre-texte: #9A4422;     /* cuivre lisible en petit corps */
  --sauge-texte: #3F5C48;
  --trait: #D9CEC1;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.salon {
  margin: 0;
  min-height: 100dvh;
  background: var(--argile);
  color: var(--encre);
  font-family: var(--font-texte);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--encre);
  outline-offset: 3px;
  border-radius: 6px;
}
[tabindex="-1"]:focus { outline: none; }

/* Bandeau de démo */
.demo-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--encre);
  background: var(--argile);
  border-bottom: 1px solid var(--trait);
}
.demo-banner__link { color: var(--cuivre-texte); text-underline-offset: 3px; }
.is-embed .demo-banner__link { display: none; }

/* Application */
.app {
  background: var(--lin);
  min-height: calc(100dvh - 34px);
  display: flex;
  flex-direction: column;
  max-width: 460px;
  margin: 0 auto;
}
@media (min-width: 600px) {
  .app {
    margin: 32px auto 48px;
    min-height: 0;
    border-radius: 32px;
    box-shadow: 0 1px 0 rgba(23,19,15,.04), 0 30px 60px -30px rgba(23,19,15,.35);
    overflow: hidden;
  }
}
.is-embed body.salon, .is-embed .app { background: var(--lin); }
.is-embed .app { margin: 0; max-width: none; border-radius: 0; box-shadow: none; min-height: 100dvh; }
.is-embed .demo-banner { padding-top: 50px; }
.is-embed { scrollbar-width: none; }
.is-embed::-webkit-scrollbar { display: none; }

.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}
.salon-id { display: flex; align-items: center; gap: 10px; }
.salon-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--encre);
  color: var(--lin);
  font-family: var(--font-titre);
  font-size: 21px;
  line-height: 1;
  padding-top: 2px;
}
.salon-nom { font-family: var(--font-titre); font-size: 20px; line-height: 1.1; }
.salon-ville { font-size: 12px; color: var(--texte-2); }

.progress { display: flex; gap: 4px; }
.progress[hidden] { display: none; }
.progress span {
  width: 18px; height: 4px; border-radius: 4px;
  background: var(--trait);
  transition: background .4s var(--ease);
}
.progress span.is-on { background: var(--accent); }

.screens { flex: 1; padding: 6px 20px 8px; }
.screen { display: flex; flex-direction: column; gap: 16px; padding-bottom: 12px; }
.screen[hidden] { display: none; }
.screen.is-in { animation: entree .5s var(--ease) both; }
@keyframes entree {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.titre {
  margin: 4px 0 0;
  font-family: var(--font-titre);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -.01em;
  padding-bottom: 2px;
}
.titre em { font-style: italic; color: var(--accent); }
.titre--m { font-size: 32px; }
.texte { color: var(--texte-2); font-size: 15.5px; }

.label-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--texte-2);
  margin-top: 6px;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--block { width: 100%; }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 10px 20px -12px rgba(180,83,42,.8); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn--ghost { background: transparent; border-color: var(--encre); color: var(--encre); }
.btn--ghost:hover { background: rgba(23,19,15,.05); }
.btn--text {
  min-height: 44px; background: none; color: var(--encre);
  text-decoration: underline; text-underline-offset: 4px; font-weight: 500;
  align-self: center;
}
.btn:focus-visible { outline-offset: 3px; border-radius: 999px; }

/* Accueil */
.split-preview {
  position: relative;
  margin: 0;
  aspect-ratio: 5 / 4;
  border-radius: var(--rayon-carte);
  overflow: hidden;
  background: var(--argile);
}
.split-preview img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 22%;
}
.split-preview__b { clip-path: inset(0 0 0 50%); }
.split-preview__line {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px; background: #fff;
}

.consent { display: flex; flex-direction: column; gap: 8px; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; cursor: pointer; font-size: 14.5px; }
.check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; }
.check__box {
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--texte-2);
  background: #fff;
  display: grid; place-items: center;
  transition: background .2s, border-color .2s;
}
.check__box::after {
  content: "";
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transition: transform .2s var(--ease);
}
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box::after { transform: translateY(-1px) rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--encre); outline-offset: 3px; }
.field-error { color: #9A2F14; font-size: 13.5px; font-weight: 500; padding-left: 36px; }

.donnees { padding-left: 36px; font-size: 13.5px; color: var(--texte-2); }
.donnees summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; width: fit-content; }
.donnees p { margin-top: 6px; }

/* Photo */
.note {
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--cuivre-clair);
  color: var(--encre);
}
.note[hidden] { display: none; }
.note--center { background: none; padding: 0; text-align: center; color: var(--texte-2); font-size: 13px; margin-top: -6px; }
.note--demo { text-align: center; }

.samples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sample {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  border-radius: 18px;
}
.sample img {
  aspect-ratio: 4 / 5; width: 100%; object-fit: cover;
  border-radius: 18px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.sample:hover img { transform: translateY(-2px); box-shadow: var(--ombre-carte); }
.sample__cap { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; }

/* Analyse */
.scan {
  position: relative;
  width: 62%;
  margin: 8px auto 0;
  border-radius: var(--rayon-carte);
  overflow: hidden;
}
.scan img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.scan__line {
  position: absolute; left: 0; right: 0; top: 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(244,239,232,0), rgba(244,239,232,.55) 85%, #fff);
  border-bottom: 1.5px solid #fff;
  animation: scan 1.8s var(--ease) infinite;
}
@keyframes scan {
  from { transform: translateY(-100%); }
  to { transform: translateY(340%); }
}
.screen[data-screen="analyse"] .titre { text-align: center; }
.analyse { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.analyse li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--texte-2);
  opacity: .45;
  transition: opacity .4s var(--ease);
}
.analyse__val { color: var(--encre); text-transform: none; letter-spacing: 0; font-size: 12.5px; opacity: 0; transition: opacity .4s var(--ease); text-align: right; }
.analyse li.is-done { opacity: 1; }
.analyse li.is-done .analyse__val { opacity: 1; }

/* Comparateur */
.compare {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 58dvh;
  width: 100%;
  margin: 0 auto;
  border-radius: var(--rayon-carte);
  overflow: hidden;
  background: var(--argile);
  touch-action: pan-y;
}
.compare img, .compare__avant {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.compare img { object-fit: cover; object-position: 50% 30%; }
.compare__avant { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare.is-swap .compare__apres { animation: fondu .45s var(--ease); }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
.compare__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 2px; margin-left: -1px; background: #fff;
  pointer-events: none;
}
.compare__handle::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 16px -6px rgba(23,19,15,.45);
}
.compare__handle::before {
  content: "";
  position: absolute; top: 50%; left: 50%; z-index: 1;
  width: 16px; height: 9px; margin: -4.5px 0 0 -8px;
  clip-path: polygon(0 50%, 5px 0, 5px 100%, 0 50%, 100% 50%, calc(100% - 5px) 100%, calc(100% - 5px) 0, 100% 50%);
  background: var(--encre);
}
.compare__tag {
  position: absolute; top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(23,19,15,.62);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
}
.compare__tag--avant { left: 12px; }
.compare__tag--apres { right: 12px; }
.compare__range {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize;
  -webkit-appearance: none; appearance: none;
}
.compare:has(.compare__range:focus-visible) { outline: 2px solid var(--encre); outline-offset: 3px; }

.simulation {
  margin-top: -6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--texte-2);
  text-align: center;
  text-wrap: balance;
}

.choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choix__item {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  border-radius: 16px;
}
.choix__item img {
  aspect-ratio: 1 / 1; width: 100%; object-fit: cover; object-position: 50% 25%;
  border-radius: 16px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color .25s var(--ease), opacity .25s;
  opacity: .78;
}
.choix__item span { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.25; font-weight: 500; color: var(--texte-2); }
.choix__item[aria-checked="true"] img { outline-color: var(--accent); opacity: 1; }
.choix__item[aria-checked="true"] span { color: var(--encre); }

.detail { padding-top: 4px; }
.detail__nom { margin: 0; font-family: var(--font-titre); font-weight: 400; font-size: 28px; line-height: 1.1; }
.detail__pourquoi { margin-top: 6px; color: var(--texte-2); font-size: 15px; }

.tags { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border: 1.2px solid var(--encre);
  border-radius: 999px;
}

/* Brief */
.brief {
  background: #fff;
  border-radius: var(--rayon-carte);
  padding: 18px;
  box-shadow: var(--ombre-carte);
}
.brief__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cuivre-texte);
}
.brief__head { display: flex; gap: 14px; align-items: center; margin: 12px 0 14px; }
.brief__photos { display: flex; flex-shrink: 0; }
.brief__photos img {
  width: 56px; height: 70px; object-fit: cover; object-position: 50% 25%;
  border-radius: 12px; border: 2px solid #fff;
}
.brief__photos img + img { margin-left: -14px; }
.brief__nom { font-family: var(--font-titre); font-size: 24px; line-height: 1.1; }
.brief__profil { font-size: 13px; color: var(--texte-2); margin-top: 2px; }
.brief__rows { margin: 0; display: grid; gap: 10px; border-top: 1px solid var(--argile); padding-top: 12px; }
.brief__rows div { display: grid; grid-template-columns: 82px 1fr; gap: 10px; }
.brief__rows dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--texte-2);
  padding-top: 3px;
}
.brief__rows dd { margin: 0; font-size: 14px; line-height: 1.45; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; }
.field__opt { color: var(--texte-2); font-weight: 400; }
.field textarea {
  font: inherit; font-size: 15px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid #9C8F83;
  background: #fff;
  resize: vertical;
  min-height: 64px;
}
.field textarea:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }

/* Confirmation */
.ok {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--sauge);
  display: grid; place-items: center;
  margin-top: 18px;
  box-shadow: 0 0 0 10px var(--sauge-clair);
}
.screen.is-in .ok { animation: pop .6s var(--ease) both .1s; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ok__check {
  width: 14px; height: 26px;
  border: solid #fff; border-width: 0 3px 3px 0;
  transform: translateY(-3px) rotate(45deg);
}
.recap {
  display: flex; align-items: center; gap: 14px;
  background: var(--sauge-clair);
  border-radius: var(--rayon-carte);
  padding: 12px;
}
.recap img { width: 64px; height: 80px; object-fit: cover; object-position: 50% 25%; border-radius: 14px; }
.recap__nom { font-family: var(--font-titre); font-size: 22px; line-height: 1.1; margin-bottom: 6px; }
.pill {
  display: inline-block;
  font-size: 12.5px; font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
}
.pill--sauge { background: #fff; color: var(--sauge-texte); }

/* Pied */
.app-foot {
  padding: 14px 20px 22px;
  text-align: center;
  font-size: 12px;
  color: var(--texte-2);
}
.app-foot a { color: inherit; text-underline-offset: 3px; }

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

/* Mode réel */
.btn[hidden], [data-bind="erreur-reelle"][hidden] { display: none; }
