/* -------- Модальное окно квиза -------- */
.quiz-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(34, 73, 58, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s ease;
}

.quiz-modal.is-open {
    display: flex;
    opacity: 1;
}

.quiz-inner {
    position: relative;
    width: 100%;
    max-width: 28rem;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #f2f3ef;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
    /* font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; */
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: #433c2e;
}

.quiz-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(67, 60, 46, .06);
    color: #433c2e;
    font-size: 20px;
    line-height: 1;
    transition: background .2s;
}

.quiz-close:hover {
    background: rgba(67, 60, 46, .12);
}

.quiz-screen {
    padding: 32px 20px;
}

@media (min-width: 640px) {
    .quiz-screen {
        padding: 40px 24px;
    }
}

/* -------- Стартовый экран -------- */
.quiz-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 480px;
}

.quiz-start-img {
    width: 13rem;
    aspect-ratio: 1;
    border-radius: 24px;
    border: 1px solid rgba(143, 160, 124, .2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
    background: linear-gradient(135deg, #cfe0c2 0%, #8fa07c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 44px;
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

@media (min-width: 640px) {
    .quiz-start-img {
        width: 15rem;
    }
}

.quiz-start h1 {
    margin-top: 2rem;
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    color: #433c2e;
}

.quiz-start p {
    margin-top: 1rem;
    max-width: 24rem;
    font-size: 1rem;
    line-height: 1.625;
    color: #55514a;
}

.quiz-start-badge {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .375rem 1rem;
    border-radius: 9999px;
    background: rgba(143, 160, 124, .1);
    color: #6f7f5e;
    font-size: .75rem;
    font-weight: 600;
}

.quiz-start-btn {
    margin-top: 2.5rem;
    width: 100%;
    max-width: 20rem;
    padding: 1rem;
    border-radius: 9999px;
    background: #8fa07c;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
    transition: background .2s;
}

.quiz-start-btn:hover {
    background: #6f7f5e;
}

/* -------- Прогресс -------- */
.quiz-progress {
    margin-bottom: 1.5rem;
}

.quiz-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .75rem;
    font-weight: 600;
    color: #6f7f5e;
}

.quiz-progress-track {
    margin-top: .5rem;
    height: .375rem;
    width: 100%;
    border-radius: 9999px;
    background: #d9ddd2;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    border-radius: 9999px;
    background: #8fa07c;
    transition: width .3s ease;
}

/* -------- Вопрос -------- */
.quiz-q-title {
    font-size: 1.5rem;
    line-height: 1.375;
    font-weight: 700;
    color: #433c2e;
}

.quiz-q-hint {
    margin-top: .5rem;
    font-size: .875rem;
    color: #6b6a63;
}

.quiz-options {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 2px solid #d9ddd2;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.quiz-option:hover {
    border-color: rgba(143, 160, 124, .5);
}

.quiz-option.is-selected {
    border-color: #8fa07c;
    background: rgba(143, 160, 124, .08);
}

.quiz-option-emoji {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #f2f3ef;
    font-size: 1.25rem;
    line-height: 1;
}

.quiz-option-body {
    flex: 1;
    min-width: 0;
}

.quiz-option-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #433c2e;
}

.quiz-option-sub {
    display: block;
    margin-top: 2px;
    font-size: .75rem;
    color: #6b6a63;
}

.quiz-option-radio {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid #c9cdc2;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
}

.quiz-option.is-selected .quiz-option-radio {
    border-color: #8fa07c;
    background: #8fa07c;
}

.quiz-option.is-selected .quiz-option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.quiz-option[data-multi="true"] .quiz-option-radio {
    border-radius: 4px;
}

.quiz-option[data-multi="true"].is-selected .quiz-option-radio::after {
    border-radius: 2px;
}

/* -------- Кнопки внизу -------- */
.quiz-footer {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.quiz-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: #8fa07c;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
    transition: background .2s, opacity .2s;
}

.quiz-btn:hover:not(:disabled) {
    background: #6f7f5e;
}

.quiz-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.quiz-btn-back {
    width: 100%;
    padding: .875rem;
    border-radius: 9999px;
    border: 2px solid #d9ddd2;
    background: transparent;
    font-size: .875rem;
    font-weight: 600;
    color: #6b6a63;
    transition: border-color .2s, color .2s;
}

.quiz-btn-back:hover {
    border-color: #8fa07c;
    color: #433c2e;
}

/* -------- Экран результата -------- */
.quiz-result {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.quiz-result-label {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.75rem;
    color: #8fa07c;
}

.quiz-result-title {
    margin-top: .5rem;
    font-size: 1.5rem;
    line-height: 1.375;
    font-weight: 700;
    color: #433c2e;
}

.quiz-result-desc {
    margin-top: .75rem;
    font-size: 1rem;
    line-height: 1.625;
    color: #55514a;
}

.quiz-result-card {
    position: relative;
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(143, 160, 124, .2);
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.quiz-copy {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem;
    border-radius: 9999px;
    border: 1px solid #d9ddd2;
    background: #fff;
    color: #6f7f5e;
    font-size: .75rem;
    font-weight: 600;
    transition: border-color .2s, color .2s;
}

.quiz-copy:hover {
    border-color: #8fa07c;
    color: #433c2e;
}

.quiz-result-card-heading {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #8fa07c;
    padding-right: 7rem;
}

.quiz-result-card-text {
    margin-top: .5rem;
    font-size: 1rem;
    line-height: 1.625;
    color: #433c2e;
}

.quiz-result-card-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f1ec;
    font-size: .875rem;
    font-style: italic;
    line-height: 1.625;
    color: #6b6a63;
}

.quiz-result-footer {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.quiz-result-cta {
    display: block;
    width: 100%;
    padding: 1rem;
    border-radius: 9999px;
    background: #8fa07c;
    color: #fff;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
    transition: background .2s;
}

.quiz-result-cta:hover {
    background: #6f7f5e;
}

@media (prefers-reduced-motion: reduce) {

    .quiz-modal,
    .quiz-progress-bar {
        transition: none;
    }
}

/* =========================================================
   Экран "Следующий шаг" (финальный)
   ========================================================= */
.quiz-nextstep {
    display: flex;
    flex-direction: column;
}

.quiz-nextstep-title {
    font-size: 1.5rem;
    line-height: 1.375;
    font-weight: 700;
    color: #433c2e;
}

.quiz-nextstep-desc {
    margin-top: .75rem;
    font-size: 1rem;
    line-height: 1.625;
    color: #55514a;
}

.quiz-nextstep-cta {
    display: block;
    margin-top: 1.5rem;
    width: 100%;
    padding: 1rem;
    border-radius: 9999px;
    background: #8fa07c;
    color: #fff;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
    transition: background .2s;
}

.quiz-nextstep-cta:hover {
    background: #6f7f5e;
}

/* Карточки */
.quiz-nextstep-card {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid #d9ddd2;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.quiz-nextstep-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #433c2e;
}

.quiz-nextstep-card-desc {
    margin-top: .25rem;
    font-size: .875rem;
    color: #6b6a63;
}

/* Контурная кнопка "Написать мне" */
.quiz-nextstep-btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    margin-top: 1rem;
    padding: .875rem;
    border-radius: 9999px;
    border: 2px solid #8fa07c;
    background: transparent;
    font-size: .875rem;
    font-weight: 700;
    color: #6f7f5e;
    transition: background .2s, color .2s;
}

.quiz-nextstep-btn-outline:hover {
    background: #8fa07c;
    color: #fff;
}

/* Список контактов */
.quiz-nextstep-contacts {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #d9ddd2;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.quiz-nextstep-contacts-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8b8a82;
}

.quiz-contact-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem .75rem;
    border-radius: .75rem;
    border: 1px solid #d9ddd2;
    font-size: .875rem;
    color: #433c2e;
    transition: border-color .2s, background .2s;
}

.quiz-contact-item:hover {
    border-color: #8fa07c;
    background: #f2f3ef;
}

.quiz-contact-item-icon {
    display: inline-flex;
    width: 1.25rem;
    justify-content: center;
    color: #6f7f5e;
    font-size: 1rem;
    line-height: 1;
}

.quiz-contact-item-name {
    font-weight: 600;
}

.quiz-contact-item-value {
    margin-left: auto;
    color: #6b6a63;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Форма "Оставьте контакт" */
.quiz-nextstep-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-nextstep-field {
    display: block;
}

.quiz-nextstep-field-label {
    display: block;
    margin-bottom: .25rem;
    font-size: .875rem;
    font-weight: 600;
    color: #433c2e;
}

.quiz-nextstep-input {
    width: 100%;
    padding: .75rem 1rem;
    border-radius: .75rem;
    border: 1px solid #d9ddd2;
    background: #f8f9f5;
    font-size: .875rem;
    color: #433c2e;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
}

.quiz-nextstep-input:focus {
    border-color: #8fa07c;
}

.quiz-nextstep-submit {
    width: 100%;
    padding: 1rem;
    border-radius: 9999px;
    background: #6f7f5e;
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
    transition: background .2s, opacity .2s;
}

.quiz-nextstep-submit:hover:not(:disabled) {
    background: #8fa07c;
}

.quiz-nextstep-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.quiz-nextstep-thanks {
    margin-top: 1rem;
    padding: .875rem 1rem;
    border-radius: .75rem;
    background: rgba(143, 160, 124, .1);
    color: #6f7f5e;
    font-size: .875rem;
    font-weight: 600;
    text-align: center;
}

/* Кнопка "Пройти заново" */
.quiz-nextstep-restart {
    margin-top: 1.5rem;
    width: 100%;
    padding: .5rem;
    text-align: center;
    font-size: .875rem;
    font-weight: 600;
    color: #8fa07c;
    background: transparent;
    transition: color .2s;
}

.quiz-nextstep-restart:hover {
    color: #6f7f5e;
}