/* Estimation en ligne : partagée par /devis et /tarifs (même HTML, même calcul).
   Le HTML vit dans devis.html ; tools/pages/build.py le recopie dans /tarifs. */
/* ── ESTIMATEUR EN DIRECT (composeur, même langage que /tarifs) ─────────── */
/* overflow: clip et non hidden : hidden empêchait le récapitulatif (position: sticky) de suivre le défilement */
.qb { position: relative; background: #090510; color: #FBFAFF; padding: 96px 0 104px; overflow: clip; scroll-margin-top: 0; }
.qb::before { content: ""; position: absolute; top: -240px; left: 50%; transform: translateX(-50%); width: 980px; height: 640px; background: radial-gradient(ellipse, rgba(150,103,224,.3) 0%, transparent 65%); pointer-events: none; }
.qb__wrap { position: relative; max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.qb__head { text-align: center; margin: 0 auto 36px; max-width: 640px; }
.qb__kicker { margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #D4BBFC; }
.qb__h2 { margin: 0 0 14px; font-size: clamp(2.2rem, 4.6vw, 3.8rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; color: #FBFAFF; }
.qb__sub { margin: 0; font-size: 1rem; line-height: 1.6; color: rgba(235,217,252,.72); }

/* Étape 1 : le choix */
.qb__start { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 980px; margin: 0 auto; }
.qb__start[hidden] { display: none; }
.qb-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; padding: 30px 28px; border-radius: 24px; border: 1.5px solid rgba(212,187,252,.2); background: rgba(255,255,255,.04); color: inherit; font: inherit; cursor: pointer; transition: transform .3s cubic-bezier(.2,.7,.3,1), border-color .25s, background .25s, box-shadow .3s; }
.qb-pick:hover, .qb-pick:focus-visible { transform: translateY(-4px); border-color: #D4BBFC; background: linear-gradient(160deg, rgba(150,103,224,.28), rgba(212,187,252,.06)); box-shadow: 0 24px 60px rgba(0,0,0,.4); outline: none; }
.qb-pick__kicker { padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #090510; background: linear-gradient(135deg, #9667E0, #D4BBFC); }
.qb-pick__title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #FBFAFF; }
.qb-pick__text { font-size: .95rem; line-height: 1.6; color: rgba(235,217,252,.8); }
.qb-pick__for { font-size: .85rem; line-height: 1.5; color: #D4BBFC; font-weight: 600; }
.qb-pick__go { margin-top: auto; padding-top: 6px; font-size: .95rem; font-weight: 800; color: #FBFAFF; }
.qb-pick__go span { display: inline-block; transition: transform .2s; }
.qb-pick:hover .qb-pick__go span { transform: translateX(4px); }

/* Onglets (après le choix) */
.qb__tabs { display: flex; justify-content: center; gap: 6px; width: fit-content; margin: 0 auto 28px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(212,187,252,.16); }
.qb__tabs[hidden] { display: none; }
.qb__tab { padding: 10px 20px; border: 0; border-radius: 999px; background: transparent; color: rgba(235,217,252,.75); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.qb__tab.is-active { background: #FBFAFF; color: #090510; }

/* Composeur */
.qb__grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.qb__grid[hidden] { display: none; }
.qb__choices, .qb__panel { display: grid; gap: 18px; min-width: 0; }
.qb__panel[hidden] { display: none; }
.qb__group { margin: 0; padding: 20px; border: 1px solid rgba(212,187,252,.16); border-radius: 20px; background: rgba(255,255,255,.03); min-width: 0; display: grid; gap: 12px; }
.qb__group[hidden] { display: none; }
.qb__group legend { padding: 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #D4BBFC; }
.qb__hint { margin: 0; font-size: .86rem; line-height: 1.55; color: rgba(235,217,252,.7); }
.qb__hint strong { color: #FBFAFF; font-weight: 700; }
/* Mode mensuel : ce que le suivi dans la durée apporte */
.qb-perk { margin: 0; padding: 16px 18px; border-radius: 16px; border-left: 3px solid #D4BBFC; background: linear-gradient(135deg, rgba(150,103,224,.22), rgba(212,187,252,.06)); font-size: .9rem; line-height: 1.6; color: rgba(235,217,252,.82); }
.qb-perk strong { display: block; margin-bottom: 2px; color: #FBFAFF; font-weight: 800; }
.qb__label { margin: 6px 0 0; font-size: .9rem; font-weight: 700; color: #FBFAFF; }
.qb-custom { padding: 22px 20px; border: 1px dashed rgba(212,187,252,.4); border-radius: 20px; display: grid; gap: 10px; justify-items: start; }
.qb-custom__title { margin: 0; font-size: 1.05rem; font-weight: 800; color: #FBFAFF; }
.qb-custom__text { margin: 0; font-size: .9rem; line-height: 1.6; color: rgba(235,217,252,.75); }
.qb-custom__text strong { color: #FBFAFF; }
.qb-custom__btn { margin-top: 4px; padding: 11px 18px; border: 1px solid rgba(212,187,252,.55); border-radius: 999px; background: transparent; color: #FBFAFF; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; transition: background .2s, border-color .2s; }
.qb-custom__btn:hover { background: rgba(212,187,252,.12); border-color: #D4BBFC; }
.qb__label small { font-weight: 500; color: rgba(235,217,252,.55); margin-left: 6px; }
.qb__opts { display: grid; gap: 10px; }
.qb__opts--2 { grid-template-columns: repeat(2, 1fr); }
.qb__opts--3 { grid-template-columns: repeat(3, 1fr); }
.qb__opts--4 { grid-template-columns: repeat(4, 1fr); }
.qb-opt { position: relative; display: block; cursor: pointer; min-width: 0; }
.qb-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qb-opt__box { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 100%; min-height: 64px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid rgba(212,187,252,.2); background: rgba(255,255,255,.04); transition: border-color .2s, background .2s, transform .2s; }
.qb-opt:hover .qb-opt__box { border-color: rgba(212,187,252,.5); }
.qb-opt input:focus-visible + .qb-opt__box { outline: 2px solid #D4BBFC; outline-offset: 2px; }
.qb-opt input:checked + .qb-opt__box { border-color: #D4BBFC; background: linear-gradient(135deg, rgba(150,103,224,.38), rgba(212,187,252,.12)); transform: translateY(-2px); }
.qb-opt input:disabled + .qb-opt__box { opacity: .4; cursor: not-allowed; }
.qb-opt__name { font-size: .92rem; font-weight: 700; line-height: 1.3; color: #FBFAFF; }
.qb-opt__name small { display: block; font-size: 11px; font-weight: 500; color: rgba(235,217,252,.6); }
.qb-opt__sub { font-size: .76rem; line-height: 1.4; color: rgba(235,217,252,.62); }
.qb-opt__price { font-size: .85rem; font-weight: 800; color: #D4BBFC; }
.qb-opt__tag { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #090510; background: linear-gradient(135deg, #9667E0, #D4BBFC); }
.qb-opt--row .qb-opt__box { min-height: 0; }
.qb__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qb-chip { position: relative; cursor: pointer; }
.qb-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qb-chip span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(212,187,252,.22); font-size: .84rem; font-weight: 600; color: rgba(235,217,252,.85); transition: all .2s; }
.qb-chip input:checked + span { background: #D4BBFC; border-color: #D4BBFC; color: #090510; }
.qb-chip input:focus-visible + span { outline: 2px solid #D4BBFC; outline-offset: 2px; }
.qb-step { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid rgba(212,187,252,.2); background: rgba(255,255,255,.04); }
.qb-step__name { font-size: .92rem; font-weight: 700; color: #FBFAFF; }
.qb-step__name small { display: block; font-size: 11px; font-weight: 500; color: rgba(235,217,252,.6); }
.qb-step__ctrl { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.qb-step__btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(212,187,252,.4); background: transparent; color: #FBFAFF; font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; }
.qb-step__btn:hover { background: rgba(212,187,252,.15); }
.qb-step__val { min-width: 22px; text-align: center; font-size: 1.1rem; font-weight: 800; color: #FBFAFF; }

/* Récapitulatif */
.qb__summary { position: sticky; top: 88px; padding: 28px; border-radius: 24px; background: linear-gradient(180deg, #FBFAFF 0%, #F2EBFB 100%); color: #090510; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.qb__sum-label { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #7040C0; }
.qb__sum-total { margin: 8px 0 4px; font-weight: 700; }
.qb__sum-from { display: block; font-size: 13px; color: rgba(9,5,16,.55); }
.qb__sum-total strong { font-size: 3.4rem; font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.qb__sum-unit { font-size: 1rem; color: rgba(9,5,16,.6); }
.qb__lines { list-style: none; margin: 16px 0 14px; padding: 14px 0 0; border-top: 1px solid rgba(150,103,224,.2); font-size: .88rem; color: rgba(9,5,16,.7); }
.qb__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.qb__lines li b { font-weight: 700; color: #090510; text-align: right; }
.qb__advice { margin: 0 0 16px; font-size: .86rem; line-height: 1.55; color: #2a1f40; }
.qb__advice:empty { display: none; }
.qb__advice strong { color: #090510; }
.qb__cta { width: 100%; padding: 15px 20px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #9667E0, #D4BBFC); color: #090510; font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; box-shadow: 0 8px 26px rgba(150,103,224,.4); transition: transform .2s, box-shadow .2s; }
.qb__cta:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(150,103,224,.55); }
.qb__note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: rgba(9,5,16,.5); }
.qb__pill { display: none; }

@media (max-width: 1000px) {
  .qb__grid { grid-template-columns: 1fr; }
  .qb__summary { position: static; }
  .qb__pill { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: flex; align-items: center; gap: 6px; padding: 12px 18px; border-radius: 999px; background: #FBFAFF; color: #090510; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; box-shadow: 0 12px 34px rgba(0,0,0,.45); transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.2,.7,.3,1), opacity .25s; }
  .qb__pill.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
  .qb__pill strong { font-size: 1.1rem; font-weight: 900; }
  .qb__pill em { font-style: normal; margin-left: 6px; padding: 4px 10px; border-radius: 999px; background: #090510; color: #FBFAFF; font-size: 12px; font-weight: 700; }
}
@media (max-width: 760px) {
  .qb__start { grid-template-columns: 1fr; }
  .qb__opts--4 { grid-template-columns: repeat(2, 1fr); }
  .qb__opts--3 { grid-template-columns: 1fr; }
  .qb__opts--2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .qb { padding: 64px 0 72px; }
  .qb__wrap { padding: 0 16px; }
  .qb-pick { padding: 24px 20px; }
  .qb__group { padding: 14px; }
  .qb__summary { padding: 22px; }
  .qb__sum-total strong { font-size: 2.8rem; }
  .qb__tab { padding: 9px 14px; font-size: .84rem; }
}

/* Bouton « Ou être rappelé » sous le récapitulatif */
.qb__call { width: 100%; margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 1px solid rgba(150,103,224,.45); border-radius: 999px; background: transparent; color: #5B3A99; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; transition: background .2s; }
.qb__call:hover { background: rgba(150,103,224,.1); }
