/* Configurateur 3D VSX Bâtiments — style épuré (3D plein écran, panneau à droite) */
.cfg, .cfg-sheet, .how {
    --cfg-ink: #171a1f; --cfg-mute: #5c6370; --cfg-line: #e6e8ec; --cfg-soft: #f4f5f7;
    --cfg-accent: var(--brand-primary, #171a1f);
}
.cfg {
    display: grid; grid-template-columns: minmax(0, 1fr) 420px;
    min-height: calc(100vh - var(--header-h, 64px));
    color: var(--cfg-ink); font-feature-settings: "tnum";
}
.cfg-stage {
    position: sticky; top: var(--header-h, 64px); height: calc(100vh - var(--header-h, 64px));
    background: radial-gradient(120% 90% at 50% 20%, #ffffff 0%, #eef0f3 60%, #e3e6ea 100%);
    overflow: hidden;
}
.cfg-canvas { position: absolute; inset: 0; }
.cfg-canvas canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.cfg-badge {
    position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
    font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--cfg-ink);
    background: rgba(255,255,255,.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px; border-radius: 999px; white-space: nowrap;
}
.cfg-tools { position: absolute; bottom: 24px; left: 24px; display: flex; gap: 8px; }
.cfg-tool {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
    border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500;
    color: var(--cfg-ink); background: rgba(255,255,255,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: background .2s;
}
.cfg-tool:hover { background: #fff; }
.cfg-tool[aria-pressed="true"] { background: var(--cfg-ink); color: #fff; }
.cfg-hint { position: absolute; bottom: 30px; right: 24px; margin: 0; font-size: 12px; color: var(--cfg-mute); }
.cfg-noscript { position: absolute; inset: auto 24px 50% 24px; text-align: center; }

.cfg-panel { padding: 40px 36px 0; border-left: 1px solid var(--cfg-line); background: #fff; }
.cfg-head h1 { font-size: 40px; line-height: 1.05; letter-spacing: -.03em; font-weight: 700; margin: 6px 0 10px; }
.cfg-head p { color: var(--cfg-mute); margin: 0; font-size: 15px; line-height: 1.5; }
.cfg-eyebrow { font-size: 12px !important; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cfg-mute); margin: 0; }

.cfg-block { padding: 28px 0; border-bottom: 1px solid var(--cfg-line); }
.cfg-block[hidden] { display: none; }
.cfg-block h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 16px; }
.cfg-block h2 span {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--cfg-soft); font-size: 12px; color: var(--cfg-mute);
}

/* Segmenté Fermé / Ouvert */
.cfg-seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--cfg-soft); border-radius: 12px; padding: 4px; }
.cfg-seg label { position: relative; cursor: pointer; }
.cfg-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cfg-seg span { display: block; text-align: center; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--cfg-mute); transition: all .2s; }
.cfg-seg input:checked + span { background: #fff; color: var(--cfg-ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.cfg-seg input:focus-visible + span { outline: 2px solid var(--cfg-accent); outline-offset: 2px; }

/* Curseurs */
.cfg-range + .cfg-range { margin-top: 20px; }
.cfg-range-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cfg-range-head label { font-size: 14px; color: var(--cfg-mute); }
.cfg-num { font-size: 15px; font-weight: 600; color: var(--cfg-ink); }
.cfg-num input {
    width: 64px; text-align: right; font: inherit; border: 0; background: transparent; color: inherit;
    border-bottom: 1px dashed transparent; padding: 0; -moz-appearance: textfield;
}
.cfg-num input:hover, .cfg-num input:focus { border-bottom-color: var(--cfg-line); outline: none; }
.cfg-num input::-webkit-inner-spin-button, .cfg-num input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cfg input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; margin: 0;
    background: linear-gradient(to right, var(--cfg-ink) var(--p, 50%), var(--cfg-line) var(--p, 50%)); cursor: pointer;
}
.cfg input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.18);
}
.cfg input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.18); }
.cfg input[type=range]:disabled { opacity: .35; cursor: default; }
.cfg-area { margin: 18px 0 0; font-size: 13px; color: var(--cfg-mute); }

/* Cartes (toiture, isolation) */
.cfg-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cfg-card {
    position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px; cursor: pointer;
    border: 1.5px solid var(--cfg-line); border-radius: 14px; transition: border-color .2s, box-shadow .2s;
}
.cfg-card input { position: absolute; opacity: 0; pointer-events: none; }
.cfg-card svg { width: 48px; height: 30px; color: var(--cfg-mute); margin-bottom: 8px; }
.cfg-card strong { font-size: 14px; font-weight: 600; }
.cfg-card small { font-size: 12px; color: var(--cfg-mute); line-height: 1.35; }
.cfg-card:has(input:checked) { border-color: var(--cfg-ink); box-shadow: inset 0 0 0 .5px var(--cfg-ink); }
.cfg-card:has(input:checked) svg { color: var(--cfg-ink); }
.cfg-card:has(input:focus-visible) { outline: 2px solid var(--cfg-accent); outline-offset: 2px; }

/* Interrupteurs d'options, notes */
.cfg-toggle { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; cursor: pointer; border-top: 1px solid var(--cfg-line); }
.cfg-cards + .cfg-toggle { margin-top: 14px; }
.cfg-block h2 + .cfg-toggle { border-top: 0; padding-top: 0; }
.cfg-toggle[hidden], [data-when-insulated][hidden] { display: none; }
.cfg-toggle input { appearance: none; -webkit-appearance: none; flex: none; width: 42px; height: 26px; margin: 0; border-radius: 999px; background: #d9dce1; position: relative; cursor: pointer; transition: background .2s; }
.cfg-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.cfg-toggle input:checked { background: var(--cfg-ink); }
.cfg-toggle input:checked::after { transform: translateX(16px); }
.cfg-toggle input:focus-visible { outline: 2px solid var(--cfg-accent); outline-offset: 2px; }
.cfg-toggle strong { display: block; font-size: 14px; font-weight: 600; }
.cfg-toggle small { display: block; font-size: 12px; color: var(--cfg-mute); margin-top: 2px; }
[data-when-insulated] { margin-top: 18px; }
.cfg-seg-4 { grid-template-columns: repeat(4, 1fr); }
.cfg-note { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--cfg-mute); }
.cfg-door-check { display: flex !important; align-items: center; gap: 8px; font-size: 13px; align-self: end; padding-bottom: 8px; }
.cfg-door-check input { width: 16px; height: 16px; accent-color: var(--cfg-ink); }

/* Couleurs */
.cfg-label { font-size: 14px; color: var(--cfg-mute); margin: 0 0 10px; }
.cfg-label em { font-style: normal; color: var(--cfg-ink); font-weight: 500; margin-left: 4px; }
.cfg-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.cfg-swatch {
    width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
    background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .15s;
}
.cfg-swatch:hover { transform: scale(1.08); }
.cfg-swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 0 0 3px #fff, 0 0 0 5px var(--cfg-ink); }

/* Portes */
.cfg-empty { font-size: 14px; color: var(--cfg-mute); margin: 0 0 14px; }
.cfg-door { background: var(--cfg-soft); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.cfg-door-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cfg-door-head strong { font-size: 14px; }
.cfg-door-rm { border: 0; background: none; color: var(--cfg-mute); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.cfg-door-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.cfg-door label span { display: block; font-size: 12px; color: var(--cfg-mute); margin-bottom: 4px; }
.cfg-door select {
    width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--cfg-line);
    border-radius: 10px; background: #fff; color: var(--cfg-ink);
}
.cfg-door-pos input { background: linear-gradient(var(--cfg-line), var(--cfg-line)); }
.cfg-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cfg-add-btn {
    border: 1px solid var(--cfg-line); background: #fff; border-radius: 999px; padding: 8px 14px;
    font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--cfg-ink); transition: border-color .2s;
}
.cfg-add-btn:hover { border-color: var(--cfg-ink); }

/* Récap + appel à l'action */
.cfg-recap ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.cfg-recap li { padding-left: 18px; position: relative; line-height: 1.4; }
.cfg-recap li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--cfg-ink); }
.cfg-cta {
    position: sticky; bottom: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    padding: 18px 0 22px; margin-top: 8px; text-align: center;
}
.cfg-cta p { font-size: 12px; color: var(--cfg-mute); margin: 10px 0 0; }
.cfg-btn {
    display: block; width: 100%; height: 52px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--cfg-accent); color: #fff; font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -.01em;
    transition: opacity .2s, transform .1s;
}
.cfg-btn:hover { opacity: .9; }
.cfg-btn:active { transform: scale(.99); }
.cfg-btn:disabled { opacity: .5; cursor: progress; }

/* Feuille de devis */
.cfg-sheet {
    width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: 22px; padding: 0;
    box-shadow: 0 30px 80px rgba(0,0,0,.25); color: var(--cfg-ink, #171a1f);
}
.cfg-sheet::backdrop { background: rgba(10,12,16,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cfg-sheet-close-form { position: absolute; top: 14px; right: 14px; margin: 0; }
.cfg-sheet-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f1f2f4; cursor: pointer; font-size: 14px; color: #5c6370; }
.cfg-form { padding: 36px 36px 30px; }
.cfg-form h2 { font-size: 32px; letter-spacing: -.03em; margin: 6px 0 6px; }
.cfg-sheet-sub { color: #5c6370; margin: 0 0 22px; font-size: 14px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cfg-grid label span { display: block; font-size: 12px; color: #5c6370; margin-bottom: 5px; }
.cfg-grid input, .cfg-grid select, .cfg-grid textarea {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 11px 12px;
    border: 1px solid #dfe2e7; border-radius: 10px; background: #fff; color: inherit;
}
.cfg-grid input:focus, .cfg-grid select:focus, .cfg-grid textarea:focus { outline: none; border-color: #171a1f; box-shadow: 0 0 0 3px rgba(23,26,31,.08); }
.cfg-wide { grid-column: 1 / -1; }
.cfg-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #5c6370; margin: 16px 0; line-height: 1.45; }
.cfg-check input { margin-top: 3px; }
.cfg-error { color: #c0392b; font-size: 14px; margin: 0 0 12px; }

/* Tablette / mobile : 3D en haut, réglages dessous */
@media (max-width: 960px) {
    .cfg { grid-template-columns: 1fr; }
    .cfg-stage { position: sticky; top: var(--header-h, 56px); height: 46vh; min-height: 280px; z-index: 2; transition: height .35s cubic-bezier(.2,.7,.2,1), min-height .35s cubic-bezier(.2,.7,.2,1); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
    /* En défilant vers les options, la vue 3D se réduit pour laisser la place aux réglages */
    .cfg.is-compact .cfg-stage { height: 28vh; min-height: 190px; }
    .cfg.is-compact .cfg-hint, .cfg.is-compact .cfg-tool span { display: none; }
    .cfg.is-compact .cfg-badge { top: 8px; font-size: 12px; padding: 5px 12px; }
    .cfg.is-compact .cfg-tools { bottom: 8px; left: 8px; }
    .cfg.is-compact .cfg-tool { height: 34px; padding: 0 10px; }
    .cfg-panel { border-left: 0; padding: 28px 16px 0; }
    .cfg-head h1 { font-size: 32px; }
    .cfg-hint { display: none; }
    .cfg-tools { bottom: 14px; left: 14px; }
    .cfg-badge { top: 14px; font-size: 13px; }
}
@media (max-width: 560px) {
    .cfg-grid { grid-template-columns: 1fr; }
    .cfg-form { padding: 30px 20px 22px; }
    .cfg-form h2 { font-size: 26px; }
    .cfg-sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
}

/* =========== Page « Comment sont faits nos bâtiments » (défilement animé) =========== */
.how { color: #171a1f; }
.how-hero { text-align: center; padding: 88px 22px 40px; max-width: 820px; margin: 0 auto; }
.how-hero h1 { font-size: clamp(38px, 6vw, 72px); line-height: 1.02; letter-spacing: -.035em; margin: 10px 0 16px; font-weight: 700; }
.how-hero p:last-child { font-size: clamp(17px, 2vw, 21px); color: #5c6370; margin: 0; }
.how-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); max-width: 1320px; margin: 0 auto; padding: 0 22px; gap: 40px; }
.how-stage { position: sticky; top: calc(var(--header-h, 64px) + 20px); height: calc(100vh - var(--header-h, 64px) - 40px); border-radius: 28px; overflow: hidden;
    background: radial-gradient(120% 90% at 50% 20%, #ffffff 0%, #eef0f3 60%, #e3e6ea 100%); }
.how-canvas { position: absolute; inset: 0; }
.how-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.how-dots { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.how-dots li { width: 28px; height: 4px; border-radius: 4px; background: rgba(23,26,31,.15); transition: background .4s; }
.how-dots li.is-on { background: #171a1f; }
.how-steps { padding: 18vh 0 30vh; }
.how-step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .28; transition: opacity .5s; }
.how-step.is-active { opacity: 1; }
.how-n { font-size: 14px; font-weight: 600; color: #8a919c; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.how-step h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.025em; margin: 8px 0 16px; font-weight: 700; }
.how-step > p:not(.cfg-eyebrow) { font-size: 18px; line-height: 1.55; color: #5c6370; margin: 0 0 18px; }
.how-step ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.how-step li { font-size: 13px; font-weight: 500; padding: 7px 12px; border-radius: 999px; background: #f1f2f4; }
.how-end { text-align: center; padding: 60px 22px 110px; max-width: 680px; margin: 0 auto; }
.how-end h2 { font-size: clamp(32px, 5vw, 56px); letter-spacing: -.03em; margin: 0 0 14px; }
.how-end p { font-size: 18px; color: #5c6370; margin: 0 0 28px; }
.how-btn { display: inline-grid; place-items: center; width: auto; padding: 0 34px; text-decoration: none; color: #fff !important; }
@media (max-width: 900px) {
    .how-grid { grid-template-columns: 1fr; gap: 0; padding: 0; }
    .how-stage { top: var(--header-h, 56px); height: 44vh; border-radius: 0; z-index: 2; }
    .how-steps { padding: 6vh 22px 20vh; }
    .how-step { min-height: 52vh; }
    .how-hero { padding-top: 56px; }
}

/* Création de l'espace projet depuis la demande de devis */
.cfg-account { margin-top: 16px; border-radius: 14px; background: var(--cfg-soft); padding: 2px 16px 14px; }
.cfg-account .cfg-toggle { border-top: 0; }
.cfg-account-pw span { display: block; font-size: 12px; color: #5c6370; margin-bottom: 5px; }
.cfg-account-pw input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 11px 12px; border: 1px solid #dfe2e7; border-radius: 10px; background: #fff; }
.cfg-account-pw[hidden] { display: none; }
