/* ==========================================================================
   Simulateur fin de bail — DA « Framz » (par défaut)
   Toutes les couleurs passent par les variables :root.
   app.js écrase ces variables si le partenaire a un `theme` dans partners.js.
   ========================================================================== */

:root {
  /* DA Framz : Inter + Syne, noir profond, fonds blanc / sable, filets fins */
  --bg-main: #FFFFFF;
  --bg-alt: #F7F6F3;
  --bg-card: #FFFFFF;
  --border-subtle: #EBEBEB;
  --text-main: #0F0F0F;
  --text-muted: #6E6E6E;
  --accent: #0F0F0F;
  --accent-hover: #2B2B2B;
  --accent-contrast: #FFFFFF;
  --success: #3D6B57;
  --danger: #B3261E;

  --accent-soft: color-mix(in srgb, var(--accent) 5%, var(--bg-card));
  --accent-line: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));

  --font-serif: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-logo: "Syne", "Inter", system-ui, sans-serif;

  --radius-lg: 12px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: none;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg-main) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.progress { height: 3px; background: transparent; }
.progress__bar {
  height: 100%; width: 25%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: width .5s var(--ease);
}
.topbar__inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-main); min-width: 0; }
.brand__logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; }
.brand__name {
  font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.05;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 520px) {
  .brand__name { font-size: 1.12rem; max-width: 9.5em; }
}
.guarantee-badge {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.guarantee-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.official-line {
  max-width: 680px; margin: -4px auto 0; padding: 0 20px 10px;
  font-size: .75rem; color: var(--text-muted); letter-spacing: .02em;
}

/* ---------- Layout ---------- */
.shell { max-width: 680px; margin: 0 auto; padding: 28px 20px 40px; }

.intro { margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 10px; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted);
}
.intro__title {
  margin: 0; font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.3rem); line-height: 1.04; letter-spacing: -.01em;
}
.intro__title em { font-style: italic; color: var(--accent); }
.intro__lead { margin: 14px 0 0; color: var(--text-muted); font-size: 1rem; max-width: 52ch; }

.step-meta { margin: 0 0 6px; font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.step { animation: stepIn .45s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step__title {
  scroll-margin-top: 90px;
  margin: 0 0 22px; font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(1.9rem, 5.5vw, 2.4rem); line-height: 1.1; outline: none;
}
.step__title--xl { font-size: clamp(2.3rem, 7vw, 3.1rem); margin-bottom: 8px; }

/* ---------- Champs ---------- */
.field { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.field--row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin-bottom: 8px; }
.field__legend { padding: 0; margin-bottom: 12px; font-size: .9rem; font-weight: 600; }
.field__hint { font-weight: 400; color: var(--text-muted); font-size: .8rem; margin-left: 4px; }
.field__error { margin: 8px 0 0; font-size: .8rem; color: var(--danger); min-height: 0; }
.field__error:empty { display: none; }

.input-group { display: flex; flex-direction: column; margin-bottom: 14px; }
.input-label { font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  font-size: 1rem; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--text-muted) 60%, transparent); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.input.is-invalid { border-color: var(--danger); }

/* ---------- Cartes sélectionnables ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.stack { display: grid; gap: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.choice { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__body {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  min-height: 64px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  transition: border-color .2s, background-color .2s, box-shadow .2s, transform .15s var(--ease);
}
.choice:hover .choice__body { border-color: var(--accent-line); }
.choice:active .choice__body { transform: scale(.985); }
.choice__label { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.choice__sub { font-size: .8rem; color: var(--text-muted); line-height: 1.4; }
.choice input:checked + .choice__body {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice input:focus-visible + .choice__body { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.choice--pill .choice__body {
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-pill);
  flex-direction: row; align-items: center;
}
.choice--pill .choice__label { font-weight: 500; font-size: .9rem; white-space: nowrap; }
.choice--pill input:checked + .choice__body { background: var(--accent); color: var(--accent-contrast); box-shadow: none; }

.choice--row .choice__body { padding-right: 48px; }
.choice--row .choice__body::after {
  content: ""; position: absolute; right: 18px; top: 50%; translate: 0 -50%;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-subtle); background: var(--bg-card);
  transition: border-color .2s, box-shadow .2s;
}
.choice--row input:checked + .choice__body::after { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--bg-card), inset 0 0 0 10px var(--accent); }
.choice__tag {
  align-self: flex-start; margin-top: 4px; font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: var(--radius-pill);
}

/* ---------- Options (checkbox) ---------- */
.options { display: grid; gap: 8px; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; min-height: 58px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  transition: border-color .2s, background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option__box {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px;
  border: 1.5px solid var(--border-subtle); background: var(--bg-card);
  display: grid; place-items: center; transition: all .2s;
}
.option__box::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border-left: 2px solid var(--accent-contrast); border-bottom: 2px solid var(--accent-contrast);
  transform: rotate(-45deg) scale(0); transition: transform .2s var(--ease);
}
.option__label { flex: 1; font-size: .92rem; font-weight: 500; line-height: 1.35; }
.option__price { font-size: .85rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option input:checked ~ .option__box { background: var(--accent); border-color: var(--accent); }
.option input:checked ~ .option__box::after { transform: rotate(-45deg) scale(1); }
.option input:checked ~ .option__price { color: var(--accent); }
.option input:focus-visible ~ .option__box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Cartes ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 24px 22px; margin-bottom: 16px;
}
.estimate__label { margin: 0 0 6px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.estimate__range {
  margin: 0 0 18px; font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.7rem); line-height: 1.05; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; color: var(--text-main);
}
.estimate__lines { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border-subtle); display: grid; gap: 8px; }
.estimate__lines li { display: flex; justify-content: space-between; gap: 16px; font-size: .88rem; color: var(--text-muted); }
.estimate__lines li span:last-child { font-weight: 600; color: var(--text-main); font-variant-numeric: tabular-nums; white-space: nowrap; }
.estimate__lines li.is-accent span:last-child { color: var(--accent); }
.estimate__note { margin: 16px 0 0; font-size: .78rem; color: var(--text-muted); }

.lead-form__title { margin: 0 0 4px; font-family: var(--font-serif); font-weight: 400; font-size: 1.7rem; line-height: 1.15; }
.lead-form__sub { margin: 0 0 20px; font-size: .88rem; color: var(--text-muted); }
.lead-form__legal { margin: 14px 0 0; font-size: .74rem; color: var(--text-muted); text-align: center; }
.form-error {
  margin: 12px 0 0; padding: 12px 14px; font-size: .85rem; border-radius: var(--radius-md);
  color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--bg-card));
}
.form-error a { color: inherit; font-weight: 600; }

.recap__list { margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border-subtle); display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .88rem; }
.recap__list dt { color: var(--text-muted); }
.recap__list dd { margin: 0; font-weight: 600; text-align: right; }
.recap__guarantee { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: .85rem; font-weight: 600; color: var(--accent); }

.lead-ref {
  display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  background: var(--bg-main); border: 1px solid var(--border-subtle); color: var(--text-muted);
}
.lead-form__legal a, .site-footer a { color: inherit; }
.site-footer { margin-top: 40px; text-align: center; font-size: .75rem; color: var(--text-muted); }

/* ---------- Page légale ---------- */
.legal h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 6vw, 2.6rem); line-height: 1.1; margin: 0 0 8px; }
.legal h2 { font-size: 1rem; margin: 28px 0 8px; }
.legal p, .legal li { font-size: .92rem; color: var(--text-main); }
.legal ul { padding-left: 20px; }
.legal .todo { background: #FFF3C4; padding: 0 4px; border-radius: 4px; }
.legal-body { padding-bottom: 40px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 26px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .98rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .2s, border-color .2s, transform .15s var(--ease), opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary[disabled] { opacity: .6; cursor: progress; }
.btn--ghost { background: transparent; color: var(--text-main); border-color: var(--border-subtle); }
.btn--ghost:hover { border-color: var(--text-muted); }
.btn--block { width: 100%; margin-top: 6px; }
.step--done .btn--block + .btn--block { margin-top: 10px; }

/* ---------- Navigation bas ---------- */
.wizard-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg-main) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: env(safe-area-inset-bottom);
}
.wizard-nav__inner { max-width: 680px; margin: 0 auto; padding: 11px 20px; display: flex; gap: 10px; }
.wizard-nav__inner #nextBtn { flex: 1; }
.wizard-nav__inner #backBtn { flex: 0 0 auto; }

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  .shell { padding-top: 56px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid > :last-child:nth-child(odd) { grid-column: auto; }
  .card { padding: 30px 30px; }
  .options { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .guarantee-badge { font-size: .66rem; padding: 4px 8px; }
  .brand__name { font-size: 1.15rem; }
  .field--row { grid-template-columns: 100px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ==========================================================================
   DA FRAMZ — surcharges typographiques et composants
   ========================================================================== */
body { background: var(--bg-alt); font-size: 17px; }
.topbar { background: color-mix(in srgb, #FFFFFF 92%, transparent); }
.brand__name { font-family: var(--font-logo); font-weight: 800; font-size: 1.45rem; letter-spacing: -0.04em; }
.guarantee-badge {
  color: var(--text-main); background: var(--bg-card); border-color: var(--border-subtle);
  text-transform: uppercase; letter-spacing: .1em; font-size: .64rem; font-weight: 600; padding: 7px 12px;
}
.guarantee-badge__dot, .recap__guarantee .guarantee-badge__dot { background: var(--success); }
.official-line { text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; }

.eyebrow, .step-meta, .estimate__label {
  font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; color: var(--text-muted);
}
.intro__title, .step__title, .lead-form__title {
  font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02;
}
.intro__title { font-size: clamp(2.3rem, 7.5vw, 3.4rem); }
.intro__title em { font-style: normal; color: #9A9A9A; }
.step__title { font-size: clamp(1.8rem, 5.5vw, 2.3rem); }
.step__title--xl { font-size: clamp(2.2rem, 7vw, 3rem); }
.lead-form__title { font-size: 1.6rem; line-height: 1.1; }
.intro__lead { font-size: 1.06rem; font-weight: 500; color: var(--text-main); line-height: 1.6; }
.field__legend, .input-label { font-weight: 600; letter-spacing: -0.01em; }

.progress { height: 2px; }

/* Cartes de choix */
.choice__body { border-radius: var(--radius-md); }
.choice__label { font-weight: 600; letter-spacing: -0.01em; }
.choice input:checked + .choice__body {
  background: var(--bg-card); border-color: var(--text-main); box-shadow: inset 0 0 0 1px var(--text-main);
}
.choice--row input:checked + .choice__body::after { border-color: var(--text-main); box-shadow: inset 0 0 0 4px var(--bg-card), inset 0 0 0 10px var(--text-main); }
.choice__tag { color: var(--success); background: color-mix(in srgb, var(--success) 10%, #fff); text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; }

/* Pilules (surface) : contour, majuscules, comme les choix Framz */
.choice--pill .choice__body { min-height: 42px; padding: 9px 18px; background: transparent; border-color: #CFCFCF; }
.choice--pill .choice__label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.choice--pill input:checked + .choice__body { background: var(--text-main); border-color: var(--text-main); color: #fff; box-shadow: none; }

/* Options */
.option { border-radius: var(--radius-md); }
.option:has(input:checked) { background: var(--bg-card); border-color: var(--text-main); }
.option input:checked ~ .option__box { background: var(--text-main); border-color: var(--text-main); }
.option input:checked ~ .option__price { color: var(--text-main); }

/* Champs */
.input { border-radius: 10px; border-color: #DCDCDC; }
.input:focus { border-color: var(--text-main); box-shadow: 0 0 0 3px rgba(15,15,15,.08); }

/* Cartes */
.card { border-radius: var(--radius-lg); box-shadow: none; border-color: var(--border-subtle); }
.estimate__range { font-weight: 800; letter-spacing: -0.04em; }
.estimate__lines li.is-accent span:last-child, .recap__guarantee { color: var(--success); }

/* Boutons : pilules noires, majuscules espacées */
.btn { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; height: 52px; }
.btn--ghost { border-color: #CFCFCF; }
.btn--whatsapp { background: #25D366; color: #0B2E22; border-color: #25D366; }
.btn--whatsapp:hover { background: #20bd5a; }

.wizard-nav { background: color-mix(in srgb, #FFFFFF 94%, transparent); }
.lead-ref { background: var(--bg-alt); letter-spacing: .08em; text-transform: uppercase; font-size: .66rem; }
.brand__name { display: block; white-space: nowrap; max-width: none; -webkit-line-clamp: unset; }
@media (max-width: 380px) { .brand__name { font-size: 1.2rem; } .guarantee-badge { letter-spacing: .06em; } }
.brand { flex-shrink: 0; }
.brand__name { overflow: visible; }
@media (max-width: 480px) {
  .topbar__inner { padding: 12px 16px; gap: 8px; }
  .brand__name { font-size: 1.25rem; }
  .guarantee-badge { font-size: .58rem; letter-spacing: .04em; padding: 6px 9px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Noms de patron longs : 2 lignes max, taille réduite */
.brand--long { flex-shrink: 1; min-width: 0; }
.brand__name--long {
  white-space: normal; font-size: 1.05rem; line-height: 1.05; letter-spacing: -0.03em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 480px) { .brand__name--long { font-size: .95rem; } }


/* ---------- Mode démo prospect ---------- */
.demo-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px;
  padding: 7px 16px; font-size: .78rem; line-height: 1.35; text-align: center;
  background: var(--accent); color: var(--accent-contrast);
}
.demo-bar strong { font-weight: 700; }
.demo-bar span { opacity: .85; }
body.is-demo { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.is-demo input, body.is-demo textarea { -webkit-user-select: text; user-select: text; }
body.is-demo img { -webkit-user-drag: none; pointer-events: none; }
.option--locked { opacity: .55; cursor: not-allowed; border-style: dashed; }
.option--locked .option__box { background: var(--bg-alt); }
.demo-receipt { margin: 16px 0; border: 1.5px dashed var(--accent-line); }
.demo-receipt__lead { margin: 4px 0 10px; color: var(--text-muted); font-size: .92rem; }
.demo-receipt__list { list-style: none; margin: 0; padding: 0; }
.demo-receipt__list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-subtle); font-size: .92rem; }
.demo-receipt__list li span:first-child { color: var(--text-muted); }
.demo-receipt__list li span:last-child { font-weight: 600; text-align: right; }
.brand__logo + .brand__name:not(.sr-only) { font-size: 1rem; }

/* Simulateur intégré dans une maquette (iframe ?embed=1) */
body.is-embed .topbar, body.is-embed .intro, body.is-embed .site-footer { display: none !important; }
body.is-embed .shell { padding-top: 12px; }
