/*
 * VIP-САЙТ — Квиз-калькулятор CSS
 * Брендбук: Dark #0B0F19, Gold #D4AF37, Glassmorphism, Inter/SF Pro
 */

/* ════ OVERLAY ═══════════════════════════════════════════════════ */
.qm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;

    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.qm-overlay.qm-visible {
    opacity: 1;
    visibility: visible;
}

.qm-overlay.qm-visible .qm-window {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ════ WINDOW ════════════════════════════════════════════════════ */
.qm-window {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;

    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 40px 120px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(212, 175, 55, 0.06);

    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease;

    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.2) transparent;
}

.qm-window::-webkit-scrollbar {
    width: 4px;
}

.qm-window::-webkit-scrollbar-track {
    background: transparent;
}

.qm-window::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.25);
    border-radius: 4px;
}

/* ── Close button ────────────────────────────────────────────── */
.qm-close-btn,
.qm-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    z-index: 10;
}

.qm-close-btn:hover,
.qm-close:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.4);
    color: #D4AF37;
}

/* ════ INNER STRUCTURE ══════════════════════════════════════════ */
.qm-inner {
    padding: 2.5rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ════ PROGRESS BREADCRUMBS ════════════════════════════════════ */
.qm-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 2rem 0 0;
    /* give room for close btn */
}

.qm-bc {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.35;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.qm-bc--done {
    opacity: 0.6;
}

.qm-bc--active {
    opacity: 1;
}

.qm-bc-icon {
    font-size: 1rem;
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, 0.12);
    transition: all 0.3s;
}

.qm-bc--done .qm-bc-icon {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
    color: #D4AF37;
    font-size: 0.7rem;
}

.qm-bc--active .qm-bc-icon {
    background: rgba(212, 175, 55, 0.2);
    border-color: #D4AF37;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.qm-bc-lbl {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.qm-bc-line {
    flex: 1;
    min-width: 1rem;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 0.35rem;
    transition: background 0.3s;
}

.qm-bc-line--done {
    background: rgba(212, 175, 55, 0.35);
}

/* ════ PROGRESS BAR ════════════════════════════════════════════ */
.qm-progress {
    height: 2px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 -2.5rem;
}

.qm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #D4AF37, #F0D57A);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* ════ STEP BODY ════════════════════════════════════════════════ */
.qm-step-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.qm-step-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.qm-step-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #D4AF37;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.qm-step-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: right;
    line-height: 1.4;
}

.qm-question {
    font-size: clamp(1.25rem, 4vw, 1.7rem);
    font-weight: 800;
    color: #F8FAFC;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

/* ════ OPTIONS ══════════════════════════════════════════════════ */
.qm-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.qm-opt {
    display: grid;
    grid-template-columns: 2.8rem 1fr 1.5rem;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
    width: 100%;
    appearance: none;
}

.qm-opt:hover {
    background: rgba(212, 175, 55, 0.06);
    border-color: rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.qm-opt--sel {
    background: rgba(212, 175, 55, 0.1) !important;
    border-color: #D4AF37 !important;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 8px 24px rgba(212, 175, 55, 0.12);
}

.qm-opt-icon {
    font-size: 1.5rem;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.qm-opt--sel .qm-opt-icon {
    background: rgba(212, 175, 55, 0.15);
}

.qm-opt-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.qm-opt-lbl {
    font-size: 0.95rem;
    font-weight: 700;
    color: #F8FAFC;
    line-height: 1.2;
}

.qm-opt-sub {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

.qm-opt--sel .qm-opt-sub {
    color: rgba(212, 175, 55, 0.7);
}

.qm-opt-check {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.qm-opt--sel .qm-opt-check {
    background: #D4AF37;
    border-color: #D4AF37;
}

.qm-opt--sel .qm-opt-check::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%) rotate(45deg);
    width: 5px;
    height: 8px;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
}

/* ════ FOOTER ═══════════════════════════════════════════════════ */
.qm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.qm-price-block {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.qm-price-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.qm-price-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #D4AF37;
    letter-spacing: -0.02em;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qm-price-val.bump {
    transform: scale(1.1);
}

.qm-nav {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.qm-btn-back {
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.qm-btn-back:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.qm-btn-next {
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #D4AF37 0%, #b89326 100%);
    color: #000;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.3);
    transition: all 0.25s;
    letter-spacing: 0.3px;
}

.qm-btn-next:hover:not(:disabled) {
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.45);
    filter: brightness(1.08);
    transform: scale(1.02);
}

.qm-btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ════ LEAD FORM (финальный шаг) ════════════════════════════════ */
.qm-result-card {
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.qm-result-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.9rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #D4AF37;
}

.qm-price-tag {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 900;
    color: #F8FAFC;
    letter-spacing: -0.04em;
}

.qm-result-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.qm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.qm-chip {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
}

.qm-lead-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.qm-input {
    width: 100%;
    padding: 0.95rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #F8FAFC;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.qm-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.qm-input:focus {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.qm-consent-label {
    display: grid;
    grid-template-columns: 1.2rem 1fr;
    gap: 0.75rem;
    align-items: start;
    cursor: pointer;
}

.qm-consent-check {
    display: none;
}

.qm-consent-box {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.qm-consent-check:checked+.qm-consent-box {
    background: #D4AF37;
    border-color: #D4AF37;
}

.qm-consent-check:checked+.qm-consent-box::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 3px;
    width: 5px;
    height: 8px;
    border: 2px solid #000;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.qm-consent-text {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.5;
}

.qm-link {
    color: rgba(212, 175, 55, 0.7);
    text-decoration: underline;
}

.qm-link:hover {
    color: #D4AF37;
}

.qm-submit-btn {
    width: 100%;
    font-size: 1rem;
    padding: 1.1rem;
    border-radius: 12px;
    margin-top: 0.25rem;
}

.qm-micro {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.qm-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: qm-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes qm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ════ SUCCESS SCREEN ═══════════════════════════════════════════ */
.qm-success {
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.qm-success-icon {
    font-size: 4rem;
}

.qm-success h2 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #F8FAFC;
}

.qm-success p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    max-width: 400px;
    line-height: 1.6;
}

.qm-success strong {
    color: #D4AF37;
}

/* ════ MOBILE ════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .qm-window {
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }

    .qm-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .qm-inner {
        padding: 2rem 1.5rem 1.5rem;
    }

    .qm-breadcrumbs {
        display: none;
    }

    /* Hidden on mobile — too tight */
    .qm-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .qm-price-block {
        text-align: center;
    }

    .qm-nav {
        justify-content: space-between;
    }

    .qm-btn-next {
        flex: 1;
    }

    .qm-opt {
        grid-template-columns: 2.4rem 1fr 1.2rem;
        gap: 0.7rem;
        padding: 0.85rem 0.9rem;
    }
}