/**
 * Quiz ile lat mentalnie — structural layout + animations.
 * Follows quiz-jaki-zawod base.css pattern with mental-age-specific additions.
 */

/* ── Wrapper ── */

.quiz-wrap {
    max-width: 640px;
    margin: 0 auto;
}

/* ── Phase visibility ── */

.quiz-intro,
.quiz-progress,
.quiz-questions,
.quiz-loading,
.quiz-result {
    display: none;
}

.quiz-wrap[data-phase="intro"] .quiz-intro {
    display: block;
}

.quiz-wrap[data-phase="questions"] .quiz-progress,
.quiz-wrap[data-phase="questions"] .quiz-questions {
    display: block;
}

.quiz-wrap[data-phase="loading"] .quiz-loading {
    display: flex;
}

.quiz-wrap[data-phase="result"] .quiz-result--active {
    display: block;
}

/* ── Intro ── */

.quiz-intro {
    text-align: center;
    padding: 2rem 1rem;
}

.quiz-intro-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary, #6b6b6b);
    margin: 0 0 1.5rem;
}

.quiz-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-pill, 999px);
    background: var(--primary-color, #2563eb);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-start-btn:hover {
    transform: translateY(-2px);
}

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

.quiz-intro-meta {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #9ca3af);
}

/* ── Progress ── */

.quiz-progress {
    margin-bottom: 1.5rem;
}

.quiz-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--quiz-track-bg, rgba(0, 0, 0, 0.08));
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--primary-color, #2563eb);
    transition: width 0.4s ease;
}

.quiz-progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #6b6b6b);
    font-variant-numeric: tabular-nums;
}

/* ── Questions ── */

.quiz-question {
    display: none;
}

.quiz-question--active {
    display: block;
    animation: quiz-slide-in 0.35s ease forwards;
}

@keyframes quiz-slide-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.quiz-question-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--heading-color, #1a1a1a);
    margin: 0 0 1.25rem;
    line-height: 1.4;
}

/* ── Answer buttons ── */

.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.quiz-answer {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--quiz-answer-border, rgba(0, 0, 0, 0.12));
    border-radius: var(--radius-md, 12px);
    background: var(--quiz-answer-bg, #fff);
    color: var(--text-color, #2d2d2d);
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.quiz-answer:hover {
    border-color: var(--primary-color, #2563eb);
    transform: translateY(-1px);
}

.quiz-answer--selected {
    background: var(--primary-color, #2563eb);
    color: #fff;
    border-color: var(--primary-color, #2563eb);
    transform: scale(0.98);
}

.quiz-answer:disabled {
    cursor: default;
    opacity: 0.6;
}

/* ── Loading ── */

.quiz-loading {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.quiz-loading-dots {
    display: inline-flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.quiz-loading-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    animation: quiz-dot-bounce 1.4s infinite ease-in-out both;
}

.quiz-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.quiz-loading-dot:nth-child(2) { animation-delay: -0.16s; }
.quiz-loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes quiz-dot-bounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.quiz-loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary, #6b6b6b);
    margin: 0;
}

/* ── Result card ── */

.quiz-result {
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg, 16px);
    background: var(--quiz-result-bg, #f8fafc);
    border: 1px solid var(--quiz-result-border, rgba(0, 0, 0, 0.08));
}

/* ── Result header — BIG AGE NUMBER ── */

.quiz-result-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.quiz-result-age {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--primary-color, #2563eb);
    margin-bottom: 0.15rem;
}

.quiz-result-age-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary, #6b6b6b);
    margin-bottom: 0.5rem;
}

.quiz-result-label {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color, #1a1a1a);
    margin: 0;
}

/* ── Result description ── */

.quiz-result-description {
    margin-bottom: 1.5rem;
}

.quiz-result-description p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color, #2d2d2d);
    margin: 0 0 0.75rem;
}

.quiz-result-description p:last-child {
    margin-bottom: 0;
}

/* ── Result sections ── */

.quiz-result-section {
    margin-bottom: 1.25rem;
}

.quiz-result-section h4,
.quiz-result-superpower h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #6b6b6b);
    margin: 0 0 0.5rem;
}

/* ── Traits pills ── */

.quiz-result-traits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quiz-result-traits li {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill, 999px);
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color, #2563eb);
}

/* ── Superpower ── */

.quiz-result-superpower {
    margin-bottom: 1.25rem;
}

.quiz-result-superpower p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.5;
    color: var(--heading-color, #1a1a1a);
}

/* ── Social proof ── */

.quiz-result-social {
    text-align: center;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: var(--radius-md, 12px);
    background: var(--quiz-social-bg, rgba(37, 99, 235, 0.06));
}

.quiz-result-social p {
    margin: 0;
    font-size: 1rem;
    color: var(--quiz-social-color, #1e40af);
}

.quiz-result-social strong {
    font-size: 1.5rem;
    font-weight: 800;
}

/* ── Disclaimer ── */

.quiz-disclaimer {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary, #9ca3af);
    font-style: italic;
    text-align: center;
    margin: 0 0 1.25rem;
}

/* ── Retry button ── */

.quiz-retry-btn {
    display: block;
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border: 2px solid var(--primary-color, #2563eb);
    border-radius: var(--radius-pill, 999px);
    background: transparent;
    color: var(--primary-color, #2563eb);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.quiz-retry-btn:hover {
    background: var(--primary-color, #2563eb);
    color: #fff;
}

/* ── Responsive ── */

@media (min-width: 640px) {
    .quiz-wrap {
        padding: 0 1rem;
    }

    .quiz-question-text {
        font-size: 1.35rem;
    }

    .quiz-result {
        padding: 2.5rem 2rem;
    }

    .quiz-result-age {
        font-size: 6rem;
    }
}
