*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.quiz-header {
    padding: 1.125rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.logo {
    text-decoration: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: var(--color-surface);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 100px;
    width: 20%;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Main */
.quiz-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.quiz-content {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
}

/* Question */
.question {
    display: none;
    width: 100%;
}

/* Nav buttons (back + restart) */
.quiz-nav {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back,
.btn-restart {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.15s;
}

.btn-back:hover,
.btn-restart:hover {
    color: var(--color-text);
}

.question.active {
    display: block;
}


.question-number {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.625rem;
}

.question-title {
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.375rem;
}

.question-subtitle {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    margin-bottom: 1.75rem;
}

/* Options */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

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

.options-grid--6 {
    grid-template-columns: 1fr 1fr;
}

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

.option {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    padding: 1.25rem 1rem 1.125rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
    width: 100%;
}

.option:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
}

.option.selected {
    background: var(--color-surface-selected);
    border-color: var(--color-accent);
}

.option-icon {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    display: block;
}

.option-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
}

.option-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.check {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    font-weight: 800;
}

.option.selected .check { display: flex; }

/* Matching screen */
.matching-screen {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.matching-screen.active {
    display: flex;
}

.matching-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.125rem;
}

.matching-title {
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

.matching-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.matching-step {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.matching-step.loading,
.matching-step.done {
    opacity: 1;
}

.step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    transition: background 0.3s, border-color 0.3s;
}

.matching-step.loading .step-icon {
    border-color: var(--color-accent);
    animation: stepPulse 0.7s ease infinite;
}

.matching-step.done .step-icon {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success);
    animation: none;
}

.matching-step.done .step-icon::after {
    content: '✓';
}

.step-text {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    transition: color 0.3s;
}

.matching-step.done .step-text {
    color: var(--color-text);
}

@keyframes stepPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}
