/*
 * Full-length practice exams (Series 7 and Series 63).
 * Generated by scripts/build-practice-exam.js into pages/<course>/<course>-full-practice-exam.html.
 * Tokens only: every color comes from assets/css/main.css, so night mode follows.
 */

.exam-header {
    background: var(--fh-surface-inverse);
    color: var(--fh-on-inverse);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* The chapter stylesheet colors every h2 on a chapter page; the id outranks it on the dark panels. */
#main-content .exam-header h2,
#main-content .exam-results h2 {
    color: var(--fh-on-inverse);
    margin-bottom: 1rem;
}

.exam-header p {
    color: var(--fh-on-inverse);
}

.exam-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.exam-stat {
    text-align: center;
}

.exam-stat__number {
    font-family: var(--fh-font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fh-on-inverse);
}

.exam-stat__label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.exam-intro {
    border-left: 4px solid var(--fh-accent);
    background: var(--fh-tint);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
}

.exam-intro p {
    margin: 0 0 0.5rem 0;
}

.exam-intro p:last-child {
    margin-bottom: 0;
}

.exam-fine-print {
    color: var(--fh-ink-2);
    font-size: 0.9rem;
}

/* Jump list to each section */
.exam-jump {
    margin: 0 0 2rem 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exam-jump a {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--fh-gray-300);
    border-radius: 999px;
    color: var(--fh-ink);
    text-decoration: none;
    font-size: 0.9rem;
}

.exam-jump a:hover {
    border-color: var(--fh-accent);
    background: var(--fh-tint);
}

.exam-jump a:focus-visible {
    outline: 3px solid var(--fh-accent-text);
    outline-offset: 2px;
}

.exam-jump__count {
    font-family: var(--fh-font-mono);
    color: var(--fh-ink-2);
    margin-left: 0.35rem;
}

.exam-section {
    margin: 0;
}

.section-header {
    background: var(--fh-gray-100);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 2.5rem 0 1rem 0;
    scroll-margin-top: 5rem;
}

.section-header h3 {
    color: var(--fh-ink);
    margin: 0;
    font-size: 1.1rem;
}

.section-header p {
    margin: 0.25rem 0 0 0;
    color: var(--fh-ink-2);
    font-size: 0.875rem;
}

.question-card {
    background: var(--fh-white);
    border: 1px solid var(--fh-gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

fieldset.question-card {
    min-width: 0;
}

fieldset.question-card legend {
    padding: 0;
    width: 100%;
    float: left;
    margin-bottom: 1rem;
}

fieldset.question-card legend + * {
    clear: both;
}

.question-number {
    font-family: var(--fh-font-mono);
    font-size: 0.875rem;
    color: var(--fh-accent-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.question-topic {
    font-size: 0.75rem;
    color: var(--fh-gray-500);
    margin-bottom: 0.75rem;
}

.question-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.question-item {
    display: block;
    margin: 0.35rem 0 0 1rem;
    line-height: 1.5;
}

.question-text + .question-item {
    margin-top: 0.75rem;
}

.question-item:last-child {
    margin-bottom: 0.5rem;
}

.answer-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.answer-options li {
    padding: 0;
    position: relative;
    margin-bottom: 0.5rem;
    border: 1px solid var(--fh-gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.answer-options li:hover {
    border-color: var(--fh-accent);
    background: var(--fh-tint);
}

.answer-options input[type='radio'] {
    position: absolute;
    left: 1rem;
    top: 1rem;
    margin: 0;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--fh-accent);
}

.answer-options label {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem 0.75rem 3rem;
    cursor: pointer;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.answer-options li:has(input:checked) {
    border-color: var(--fh-accent);
    background: var(--fh-tint);
}

.answer-options li:has(input:focus-visible) {
    outline: 3px solid var(--fh-accent-text);
    outline-offset: 2px;
}

.exam-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin: 2rem 0;
}

.exam-actions .fh-btn:focus-visible,
.exam-actions button:focus-visible {
    outline: 3px solid var(--fh-accent-text);
    outline-offset: 2px;
}

.exam-status {
    color: var(--fh-ink-2);
    margin: 0;
}

.exam-progress {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0 0 1.5rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--fh-white);
    border: 1px solid var(--fh-gray-200);
    border-radius: 6px;
    color: var(--fh-ink-2);
    font-size: 0.9rem;
}

.exam-results {
    background: var(--fh-surface-inverse);
    color: var(--fh-on-inverse);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.exam-results:focus {
    outline: 3px solid var(--fh-accent);
    outline-offset: 3px;
}

.exam-results h2,
.exam-results h3,
.exam-results p,
.exam-results td,
.exam-results th,
.exam-results caption,
.exam-results a {
    color: var(--fh-on-inverse);
}

.exam-results a {
    text-decoration: underline;
}

.exam-results__score {
    font-family: var(--fh-font-mono);
    font-size: 2.25rem;
    font-weight: 600;
    margin: 0.25rem 0;
}

.exam-results__table-wrap {
    overflow-x: auto;
}

.exam-results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.exam-results caption {
    text-align: left;
    font-weight: 600;
    padding-bottom: 0.5rem;
}

.exam-results th,
.exam-results td {
    text-align: left;
    padding: 0.5rem 0.5rem 0.5rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--fh-on-inverse) 25%, transparent);
    font-size: 0.95rem;
}

.exam-results td.num,
.exam-results th.num {
    text-align: right;
    font-family: var(--fh-font-mono);
    white-space: nowrap;
}

.exam-results button {
    margin-top: 1.5rem;
}

.q-feedback {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--fh-gray-300);
    background: var(--fh-gray-100);
}

.q-feedback p {
    margin: 0 0 0.5rem 0;
}

.q-feedback p:last-child {
    margin-bottom: 0;
}

.q-feedback__verdict {
    font-weight: 700;
}

.question-card.is-correct {
    border-color: var(--fh-status-positive);
}

.question-card.is-correct .q-feedback__verdict {
    color: var(--fh-status-positive);
}

.question-card.is-wrong {
    border-color: var(--fh-status-negative);
}

.question-card.is-wrong .q-feedback__verdict {
    color: var(--fh-status-negative);
}

.answer-options li.is-key {
    border-color: var(--fh-status-positive);
    background: var(--fh-status-positive-bg);
}

.answer-options li.is-picked-wrong {
    border-color: var(--fh-status-negative);
    background: var(--fh-status-negative-bg);
}

.answer-options li.is-key label::after {
    content: ' (correct answer)';
    font-weight: 700;
}

.answer-options li.is-picked-wrong label::after {
    content: ' (your answer)';
    font-weight: 700;
}

@media (max-width: 480px) {
    .exam-header,
    .exam-results {
        padding: 1.25rem;
    }

    .question-card {
        padding: 1rem;
    }
}

@media print {
    .header,
    .footer {
        display: none;
    }

    .question-card {
        break-inside: avoid;
    }
}

@media (prefers-reduced-motion: reduce) {
    .answer-options li {
        transition: none;
    }
}
