/* ============================================================
   Quiz — мягкая консультация (3 шага). Общий компонент.
   .quiz--modal  — десктопная центр-модалка (dark-theme, под стиль сайта).
   z-index 10000 — ВЫШЕ AI-чата (9999) и back-to-top (9998), чтобы открытая
   модалка всегда перекрывала плавающие виджеты.
   Самодостаточный CSS (явные цвета slate/blue), не зависит от Tailwind-токенов.
   ============================================================ */

.quiz[hidden] { display: none !important; }

.quiz--modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 16px;
}

.quiz--modal .quiz__overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.quiz--modal[aria-hidden="false"] .quiz__overlay { opacity: 1; }

.quiz--modal .quiz__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    max-height: min(90vh, 760px);
    overflow-y: auto;
    padding: 28px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.1rem;
    box-shadow: 0 30px 80px -20px rgba(2, 6, 23, 0.8);
    color: #fff;
    font-family: inherit;
    transform: translateY(18px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.quiz--modal[aria-hidden="false"] .quiz__card { transform: none; opacity: 1; }
@media (min-width: 720px) { .quiz--modal .quiz__card { padding: 36px; } }

@media (prefers-reduced-motion: reduce) {
    .quiz--modal .quiz__overlay,
    .quiz--modal .quiz__card { transition: none; }
    .quiz--modal .quiz__card { transform: none; }
}

/* ── close ── */
.quiz__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.quiz__close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.quiz__close:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }

/* ── head + progress ── */
.quiz__head { margin-bottom: 18px; padding-right: 40px; }
.quiz__step-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 10px;
}
.quiz__progress { display: flex; gap: 5px; }
.quiz__seg {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.3s ease;
}
.quiz__seg.is-done { background: linear-gradient(90deg, #2563eb, #06b6d4); }

/* ── steps ── */
.quiz__step[hidden] { display: none; }
.quiz__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0 0 20px;
}

/* ── options ── */
.quiz__options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz__options--mb { margin-bottom: 18px; }
.quiz__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 13px 14px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.7rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.quiz__opt:hover { border-color: rgba(59, 130, 246, 0.6); background: rgba(59, 130, 246, 0.08); }
.quiz__opt:active { transform: scale(0.985); }
.quiz__opt:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.quiz__opt i { color: #64748b; font-size: 12px; flex: none; transition: color 0.2s ease; }
.quiz__opt[aria-pressed="true"] {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.18);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.quiz__opt[aria-pressed="true"] i {
    color: #fff;
    background: #2563eb;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}
.quiz__opt[aria-pressed="true"] i::before { content: "\f00c"; } /* fa-check */

/* ── final form ── */
.quiz__form { display: flex; flex-direction: column; gap: 12px; }
.quiz__benefit {
    margin: 0 0 2px;
    font-size: 13px;
    line-height: 1.45;
    color: #94a3b8;
}
.quiz__input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 15px;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.6rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.quiz__input::placeholder { color: #64748b; }
.quiz__input:focus { outline: none; border-color: #3b82f6; background: rgba(255, 255, 255, 0.06); }

.quiz__hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.quiz__status:empty { display: none; }
.quiz__status {
    font-size: 13px;
    line-height: 1.4;
    padding: 9px 12px;
    border-radius: 0.5rem;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}
.quiz__status.is-error {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.quiz__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    border: none;
    border-radius: 0.7rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.quiz__submit:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(37, 99, 235, 0.6); }
.quiz__submit:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.quiz__submit:disabled { opacity: 0.65; cursor: default; transform: none; box-shadow: none; }
.quiz__submit i { font-size: 12px; }

/* ── nav ── */
.quiz__nav { display: flex; gap: 10px; margin-top: 18px; }
.quiz__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
}
.quiz__btn i { font-size: 11px; }
.quiz__btn:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.quiz__btn:disabled { opacity: 0.4; cursor: default; }
.quiz__btn--ghost {
    flex: 0 0 auto;
    min-width: 110px;
    color: #cbd5e1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.quiz__btn--ghost:not(:disabled):hover { border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.04); }
.quiz__btn--next {
    flex: 1;
    color: #fff;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    border: none;
}
.quiz__btn--next:not(:disabled):hover { transform: translateY(-1px); }

/* ── success ── */
.quiz__success[hidden] { display: none; }
.quiz__success { text-align: center; padding: 18px 4px 6px; outline: none; }
.quiz__success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    font-size: 28px;
}
.quiz__success-title { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.quiz__success-text { font-size: 14px; line-height: 1.5; color: #94a3b8; max-width: 40ch; margin: 0 auto 18px; }
.quiz__success-close {
    height: 46px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 600;
    color: #cbd5e1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.quiz__success-close:hover { border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.04); }
.quiz__success-close:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }

/* consent-checkbox partial уже dark-themed (Tailwind) — лишних правил не требует */
