/* ===== Квиз «Подбор памятника» ===== */
.quiz-wrap {
    margin: 0 auto;
    box-sizing: border-box;
    color: #222;
    padding: 30px 0px;
}

.quiz-wrap *,
.quiz-wrap *::before,
.quiz-wrap *::after {
    box-sizing: border-box;
}

.quiz-title {
    text-align: center;
    margin: 0 0 30px;
    line-height: 1.3;
}

.quiz-title span:first-child {
    display: block;
    font-size: 42px;
    text-transform: uppercase;
    font-weight: 700;
    color: #1a1a1a;
}

.quiz-title span:last-child {
    display: block;
    font-size: 38px;
    text-transform: uppercase;
    font-weight: 700;
    color: #b8954f;
}

/* Основной контейнер */
.quiz-box {
    display: flex;
    border: 10px solid #b8954f;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 24px rgba(184, 149, 79, 0.12);
}

.quiz-main {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
    min-height: 420px;
    position: relative;
    overflow: hidden;
}

.quiz-main.is-animating {
    overflow: hidden;
}

/* Слайд-анимация шагов */
.quiz-slide {
    position: relative;
    width: 100%;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.quiz-slide--enter {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    opacity: 0;
    transform: translateX(30px);
    transition: transform 0.35s ease, opacity 0.35s ease;
    pointer-events: none;
}

.quiz-slide--enter.is-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.quiz-slide--exit {
    transition: transform 0.35s ease, opacity 0.35s ease;
    transform: translateX(-30px);
    opacity: 0;
    pointer-events: none;
}

.quiz-side {
    width: 320px;
    flex-shrink: 0;
    background: #faf8f4;
    border-left: 2px solid #b8954f;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}

/* Заголовок шага */
.quiz-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 12px;
}

.quiz-step-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.35;
}

.quiz-step-num {
    font-size: 22px;
    color: #999;
    white-space: nowrap;
    padding-top: 3px;
    font-weight: 900;
}

/* Варианты */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.quiz-option {
    border: 2px solid #e8e4dc;
    border-radius: 6px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    user-select: none;
}

.quiz-option:hover {
    border-color: #b8954f;
    box-shadow: 0 2px 12px rgba(184, 149, 79, 0.15);
}

.quiz-option.selected {
    border-color: #b8954f;
    background: #fdf9f0;
    box-shadow: 0 0 0 1px #b8954f;
}

.quiz-option-img {
    width: 100%;
    height: 170px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f3ef;
    position: relative;
}

.quiz-option-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Заглушки изображений */
.ph {
    width: 70%;
    height: 80%;
    border-radius: 6px;
}

.ph-granite { background: linear-gradient(145deg, #2a2a2a, #444); }
.ph-marble  { background: linear-gradient(145deg, #d8d4cc, #eeeae2); }
.ph-unknown {
    background: #e8e4dc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    color: #555;
}

.ph-black  { background: #1a1a1a; }
.ph-white  { background: #f5f5f5; border: 1px solid #ddd; }
.ph-brown  { background: #8B4513; }
.ph-green  { background: #1a6b2e; }

.ph-rect {
    background: #222;
    width: 45%;
    height: 75%;
    border-radius: 4px 4px 2px 2px;
}
.ph-cross {
    background: #222;
    width: 40%;
    height: 70%;
    border-radius: 3px;
    position: relative;
}
.ph-cross::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 28px;
    background: #222;
    clip-path: polygon(40% 0, 60% 0, 60% 35%, 100% 35%, 100% 50%, 60% 50%, 60% 100%, 40% 100%, 40% 50%, 0 50%, 0 35%, 40% 35%);
}
.ph-wave {
    background: #222;
    width: 42%;
    height: 78%;
    border-radius: 50% 50% 8px 8px / 20% 20% 8px 8px;
}
.ph-arch {
    background: #222;
    width: 55%;
    height: 70%;
    border-radius: 50% 50% 4px 4px / 45% 45% 4px 4px;
    position: relative;
}
.ph-arch::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8%;
    width: 12%;
    height: 55%;
    background: #222;
    border-radius: 3px 3px 0 0;
}
.ph-arch::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 8%;
    width: 12%;
    height: 55%;
    background: #222;
    border-radius: 3px 3px 0 0;
}

.ph-vert {
    background: #555;
    width: 35%;
    height: 80%;
    border-radius: 3px;
}
.ph-horiz {
    background: #555;
    width: 70%;
    height: 45%;
    border-radius: 3px;
}
.ph-full {
    background: #555;
    width: 45%;
    height: 75%;
    border-radius: 4px 4px 2px 2px;
    position: relative;
}
.ph-full::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 40px;
    background: #777;
    border-radius: 50% 50% 40% 40%;
}

.quiz-option-label {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.quiz-option-desc {
    font-size: 14px;
    color: #888;
    line-height: 1.35;
}

/* Кнопки навигации */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quiz-nav--form {
    margin-top: 20px;
}

.quiz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.quiz-btn-back {
    background: #fff;
    color: #666;
    border: 1.5px solid #ddd !important;
}

.quiz-btn-back:hover {
    border-color: #bbb !important;
    color: #333;
}

.quiz-btn-back.is-hidden {
    visibility: hidden;
}

.quiz-btn-next,
.quiz-btn-submit {
    background: #A67F3E;
    color: #fff;
    box-shadow: 0 2px 8px rgba(168, 132, 58, 0.35);
}

.quiz-btn-next:hover,
.quiz-btn-submit:hover {
    background: #d4b36a;
    box-shadow: 0 3px 12px rgba(168, 132, 58, 0.45);
}

.quiz-btn-next:disabled,
.quiz-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.quiz-btn-submit {
    width: 100%;
    margin-top: 8px;
    max-width: 500px;
}

.quiz-btn-captcha {
    width: 100%;
    background: #A67F3E;
    color: #fff;
    margin-bottom: 12px;
    padding: 14px;
}

/* Форма */
.quiz-form-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.quiz-form-title span {
    color: #b8954f;
}

.quiz-form-sub {
    font-size: 14px;
    color: #777;
    margin: 0 0 24px;
    line-height: 1.45;
}

.quiz-field {
    margin-bottom: 18px;
    max-width: 500px;
}

.quiz-field label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 0;
}

.quiz-field input[type="text"],
.quiz-field input[type="tel"] {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1.5px solid #ddd;
    font-size: 16px;
    outline: none;
    background: transparent;
    transition: border-color 0.2s;
    color: #222;
}

.quiz-field input::placeholder {
    color: #888;
    font-size: 15px;
}

.quiz-field input:focus {
    border-bottom-color: #b8954f;
}

.quiz-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    cursor: pointer;
}

.quiz-checkbox input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #b8954f;
}

.quiz-checkbox a {
    color: #b8954f;
    text-decoration: underline;
}

.quiz-note {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

.quiz-error {
    color: #c0392b;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.quiz-error.show {
    display: block;
}

/* Успех */
.quiz-success {
    text-align: center;
    padding: 40px 20px;
}

.quiz-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #A67F3E;
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.quiz-success h3 {
    font-size: 22px;
    margin: 0 0 10px;
    color: #1a1a1a;
}

.quiz-success p {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Правый блок */
.quiz-manager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.quiz-manager-photo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, #c9a55a, #8a6d3a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}
.quiz-manager-photo img {
  width: 100%;
  border-radius: 100%;
  border: 1px solid #ccc;
}

.quiz-manager-info strong {
    display: block;
    font-size: 15px;
    color: #222;
}

.quiz-manager-info span {
    font-size: 12px;
    color: #888;
}

.quiz-side-msg {
    background: #f0ebe3;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    margin-bottom: auto;
}

.quiz-side-msg strong {
    color: #b8954f;
}

.quiz-side-footer {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
    line-height: 1.4;
}

/* Адаптив */
@media (max-width: 800px) {
    .quiz-box {
        flex-direction: column;
    }

    .quiz-side {
        width: 100%;
        border-left: none;
        border-top: 2px solid #b8954f;
        padding: 20px;
    }

    .quiz-main {
        padding: 20px 18px;
        min-height: 380px;
    }

    .quiz-title span {
        font-size: 22px !important;
    }

    .quiz-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quiz-option-img {
        height: 90px;
    }

    .quiz-step-title {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .quiz-options {
        grid-template-columns: 1fr 1fr;
    }

    .quiz-option {
        padding: 12px 8px;
    }

    .quiz-btn {
        padding: 11px 18px;
        font-size: 14px;
    }
}

/* Fallback изображений */
.quiz-option-img img.is-hidden {
    display: none;
}

.quiz-option-img .ph {
    display: none;
}

.quiz-option-img .ph.is-fallback {
    display: flex;
}
