/* Quiz «Нужна ли вам матрица?» — секция на странице и модальное окно */

/* Section wrapper */
.quiz-section-wrapper {
    padding: 60px 0 40px;
    position: relative;
}

.quiz-section-wrapper .container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

.quiz-section-wrapper .quiz-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.quiz-section-wrapper .quiz-section-badge {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(139, 92, 246, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.quiz-section-wrapper .quiz-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.3;
}

/* ─── QUIZ ENGINE CONTAINER ─── */
.quiz-engine {
    position: relative;
}

.quiz-inner {
    background: linear-gradient(165deg,
        rgba(30, 25, 55, 0.98) 0%,
        rgba(18, 14, 38, 0.98) 50%,
        rgba(25, 20, 45, 0.98) 100%);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(212, 175, 55, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

.quiz-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.25) 20%,
        rgba(5, 150, 105, 0.3) 50%,
        rgba(212, 175, 55, 0.25) 80%,
        transparent 100%);
}

/* ─── HEADER ─── */
.quiz-header {
    text-align: center;
    margin-bottom: 24px;
    position: static;
}

.quiz-badge {
    display: inline-block;
    padding: 5px 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(5, 150, 105, 0.08) 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(245, 230, 170, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.quiz-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #E8D96A 0%, #D4AF37 40%, #C9A961 70%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.quiz-subtitle {
    font-size: 14px;
    color: rgba(212, 212, 230, 0.75);
    margin: 0;
    line-height: 1.5;
}

.quiz-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.35);
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.quiz-close:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ─── PROGRESS BAR ─── */
.quiz-progress {
    position: relative;
    height: 4px;
    background: rgba(5, 150, 105, 0.12);
    border-radius: 4px;
    margin-bottom: 28px;
    overflow: visible;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669 0%, #10b981 50%, #34D399 100%);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.3);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 11px;
    color: rgba(16, 185, 129, 0.85);
    font-weight: 600;
}

/* ─── QUESTION AREA ─── */
.quiz-question-area {
    min-height: 200px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.quiz-fade-out {
    opacity: 0;
    transform: translateY(8px);
}

.quiz-fade-in {
    opacity: 1;
    transform: translateY(0);
    animation: quizFadeIn 0.35s ease forwards;
}

@keyframes quizFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── QUESTION ─── */
.quiz-question {
    font-size: 17px;
    font-weight: 600;
    color: rgba(232, 238, 243, 0.95);
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: center;
}

/* ─── OPTIONS ─── */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: rgba(30, 35, 55, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    color: rgba(232, 238, 243, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-family-base, 'Inter', sans-serif);
    line-height: 1.4;
}

.quiz-option:hover {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
}

.quiz-option:active {
    transform: translateY(0);
}

.quiz-option-selected {
    background: rgba(5, 150, 105, 0.2) !important;
    border-color: rgba(5, 150, 105, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(5, 150, 105, 0.2) !important;
    pointer-events: none;
}

/* ─── RESULT ─── */
.quiz-result-area {
    min-height: 220px;
}

.quiz-result {
    text-align: center;
    padding: 16px 0;
}

.quiz-result-icon {
    font-size: 40px;
    margin-bottom: 16px;
    line-height: 1;
}

.quiz-result-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #E8D96A 0%, #D4AF37 40%, #C9A961 70%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.quiz-result-text {
    font-size: 14px;
    color: rgba(212, 218, 235, 0.9);
    line-height: 1.6;
    margin: 0 0 24px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA wrapper — centers button */
.quiz-result-cta-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.quiz-result-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 44px;
    background: linear-gradient(135deg,
        #065f46 0%,
        #047857 20%,
        #059669 40%,
        #10b981 55%,
        #059669 70%,
        #047857 85%,
        #065f46 100%);
    background-size: 300% 100%;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.2);
    font-family: var(--font-family-base, 'Inter', sans-serif);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 56px;
}

.quiz-result-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.quiz-result-cta:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.25);
}

.quiz-result-cta:hover::before {
    left: 100%;
}

.quiz-result-cta:active {
    transform: translateY(0);
}

/* ─── RESULT LEVELS ─── */
.quiz-result-high .quiz-result-title {
    color: #a78bfa;
}

.quiz-result-medium .quiz-result-title {
    color: #e2e8f0;
}

.quiz-result-low .quiz-result-title {
    color: #94a3b8;
}

/* ─── MODAL OVERLAY ─── */
.quiz-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-modal-overlay.quiz-modal-visible {
    opacity: 1;
    visibility: visible;
}

.quiz-modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.quiz-modal-visible .quiz-modal-content {
    transform: scale(1);
}

.quiz-modal-content .quiz-inner {
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 175, 55, 0.08),
        0 0 40px rgba(5, 150, 105, 0.08);
}

/* ─── SECTION HIGHLIGHTS ─── */
.quiz-section-highlight .quiz-inner {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.quiz-section-pulse .quiz-inner {
    animation: quizPulse 1s ease-in-out 2;
}

@keyframes quizPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 16px rgba(139, 92, 246, 0.1); }
}

/* Quiz responsive */
@media (max-width: 768px) {
    .quiz-section-wrapper {
        padding: 40px 0 30px;
    }

    .quiz-section-wrapper .quiz-section-title {
        font-size: 22px;
    }

    .quiz-inner {
        padding: 28px 20px 22px;
        border-radius: 16px;
    }

    .quiz-title {
        font-size: 19px;
    }

    .quiz-question {
        font-size: 15px;
    }

    .quiz-option {
        padding: 12px 16px;
        font-size: 13px;
    }

    .quiz-result-title {
        font-size: 18px;
    }

    .quiz-result-text {
        font-size: 13px;
    }

    .quiz-result-cta {
        padding: 14px 28px;
        font-size: 13px;
        min-height: 50px;
    }

    .quiz-question-area {
        min-height: 180px;
    }

}

@media (max-width: 480px) {
    .quiz-section-wrapper {
        padding: 30px 0 20px;
    }

    .quiz-section-wrapper .container {
        padding: 0 16px;
    }

    .quiz-section-wrapper .quiz-section-title {
        font-size: 19px;
    }

    .quiz-inner {
        padding: 22px 16px 18px;
        border-radius: 14px;
    }

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

    .quiz-subtitle {
        font-size: 12px;
    }

    .quiz-question {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .quiz-option {
        padding: 11px 14px;
        font-size: 12px;
        border-radius: 10px;
    }

    .quiz-result-icon {
        font-size: 32px;
    }

    .quiz-result-title {
        font-size: 16px;
    }

    .quiz-result-text {
        font-size: 12px;
    }

    .quiz-result-cta {
        padding: 13px 24px;
        font-size: 12px;
        min-height: 48px;
        width: auto;
        max-width: 100%;
    }

    .quiz-question-area {
        min-height: 160px;
    }

    .quiz-modal-overlay {
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .quiz-inner {
        padding: 18px 14px 16px;
    }

    .quiz-title {
        font-size: 15px;
    }

    .quiz-question {
        font-size: 13px;
    }

    .quiz-option {
        padding: 10px 12px;
        font-size: 11px;
    }
}

/* Карьерная матрица — зелёная палитра (лайм) */
.quiz-inner[data-quiz-type="career"] {
    border-color: rgba(101, 163, 13, 0.15);
}

.quiz-inner[data-quiz-type="career"]::before {
    background: linear-gradient(90deg, transparent, rgba(132, 204, 22, 0.2), transparent);
}

.quiz-inner[data-quiz-type="career"] .quiz-progress-fill {
    background: linear-gradient(90deg, #65A30D, #84CC16);
}

.quiz-inner[data-quiz-type="career"] .quiz-option {
    border-color: rgba(101, 163, 13, 0.15);
}

.quiz-inner[data-quiz-type="career"] .quiz-option:hover {
    background: rgba(101, 163, 13, 0.12);
    border-color: rgba(132, 204, 22, 0.35);
    box-shadow: 0 4px 12px rgba(101, 163, 13, 0.15);
}

.quiz-inner[data-quiz-type="career"] .quiz-option-selected {
    background: rgba(101, 163, 13, 0.2) !important;
    border-color: rgba(132, 204, 22, 0.5) !important;
}

.quiz-inner[data-quiz-type="career"] .quiz-result-high .quiz-result-title {
    background: none;
    -webkit-text-fill-color: #A3E635;
    color: #A3E635;
}

.quiz-inner[data-quiz-type="career"] .quiz-badge {
    background: rgba(101, 163, 13, 0.1);
    border-color: rgba(132, 204, 22, 0.2);
    color: rgba(163, 230, 53, 0.9);
}

.quiz-modal-content .quiz-inner[data-quiz-type="career"] {
    border-color: rgba(101, 163, 13, 0.2);
}
