/* Квиз после отправки формы — js/lead-quiz.js. Все правила внутри .bw-quiz. */

html.bw-quiz-lock { overflow: hidden; }

.bw-quiz {
    --q-brand: #4f68f4;
    --q-brand-dark: #3f56e0;
    --q-brand-soft: #eef1fe;
    --q-ink: #0f172a;
    --q-muted: #64748b;
    --q-line: #e2e8f0;
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .6);
    font-family: inherit;
    color: var(--q-ink);
}
.bw-quiz.is-open { display: flex; }
.bw-quiz [hidden] { display: none !important; }

.bw-quiz .bw-quiz__box {
    position: relative;
    width: 100%;
    max-width: 760px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 28px 22px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    box-sizing: border-box;
}
.bw-quiz .bw-quiz__close {
    position: absolute; top: 10px; right: 12px;
    width: 36px; height: 36px; border: 0; background: none;
    color: #94a3b8; font-size: 26px; line-height: 1; cursor: pointer;
}
.bw-quiz .bw-quiz__close:hover { color: var(--q-ink); }

/* Шапка «заявка отправлена» */
.bw-quiz .bw-quiz__done-head { display: flex; align-items: center; gap: 12px; margin: 0 36px 14px 0; }
.bw-quiz .bw-quiz__check {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #dcfce7; color: #16a34a; font-size: 20px; font-weight: 700;
}
.bw-quiz .bw-quiz__check--big { width: 56px; height: 56px; font-size: 28px; margin: 0 auto 14px; }
.bw-quiz .bw-quiz__done-title { margin: 0; font-size: 18px; font-weight: 700; }
.bw-quiz .bw-quiz__done-sub { margin: 2px 0 0; font-size: 14px; color: var(--q-muted); }

.bw-quiz .bw-quiz__intro {
    margin: 0 0 16px; padding: 14px 16px; border-radius: 12px;
    background: var(--q-brand-soft); font-size: 15px; line-height: 1.5;
}
.bw-quiz .bw-quiz__intro p { margin: 0; }
.bw-quiz .bw-quiz__intro .bw-quiz__intro-note { margin-top: 6px; color: var(--q-muted); font-size: 14px; }

/* Прогресс */
.bw-quiz .bw-quiz__progress { height: 6px; border-radius: 3px; background: var(--q-line); overflow: hidden; }
.bw-quiz .bw-quiz__progress-bar { display: block; height: 100%; width: 0; background: var(--q-brand); transition: width .25s ease; }
.bw-quiz .bw-quiz__counter { margin: 8px 0 14px; font-size: 13px; color: var(--q-muted); }

.bw-quiz .bw-quiz__title {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.3;
}
.bw-quiz .bw-quiz__hint { margin: 0 0 14px; font-size: 14px; color: var(--q-muted); }

/* Подсказка «?» */
.bw-quiz .bw-quiz__tip { position: relative; display: inline-flex; font-weight: 400; }
.bw-quiz .bw-quiz__tip-btn {
    width: 24px; height: 24px; border-radius: 50%; border: 1px solid #cbd5e1;
    background: #fff; color: var(--q-muted); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer;
}
.bw-quiz .bw-quiz__tip-btn[aria-expanded="true"] { border-color: var(--q-brand); color: var(--q-brand); }
.bw-quiz .bw-quiz__tip-text {
    position: absolute; z-index: 2; top: 30px; left: -12px; width: 300px; max-width: 70vw;
    padding: 10px 12px; border-radius: 10px; background: var(--q-ink); color: #fff;
    font-size: 13px; line-height: 1.45; box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

/* Схемы столешниц */
.bw-quiz .bw-quiz__shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bw-quiz .bw-quiz__shape {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 8px 14px; border: 2px solid var(--q-line); border-radius: 14px;
    background: #f8fafc; cursor: pointer; font: inherit; color: var(--q-ink);
    transition: border-color .15s, background .15s;
}
.bw-quiz .bw-quiz__shape:hover { border-color: #c7d0fb; }
.bw-quiz .bw-quiz__shape.is-active { border-color: var(--q-brand); background: var(--q-brand-soft); }
.bw-quiz .bw-quiz__shape svg { width: 100%; max-width: 200px; height: auto; }
.bw-quiz .bw-quiz__shape-title { font-size: 15px; font-weight: 600; }
.bw-quiz .bw-quiz__shape.is-active .bw-quiz__shape-title { color: var(--q-brand); }

.bw-quiz .bw-quiz__part { fill: #fff; stroke: var(--q-brand); stroke-width: 2.5; }
.bw-quiz .bw-quiz__deco { fill: none; stroke: var(--q-brand); stroke-width: 1.5; }
.bw-quiz .bw-quiz__dim { stroke: #94a3b8; stroke-width: 1.2; }
.bw-quiz .bw-quiz__dim--inner { stroke-dasharray: 3 3; }
.bw-quiz .bw-quiz__dim-label { fill: var(--q-brand); font-size: 14px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
.bw-quiz .bw-quiz__cross { stroke: #ef4444; stroke-width: 2.5; stroke-linecap: round; }

/* Размеры */
.bw-quiz .bw-quiz__sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.bw-quiz .bw-quiz__size {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 6px;
    align-items: center; padding: 10px 12px; border: 1px solid var(--q-line); border-radius: 12px;
}
.bw-quiz .bw-quiz__size-letter {
    width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--q-brand); color: #fff; font-size: 13px; font-weight: 700;
}
.bw-quiz .bw-quiz__size-label { font-size: 13px; color: var(--q-muted); line-height: 1.3; }
.bw-quiz .bw-quiz__size-field { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--q-muted); }
.bw-quiz .bw-quiz__size-field input,
.bw-quiz .bw-quiz__stepper input {
    width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 9px;
    font: inherit; font-size: 16px; color: var(--q-ink); background: #fff; box-sizing: border-box;
}
.bw-quiz .bw-quiz__size-field input:focus,
.bw-quiz .bw-quiz__stepper input:focus { outline: none; border-color: var(--q-brand); box-shadow: 0 0 0 3px rgba(79, 104, 244, .2); }

/* Варианты ответа */
.bw-quiz .bw-quiz__options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bw-quiz .bw-quiz__options--icons { grid-template-columns: repeat(3, 1fr); }
.bw-quiz .bw-quiz__option {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 14px; border: 2px solid var(--q-line); border-radius: 12px; cursor: pointer;
    font-size: 15px; line-height: 1.3; transition: border-color .15s, background .15s;
}
.bw-quiz .bw-quiz__options--icons .bw-quiz__option { flex-direction: column; text-align: center; }
.bw-quiz .bw-quiz__option:hover { border-color: #c7d0fb; }
.bw-quiz .bw-quiz__option.is-active { border-color: var(--q-brand); background: var(--q-brand-soft); }
.bw-quiz .bw-quiz__option input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--q-brand); }
.bw-quiz .bw-quiz__options--icons .bw-quiz__option input { position: absolute; top: 10px; left: 10px; }
.bw-quiz .bw-quiz__option-icon svg { width: 80px; height: 50px; display: block; }

/* Счётчик отверстий */
.bw-quiz .bw-quiz__stepper { display: inline-flex; align-items: center; gap: 10px; }
.bw-quiz .bw-quiz__stepper input { width: 80px; text-align: center; }
.bw-quiz .bw-quiz__stepper-btn {
    width: 44px; height: 44px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff;
    font-size: 22px; line-height: 1; color: var(--q-ink); cursor: pointer;
}
.bw-quiz .bw-quiz__stepper-btn:hover { border-color: var(--q-brand); color: var(--q-brand); }

/* Навигация */
.bw-quiz .bw-quiz__nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.bw-quiz .bw-quiz__btn {
    min-width: 140px; padding: 12px 20px; border: 0; border-radius: 10px;
    background: var(--q-brand); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.bw-quiz .bw-quiz__btn:hover { background: var(--q-brand-dark); }
.bw-quiz .bw-quiz__btn:disabled { opacity: .6; cursor: default; }
.bw-quiz .bw-quiz__btn--ghost { background: #fff; color: var(--q-ink); border: 1px solid #cbd5e1; }
.bw-quiz .bw-quiz__btn--ghost:hover { background: #f8fafc; }
.bw-quiz .bw-quiz__nav [data-act="next"] { margin-left: auto; }
.bw-quiz .bw-quiz__skip {
    display: block; margin: 14px auto 0; border: 0; background: none;
    color: var(--q-muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}

/* Финальный экран */
.bw-quiz .bw-quiz__thanks { text-align: center; padding: 8px 0 4px; }
.bw-quiz .bw-quiz__thanks .bw-quiz__title { justify-content: center; }
.bw-quiz .bw-quiz__thanks-text { margin: 0 auto 8px; max-width: 460px; font-size: 15px; line-height: 1.5; color: #475569; }
.bw-quiz .bw-quiz__thanks-social-title { margin: 16px 0 10px; font-weight: 600; }
.bw-quiz .bw-quiz__socials { display: flex; justify-content: center; gap: 12px; margin-bottom: 22px; }
.bw-quiz .bw-quiz__social {
    width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--q-brand); transition: background .15s;
}
.bw-quiz .bw-quiz__social:hover { background: var(--q-brand-dark); }
.bw-quiz .bw-quiz__social svg { width: 24px; height: 24px; fill: #fff; }

@media (max-width: 640px) {
    .bw-quiz { padding: 0; align-items: flex-end; }
    .bw-quiz .bw-quiz__box { max-height: 100vh; border-radius: 18px 18px 0 0; padding: 22px 16px 18px; }
    .bw-quiz .bw-quiz__shapes { grid-template-columns: 1fr; }
    .bw-quiz .bw-quiz__shape { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 12px; }
    .bw-quiz .bw-quiz__shape svg { width: 110px; flex: 0 0 110px; }
    .bw-quiz .bw-quiz__options,
    .bw-quiz .bw-quiz__options--icons { grid-template-columns: 1fr; }
    .bw-quiz .bw-quiz__options--icons .bw-quiz__option { flex-direction: row; text-align: left; }
    .bw-quiz .bw-quiz__options--icons .bw-quiz__option input { position: static; }
    .bw-quiz .bw-quiz__option-icon svg { width: 56px; height: 36px; }
    .bw-quiz .bw-quiz__btn { min-width: 0; flex: 1; }
    .bw-quiz .bw-quiz__title { font-size: 18px; }
}

/* MAX — фирменная иконка: градиентная плашка, облачко контуром */
.bw-quiz .bw-quiz__social--max { border-radius: 14px; background: linear-gradient(135deg, #3c8cff, #8a3dff); }
.bw-quiz .bw-quiz__social--max:hover { background: linear-gradient(135deg, #2f7cf0, #7a2ff0); }
.bw-quiz .bw-quiz__social--max svg { width: 26px; height: 26px; fill: none; stroke: #fff; }
