/* =====================================================================
   Homeservice — квиз-калькулятор заявки
   Мобайл-фёрст: основной трафик приходит из Instagram, с телефона.
   Все тапабельные элементы — не ниже 48px.
   Использует переменные и кнопки темы (homeservice.css), своей
   дизайн-системы не заводит.
   ===================================================================== */

.hs-quiz {
    font-family: var(--hs-font);
    color: var(--hs-ink);
    background: #fff;
    border: 1px solid var(--hs-line);
    border-radius: var(--hs-radius-lg);
    box-shadow: var(--hs-shadow);
    padding: 20px 16px 22px;
    max-width: 640px;
    margin-inline: auto;
    width: 100%;
}
.hs-quiz *, .hs-quiz *::before, .hs-quiz *::after { box-sizing: border-box; }

/* ---------- Шапка: заголовок, прогресс, «Назад» ---------- */
.hs-quiz-title { font-size: 20px; font-weight: 800; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.01em; }
.hs-quiz-sub { font-size: 14px; color: var(--hs-ink-2); margin: 0 0 16px; line-height: 1.5; }

.hs-quiz-bar { height: 6px; border-radius: 4px; background: var(--hs-line-2); overflow: hidden; }
.hs-quiz-bar-fill { display: block; height: 100%; width: 16%; border-radius: 4px; background: linear-gradient(90deg, var(--hs-brand), var(--hs-brand-dark)); transition: width .3s ease; }

.hs-quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; min-height: 34px; }
.hs-quiz-back {
    display: inline-flex; align-items: center; gap: 5px;
    border: 0; background: none; padding: 8px 6px 8px 0; margin: 0;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--hs-ink-2);
    cursor: pointer; border-radius: 8px;
}
.hs-quiz-back:hover { color: var(--hs-brand-dark); }
.hs-quiz-back[hidden] { display: none; }
.hs-quiz-counter { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--hs-muted); white-space: nowrap; }

/* ---------- Шаг ---------- */
.hs-quiz-step[hidden] { display: none; }
.hs-quiz-step { animation: hs-quiz-in .22s ease; }
@keyframes hs-quiz-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .hs-quiz-step { animation: none; }
    .hs-quiz-bar-fill { transition: none; }
}

.hs-quiz-q { font-size: 19px; font-weight: 800; line-height: 1.3; margin: 16px 0 14px; letter-spacing: -.01em; }
.hs-quiz-q:focus { outline: none; }
.hs-quiz-q:focus-visible { outline: 2px solid var(--hs-brand); outline-offset: 4px; border-radius: 6px; }
.hs-quiz-note { font-size: 13.5px; color: var(--hs-ink-2); margin: -8px 0 14px; line-height: 1.5; }

/* ---------- Варианты ответа ---------- */
.hs-quiz-opts { display: grid; gap: 10px; }
.hs-quiz-opt {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 56px; padding: 13px 16px;
    text-align: left; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--hs-ink);
    background: var(--hs-bg-soft); border: 1.5px solid var(--hs-line); border-radius: 14px;
    cursor: pointer; transition: border-color .15s, background .15s, transform .12s;
}
.hs-quiz-opt:hover { border-color: var(--hs-brand); background: #fff; }
.hs-quiz-opt:active { transform: scale(.995); }
.hs-quiz-opt:focus-visible { outline: 2px solid var(--hs-brand); outline-offset: 2px; }
.hs-quiz-opt-mark {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--hs-line); background: #fff; position: relative; transition: border-color .15s;
}
.hs-quiz-opt-mark::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%;
    background: var(--hs-brand); transform: scale(0); transition: transform .15s;
}
.hs-quiz-opt:hover .hs-quiz-opt-mark { border-color: var(--hs-brand); }
.hs-quiz-opt[aria-checked="true"] { border-color: var(--hs-brand); background: var(--hs-brand-soft); }
.hs-quiz-opt[aria-checked="true"] .hs-quiz-opt-mark { border-color: var(--hs-brand); }
.hs-quiz-opt[aria-checked="true"] .hs-quiz-opt-mark::after { transform: scale(1); }
.hs-quiz-opt-txt { flex: 1 1 auto; }

/* ---------- Шаг контактов ---------- */
.hs-quiz-recap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 16px; }
.hs-quiz-recap:empty { display: none; }
.hs-quiz-recap-lbl { font-size: 12.5px; font-weight: 700; color: var(--hs-muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.hs-quiz-recap-item {
    display: inline-block; padding: 5px 11px; border-radius: 20px;
    background: var(--hs-brand-soft); color: var(--hs-brand-dark);
    font-size: 13px; font-weight: 700; line-height: 1.3;
}
.hs-quiz-fields { display: grid; gap: 2px; }
.hs-quiz .hs-field { margin-bottom: 12px; }
.hs-quiz .hs-field input,
.hs-quiz .hs-field textarea { min-height: 48px; font-size: 16px; } /* 16px — иначе iOS зумит форму */
.hs-quiz .hs-field label .req { color: var(--hs-brand); }

.hs-quiz-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.hs-quiz-check {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 9px 14px; border: 1.5px solid var(--hs-line); border-radius: 12px;
    background: var(--hs-bg-soft); font-size: 14.5px; font-weight: 600; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.hs-quiz-check:hover { border-color: var(--hs-brand); }
.hs-quiz-check input { width: 19px; height: 19px; accent-color: var(--hs-brand); margin: 0; flex: 0 0 auto; }
.hs-quiz-check input:checked ~ span { color: var(--hs-brand-dark); }

.hs-quiz-consent { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; font-size: 13.5px; color: var(--hs-ink-2); line-height: 1.45; cursor: pointer; }
.hs-quiz-consent input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--hs-brand); flex: 0 0 auto; }

.hs-quiz-err { font-size: 13.5px; color: var(--hs-danger); font-weight: 600; line-height: 1.4; }
.hs-quiz-err:empty, .hs-quiz-err:not(.is-on) { display: none; }
.hs-quiz .js-quiz-phone-err { margin-top: 6px; }
.hs-quiz .js-quiz-form-err { margin-top: 10px; }
.hs-quiz .js-quiz-consent-err { margin: 0 0 10px; }
.hs-quiz .hs-policy { text-align: center; }

/* ---------- Финальный экран ---------- */
.hs-quiz-done { text-align: center; padding: 14px 4px 8px; }
.hs-quiz-done[hidden] { display: none; }
.hs-quiz-done-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 62px; height: 62px; border-radius: 50%;
    background: var(--hs-brand-soft); color: var(--hs-brand-dark); margin-bottom: 14px;
}
.hs-quiz-done h3 { font-size: 21px; font-weight: 800; margin: 0 0 8px; }
.hs-quiz-done h3:focus { outline: none; }
.hs-quiz-done p { font-size: 14.5px; color: var(--hs-ink-2); margin: 0 0 8px; line-height: 1.55; }
.hs-quiz-done-phone a { font-weight: 800; color: var(--hs-brand-dark); text-decoration: none; white-space: nowrap; }
.hs-quiz-done-phone a:hover { text-decoration: underline; }

/* ---------- Квиз внутри модалки ---------- */
.hs-modal-box--quiz { max-width: 560px; padding: 0; background: transparent; box-shadow: none; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hs-modal-box--quiz .hs-modal-close { top: 12px; right: 12px; z-index: 2; }
.hs-quiz--modal { border-radius: 22px; padding: 22px 18px 24px; box-shadow: var(--hs-shadow-lg); max-width: none; }
.hs-quiz--modal .hs-quiz-title { padding-right: 44px; }

/* ---------- Планшет и десктоп ---------- */
@media (min-width: 560px) {
    .hs-quiz { padding: 30px 30px 32px; }
    .hs-quiz-title { font-size: 24px; }
    .hs-quiz-q { font-size: 22px; }
    .hs-quiz-opt { font-size: 16px; padding: 15px 18px; }
    .hs-quiz-fields { grid-template-columns: 1fr 1fr; gap: 0 14px; }
    .hs-quiz-fields .hs-field:nth-child(n+3) { grid-column: 1 / -1; }
    .hs-quiz--modal { padding: 30px 30px 32px; }
}

/* ---------- Посадочная «Квиз-расчёт» ---------- */
.hs-quiz-page { font-family: var(--hs-font); color: var(--hs-ink); background: var(--hs-bg-soft); min-height: 100vh; display: flex; flex-direction: column; }
.hs-quiz-page-header { background: #fff; border-bottom: 1px solid var(--hs-line); }
.hs-quiz-page-header::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--hs-brand), var(--hs-brand-dark)); }
.hs-quiz-page-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px clamp(16px, 5vw, 60px); }
.hs-quiz-page-header .hs-logo-img { height: clamp(34px, 6vw, 46px); }
.hs-quiz-page-phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: clamp(14px, 3.4vw, 17px); color: var(--hs-ink); text-decoration: none; white-space: nowrap; }
.hs-quiz-page-phone:hover { color: var(--hs-brand-dark); }
.hs-quiz-page-phone small { display: block; font-size: 11px; font-weight: 600; color: var(--hs-muted); }

.hs-quiz-page-main { flex: 1 1 auto; padding: clamp(22px, 5vw, 48px) clamp(16px, 5vw, 60px) clamp(34px, 6vw, 64px); }
.hs-quiz-page-lead { max-width: 640px; margin: 0 auto clamp(18px, 4vw, 28px); text-align: center; }
.hs-quiz-page-lead h1 { font-size: clamp(24px, 6vw, 36px); font-weight: 800; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.hs-quiz-page-lead p { font-size: clamp(14.5px, 3.6vw, 17px); color: var(--hs-ink-2); margin: 0; line-height: 1.55; }

/* Блок доверия под квизом */
.hs-quiz-trust { max-width: 960px; margin: clamp(30px, 6vw, 54px) auto 0; }
.hs-quiz-trust h2 { font-size: clamp(19px, 4.6vw, 25px); font-weight: 800; margin: 0 0 18px; text-align: center; }
.hs-quiz-trust-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.hs-quiz-trust-item { background: #fff; border: 1px solid var(--hs-line); border-radius: var(--hs-radius); padding: 16px 18px; }
.hs-quiz-trust-item h3 { font-size: 15.5px; font-weight: 800; margin: 0 0 5px; }
.hs-quiz-trust-item p { font-size: 14px; color: var(--hs-ink-2); margin: 0; line-height: 1.5; }
.hs-quiz-photos { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 16px; }
.hs-quiz-photos .hs-photo { margin: 0; border-radius: var(--hs-radius); overflow: hidden; }
.hs-quiz-photos .hs-photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }

.hs-quiz-page-footer { background: #fff; border-top: 1px solid var(--hs-line); padding: 18px clamp(16px, 5vw, 60px); font-size: 12.5px; color: var(--hs-muted); text-align: center; line-height: 1.6; }
.hs-quiz-page-footer a { color: var(--hs-ink-2); }

@media (min-width: 700px) {
    .hs-quiz-trust-grid { grid-template-columns: repeat(3, 1fr); }
    .hs-quiz-photos { grid-template-columns: repeat(2, 1fr); }
}
