/* ============================================================
   КОНТЕЙНЕР КВИЗА (flex column — чтобы .sqb-quiz-body скроллился)
   ============================================================ */

.sqb-quiz {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(0,0,0,.06);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    flex: 1 1 auto;
}

.sqb-quiz-header {
    flex: 0 0 auto;
    padding: 24px 24px 0;
    margin-bottom: 20px;
}
.sqb-quiz-title { margin: 0 0 8px; font-size: 22px; }
.sqb-quiz-description { color: #666; font-size: 15px; }

.sqb-quiz-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 0;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   ШАГИ КВИЗА
   ============================================================ */

.sqb-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.35;
}
.sqb-question-desc {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}
.sqb-answers {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
@media (min-width: 560px) {
    .sqb-answers:has(.sqb-answer-with-image) {
        grid-template-columns: 1fr 1fr;
    }
    .sqb-answers .sqb-answer-text-only { grid-column: 1 / -1; }
}

.sqb-answer {
    text-align: left;
    padding: 14px 18px;
    border: 1px solid #dcdcde;
    background: #fff;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all .15s ease;
    color: inherit;
    font-family: inherit;
}
.sqb-answer:hover {
    border-color: #2271b1;
    background: #f0f6fc;
    transform: translateY(-1px);
}

.sqb-answer-with-image {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sqb-answer-with-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: cover;
}
.sqb-answer-with-image.sqb-answer-image-text img { max-height: 180px; }
.sqb-answer-with-image .sqb-answer-text {
    padding: 10px 14px;
    display: block;
}
.sqb-answer-with-image.sqb-answer-image-only .sqb-answer-text { display: none; }

.sqb-back {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 0;
}
.sqb-back:hover { color: #2271b1; }

/* ============================================================
   РЕЗУЛЬТАТ
   ============================================================ */

.sqb-result h4 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #2271b1;
}
.sqb-result-desc { margin-bottom: 16px; font-size: 15px; line-height: 1.5; }

.sqb-path {
    background: #f6f7f7;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.sqb-path ul { margin: 8px 0 0 18px; }

.sqb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sqb-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    background: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    transition: background .15s ease;
    font-family: inherit;
}
.sqb-btn:hover { background: #135e96; }
.sqb-btn:disabled { opacity: .6; cursor: not-allowed; }
.sqb-btn.sqb-restart {
    background: #f0f0f1;
    color: #2c3338;
}
.sqb-btn.sqb-restart:hover { background: #e5e5e5; }

.sqb-thanks { padding: 10px 0; color: #00a32a; font-weight: 600; }
.sqb-error { color: #b32d2e; padding: 12px; background: #fcf0f1; border-radius: 6px; }

/* ============================================================
   STICKY ФУТЕР С КНОПКАМИ НА ФИНАЛЬНОМ ЭКРАНЕ
   ============================================================ */

.sqb-final-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;

    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;

    /* разрываем padding .sqb-quiz-body по бокам */
    margin: 16px -24px 0;
    padding: 14px 24px 18px;

    background: #fff;
    border-top: 1px solid #f0f0f1;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, .05);
}

.sqb-final-actions .sqb-btn {
    flex: 1 1 auto;
    min-width: 160px;
}

/* ============================================================
   ФОРМА
   ============================================================ */

.sqb-contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    max-width: 420px;
}
.sqb-contact-form input[type="text"],
.sqb-contact-form input[type="tel"],
.sqb-contact-form input[type="email"] {
    padding: 12px 14px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}
.sqb-contact-form input[type="text"]:focus,
.sqb-contact-form input[type="tel"]:focus,
.sqb-contact-form input[type="email"]:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.15);
    outline: none;
}

/* ============================================================
   СОГЛАСИЕ
   ============================================================ */

.sqb-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}
.sqb-consent-input {
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    padding: 0 !important;
    margin: 3px 0 0 0 !important;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: checkbox;
    box-sizing: border-box;
}
.sqb-consent-input:checked {
    background: #2271b1;
    border-color: #2271b1;
}
.sqb-consent-input:focus {
    outline: 2px solid rgba(34,113,177,.35);
    outline-offset: 2px;
}
.sqb-consent-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.sqb-consent-text a {
    color: #2271b1;
    text-decoration: underline;
}
.sqb-consent-text a:hover { text-decoration: none; }

/* ============================================================
   reCAPTCHA
   ============================================================ */

.sqb-recaptcha-wrap {
    margin: 14px 0 6px;
    display: flex;
    justify-content: flex-start;
    overflow: hidden;
    max-width: 100%;
}
.sqb-recaptcha {
    min-height: 78px;
    transform-origin: left top;
}

/* ============================================================
   ЗАГРУЗКА ФАЙЛОВ
   ============================================================ */

.sqb-upload {
    margin: 14px 0;
}
.sqb-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 14px;
    color: #1d2327;
    position: relative;
}
.sqb-upload-label:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}
.sqb-upload-icon {
    font-size: 20px;
    flex: 0 0 auto;
}
.sqb-upload-title {
    font-weight: 600;
}
.sqb-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.sqb-upload-hint {
    font-size: 12px;
    color: #646970;
    margin-top: 6px;
    line-height: 1.5;
}
.sqb-upload-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sqb-upload-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: #f0f6fc;
    border: 1px solid #c5d9ec;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
}
.sqb-upload-name { word-break: break-all; color: #1d2327; }
.sqb-upload-size { color: #646970; flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* ============================================================
   МОБИЛЬНЫЕ
   ============================================================ */

@media (max-width: 767px) {
    .sqb-quiz-header {
        padding: 18px 16px 0;
        margin-bottom: 14px;
    }
    .sqb-quiz-title    { font-size: 18px; }
    .sqb-question      { font-size: 16px; }
    .sqb-answer        { padding: 12px 14px; font-size: 14px; }
    .sqb-result h4     { font-size: 18px; }
    .sqb-btn           { padding: 10px 16px; font-size: 14px; }

    .sqb-quiz-body {
        padding: 0 16px 0;
    }

    .sqb-final-actions {
        margin: 12px -16px 0;
        padding: 12px 16px 14px;
        gap: 8px;
    }
    .sqb-final-actions .sqb-btn {
        min-width: 0;
        flex: 1 1 100%;
    }

    .sqb-consent { font-size: 12px; gap: 8px; }
    .sqb-consent-input {
        width: 16px !important;
        height: 16px !important;
        min-width: 16px;
    }
    .sqb-upload-label { padding: 12px 14px; font-size: 13px; }
    .sqb-upload-icon  { font-size: 16px; }
}

@media (max-width: 400px) {
    .sqb-quiz-body { padding: 0 12px 0; }
    .sqb-answer    { padding: 10px 12px; font-size: 13px; }
    .sqb-final-actions {
        margin: 10px -12px 0;
        padding: 10px 12px 12px;
    }
    .sqb-recaptcha { transform: scale(.85); height: 66px; }
}