/* Квиз-калькулятор: заезды и дренаж. Изолирован префиксом .qz.
   Логика — assets/js/quiz.js, разметка — src/include/quiz_zaezd.php и quiz_drenazh.php. */

.qz {
    --qz-accent: #ed6134;
    --qz-accent-2: #f5854f;
    --qz-accent-dark: #cf4a1f;
    --qz-ink: #17181c;
    --qz-text: #4a4741;
    --qz-muted: #857d73;
    --qz-line: #ece5da;
    --qz-tint: #fff4ef;
    --qz-bg: #f6f2ec;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--qz-bg);
    padding: 72px 0 80px;
    font-family: 'proxima_nova_rgregular', Arial, sans-serif;
    color: var(--qz-text);
    scroll-margin-top: 96px;   /* у сайта фиксированная полоса шапки ~82px */
}

/* Мягкие цветовые пятна вместо плоской заливки */
.qz::before,
.qz::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    pointer-events: none;
}
.qz::before { width: 420px; height: 420px; top: -160px; right: -120px; background: rgba(237, 97, 52, .16); }
.qz::after  { width: 380px; height: 380px; bottom: -180px; left: -140px; background: rgba(120, 150, 110, .14); }

.qz__wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; position: relative; }
#calc { scroll-margin-top: 96px; }

/* ── Шапка секции ─────────────────────────────────────────── */
.qz__head { text-align: center; max-width: 740px; margin: 0 auto 40px; }
.qz__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--qz-accent-dark);
    font-weight: 700;
    background: #fff;
    border: 1px solid rgba(237, 97, 52, .28);
    border-radius: 999px;
    padding: 7px 16px;
    margin-bottom: 18px;
}
.qz__eyebrow::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--qz-accent);
    box-shadow: 0 0 0 4px rgba(237, 97, 52, .18);
}
.qz__title {
    font-family: 'proxima_nova_ltsemibold', Arial, sans-serif;
    font-size: clamp(28px, 3.6vw, 42px);
    line-height: 1.12;
    letter-spacing: -.02em;
    color: var(--qz-ink);
    margin: 0 0 14px;
    font-weight: 700;
}
.qz__sub { font-size: 17px; line-height: 1.55; color: var(--qz-muted); margin: 0; }

/* ── Сетка ────────────────────────────────────────────────── */
.qz__grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; }

.qz__main {
    background: #fff;
    border: 1px solid rgba(236, 229, 218, .9);
    border-radius: 28px;
    padding: 34px 36px 36px;
    box-shadow: 0 20px 55px rgba(72, 50, 30, .09);
}

/* ── Степпер ──────────────────────────────────────────────── */
.qz__steps {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 30px;
    padding: 0 0 26px;
    border-bottom: 1px solid var(--qz-line);
    list-style: none;
}
.qz__steps li {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    position: relative;
    text-align: center;
}
/* соединительная линия */
.qz__steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 17px;
    left: calc(50% + 22px);
    right: calc(-50% + 22px);
    height: 2px;
    border-radius: 2px;
    background: var(--qz-line);
    transition: background .35s ease;
}
.qz__steps li.is-done::after { background: var(--qz-accent); }

.qz__dot {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    border: 2px solid var(--qz-line);
    color: var(--qz-muted);
    font-family: 'proxima_nova_ltsemibold', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    transition: background .28s, border-color .28s, color .28s, box-shadow .28s, transform .28s;
    position: relative;
    z-index: 1;
}
.qz__steps li.is-current .qz__dot {
    background: var(--qz-accent);
    border-color: var(--qz-accent);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(237, 97, 52, .16);
    transform: scale(1.06);
}
.qz__steps li.is-done .qz__dot {
    background: var(--qz-accent);
    border-color: var(--qz-accent);
    color: #fff;
    font-size: 0;
}
.qz__steps li.is-done .qz__dot::after {
    content: "";
    width: 11px; height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.qz__steps span {
    font-size: 13px;
    line-height: 1.3;
    color: var(--qz-muted);
    max-width: 130px;
    transition: color .28s;
}
.qz__steps li.is-current span { color: var(--qz-ink); font-weight: 700; }

/* компактный прогресс — только для мобильных */
.qz__progress { display: none; margin-bottom: 24px; }
.qz__progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.qz__step-num { font-size: 14px; color: var(--qz-muted); }
.qz__step-num b { color: var(--qz-ink); }
.qz__time { font-size: 13px; color: var(--qz-muted); }
.qz__bar { height: 6px; border-radius: 99px; background: #efe8dd; overflow: hidden; }
.qz__bar-fill {
    height: 100%; width: 25%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--qz-accent-2), var(--qz-accent));
    transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

/* ── Шаг ──────────────────────────────────────────────────── */
.qz__step { display: none; }
.qz__step.is-active { display: block; animation: qz-in .34s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes qz-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.qz__q {
    font-family: 'proxima_nova_ltsemibold', Arial, sans-serif;
    font-size: clamp(21px, 2.2vw, 26px);
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--qz-ink);
    margin: 0 0 8px;
    font-weight: 700;
}
.qz__hint { font-size: 15px; color: var(--qz-muted); margin: 0 0 24px; line-height: 1.55; }

/* ── Варианты ─────────────────────────────────────────────── */
.qz__options { display: grid; gap: 14px; }
.qz__options--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.qz__opt { position: relative; display: block; cursor: pointer; margin: 0; }
.qz__opt input { position: absolute; opacity: 0; width: 0; height: 0; }

.qz__opt-box {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    height: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--qz-line);
    border-radius: 18px;
    padding: 18px 20px;
    background: #fff;
    overflow: hidden;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
/* акцентная полоска слева, появляется при выборе */
.qz__opt-box::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--qz-accent-2), var(--qz-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}
.qz__opt:hover .qz__opt-box {
    border-color: #f0b49c;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(72, 50, 30, .09);
}
.qz__opt input:focus-visible + .qz__opt-box { outline: 2px solid var(--qz-accent); outline-offset: 3px; }
.qz__opt input:checked + .qz__opt-box {
    border-color: var(--qz-accent);
    background: var(--qz-tint);
    box-shadow: 0 0 0 1px var(--qz-accent);
    z-index: 1;
}
.qz__opt input:checked + .qz__opt-box::before { transform: scaleX(1); }

/* Индикатор выбора */
.qz__mark {
    flex: 0 0 24px;
    width: 24px; height: 24px;
    margin-top: 1px;
    border: 2px solid #d8d0c4;
    border-radius: 50%;
    background: #fff;
    position: relative;
    transition: border-color .2s, background .2s, transform .2s;
}
.qz__opt--multi .qz__mark { border-radius: 8px; }
.qz__mark::after {
    content: "";
    position: absolute; inset: 0; margin: auto;
    width: 11px; height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px) scale(.3);
    opacity: 0;
    transition: opacity .2s, transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.qz__opt input:checked + .qz__opt-box .qz__mark {
    background: var(--qz-accent);
    border-color: var(--qz-accent);
    transform: scale(1.04);
}
.qz__opt input:checked + .qz__opt-box .qz__mark::after {
    opacity: 1;
    transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.qz__opt-text { flex: 1; min-width: 0; }
.qz__opt-name {
    display: block;
    font-family: 'proxima_nova_ltsemibold', Arial, sans-serif;
    font-size: 16.5px;
    line-height: 1.3;
    color: var(--qz-ink);
    font-weight: 700;
    margin-bottom: 5px;
}
.qz__opt-desc { display: block; font-size: 14px; line-height: 1.55; color: var(--qz-muted); }
.qz__opt-note {
    display: inline-block;
    margin-top: 11px;
    font-size: 13px;
    font-weight: 700;
    color: var(--qz-accent-dark);
    background: var(--qz-tint);
    border: 1px solid rgba(237, 97, 52, .22);
    border-radius: 999px;
    padding: 5px 13px;
}
.qz__opt input:checked + .qz__opt-box .qz__opt-note { background: #fff; }

/* Компактный список: только названия */
.qz__options--compact { gap: 12px; }
.qz__options--compact .qz__opt-box { padding: 15px 18px; align-items: center; }
.qz__options--compact .qz__mark { margin-top: 0; }
.qz__options--compact .qz__opt-name { margin-bottom: 0; font-size: 15.5px; }

/* ── Поля ─────────────────────────────────────────────────── */
.qz__field { margin-bottom: 18px; }
.qz__label { display: block; font-size: 14.5px; font-weight: 700; color: var(--qz-ink); margin-bottom: 8px; }
.qz__input {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--qz-line);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 16px;
    font-family: inherit;
    color: var(--qz-ink);
    background: #fdfcfa;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.qz__input::placeholder { color: #b3aca3; }
.qz__input:focus {
    outline: none;
    background: #fff;
    border-color: var(--qz-accent);
    box-shadow: 0 0 0 4px rgba(237, 97, 52, .12);
}
.qz__field-hint { font-size: 13px; color: var(--qz-muted); margin: 7px 0 0; line-height: 1.45; }

/* ── Кнопки ───────────────────────────────────────────────── */
.qz__nav { display: flex; align-items: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; position: relative; z-index: 2; }
.qz__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 999px;
    padding: 16px 34px;
    font-family: 'proxima_nova_ltsemibold', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .2s, box-shadow .2s, color .2s, opacity .2s;
}
.qz__btn--next {
    background: linear-gradient(135deg, var(--qz-accent-2), var(--qz-accent));
    color: #fff;
    box-shadow: 0 4px 14px rgba(237, 97, 52, .28);
}
.qz__btn--next:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(237, 97, 52, .36); }
.qz__btn--next:active { transform: translateY(0); }
.qz__btn--next[disabled] {
    background: #e6dfd4;
    color: #a49c92;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.qz__btn--next::after { content: "→"; font-size: 17px; line-height: 1; }
.qz__btn--send::after { content: none; }
.qz__btn--back {
    background: transparent;
    color: var(--qz-muted);
    padding: 14px 18px 14px 8px;
    box-shadow: none;
}
.qz__btn--back::before { content: "←"; font-size: 17px; line-height: 1; }
.qz__btn--back:hover { color: var(--qz-ink); transform: none; }
.qz__btn--send { width: 100%; padding: 18px 34px; font-size: 17px; }
.qz__btn:focus-visible { outline: 2px solid var(--qz-ink); outline-offset: 3px; }

/* ── Согласие и обещание ──────────────────────────────────── */
.qz__agree { display: flex; align-items: flex-start; gap: 11px; margin: 20px 0; }
.qz__agree input { margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--qz-accent); flex: 0 0 auto; }
.qz__agree label { font-size: 13px; line-height: 1.5; color: var(--qz-muted); }
.qz__agree a { color: var(--qz-accent-dark); }
.qz__promise {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 13.5px;
    color: var(--qz-muted);
    text-align: center;
}

/* ── Панель «Ваш запрос» ──────────────────────────────────── */
.qz__side {
    background: #fff;
    border: 1px solid rgba(236, 229, 218, .9);
    border-radius: 24px;
    padding: 26px 26px 28px;
    position: sticky;
    top: 100px;                    /* ниже фиксированной полосы шапки */
    box-shadow: 0 14px 40px rgba(72, 50, 30, .07);
}
.qz__side-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: 'proxima_nova_ltsemibold', Arial, sans-serif;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--qz-ink);
    margin: 0 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--qz-line);
}
.qz__side-title svg { flex: 0 0 auto; color: var(--qz-accent); }

.qz__summary { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.qz__summary li { animation: qz-in .3s ease both; }
.qz__summary-k {
    display: block;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--qz-muted);
    margin-bottom: 7px;
}
.qz__summary-v { display: flex; flex-wrap: wrap; gap: 6px; }
.qz__chip {
    display: inline-block;
    background: var(--qz-tint);
    border: 1px solid rgba(237, 97, 52, .2);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--qz-ink);
    font-weight: 600;
}
.qz__summary-empty { font-size: 14px; line-height: 1.6; color: var(--qz-muted); margin: 0 0 20px; }

.qz__side-foot {
    border-top: 1px solid var(--qz-line);
    padding-top: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--qz-muted);
}
.qz__side-foot b { color: var(--qz-ink); display: block; margin-bottom: 5px; font-size: 14.5px; }

/* ── Адаптив ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .qz__grid { grid-template-columns: 1fr; }
    .qz__side { position: static; order: 2; }
}
@media (max-width: 860px) {
    .qz__steps { display: none; }
    .qz__progress { display: block; }
    .qz__options--two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .qz { padding: 44px 0 52px; }
    .qz__main { padding: 24px 20px 26px; border-radius: 22px; }
    .qz__side { padding: 22px 20px 24px; border-radius: 20px; }
    .qz__opt-box { padding: 16px 17px; gap: 13px; border-radius: 16px; }
    .qz__btn { width: 100%; }
    .qz__nav { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
    .qz__btn--back { order: 2; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .qz *, .qz *::before, .qz *::after { animation: none !important; transition: none !important; }
}
