
:root {
    --practice-green: #176b4d;
    --practice-green-dark: #104d38;
    --practice-green-light: #e9f4ee;
    --practice-yellow: #f3d66b;
    --practice-ink: #17251e;
    --practice-muted: #68766e;
    --practice-border: #e2e9e4;
    --practice-surface: #ffffff;
    --practice-background: #f5f8f5;
    --practice-danger: #a93232;
    --practice-danger-bg: #fff0ee;
    --practice-radius: 18px;
    --practice-shadow: 0 14px 42px rgba(25, 57, 39, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--practice-background);
    color: var(--practice-ink);
    font-family: "IBM Plex Sans", Arial, sans-serif;
    line-height: 1.6;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.practice-header {
    min-height: 76px;
    padding: 16px max(24px, calc((100% - 1120px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--practice-surface);
    border-bottom: 1px solid var(--practice-border);
}

/* Brand */

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
}

.brand-fallback {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.brand-symbol {
    display: grid;
    flex: 0 0 39px;
    place-items: center;
    width: 39px;
    height: 39px;
    overflow: hidden;
    border-radius: 10px;
}

.brand-symbol img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-name {
    color: var(--practice-ink);
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
}

.brand-name span {
    color: var(--practice-green);
}

.exit-link,
.back-link {
    color: var(--practice-muted);
    font-size: 0.92rem;
    font-weight: 600;
    transition: color 160ms ease;
}

.exit-link:hover,
.back-link:hover {
    color: var(--practice-green);
}

.practice-main {
    width: min(100% - 40px, 820px);
    margin: 0 auto;
    padding: 36px 0 56px;
}

.practice-intro {
    margin-bottom: 25px;
}

.back-link {
    display: inline-block;
    margin-bottom: 27px;
}

.eyebrow {
    margin: 0 0 9px;
    color: var(--practice-green);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.practice-intro h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1.13;
    letter-spacing: -0.055em;
}

.intro-copy {
    margin: 12px 0 0;
    color: var(--practice-muted);
    font-size: 1rem;
}

.progress-card,
.question-card {
    background: var(--practice-surface);
    border: 1px solid var(--practice-border);
    border-radius: var(--practice-radius);
    box-shadow: var(--practice-shadow);
}

.progress-card {
    padding: 21px 24px;
    margin-bottom: 20px;
}

.progress-top,
.progress-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.progress-top {
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-bottom {
    margin-top: 11px;
    color: var(--practice-muted);
    font-size: 0.82rem;
}

.progress-track {
    height: 7px;
    margin-top: 15px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1ed;
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--practice-green);
    transition: width 220ms ease;
}

.question-card {
    padding: clamp(22px, 5vw, 36px);
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    color: var(--practice-muted);
    font-size: 0.83rem;
}

.question-tag {
    padding: 6px 10px;
    border-radius: 7px;
    background: var(--practice-green-light);
    color: var(--practice-green-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
}

.status-message {
    padding: 25px 10px;
    color: var(--practice-muted);
    text-align: center;
}

.status-message.is-error {
    color: var(--practice-danger);
}

.question-text {
    margin: 0 0 25px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.2rem, 3.5vw, 1.55rem);
    line-height: 1.5;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.passage-container {
    margin-bottom: 25px;
    padding: 19px 21px;
    border-left: 3px solid var(--practice-green);
    border-radius: 0 12px 12px 0;
    background: #f5f8f5;
}

.passage-container h2 {
    margin: 0 0 9px;
    font-size: 0.88rem;
}

.passage-container p {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.options-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.options-list {
    display: grid;
    gap: 12px;
}

.answer-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--practice-border);
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.answer-option:hover {
    border-color: #9cbca9;
    background: #fbfdfb;
}

.answer-option:has(input:checked) {
    border-color: var(--practice-green);
    background: var(--practice-green-light);
}

.answer-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.option-letter {
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 1px solid var(--practice-border);
    border-radius: 9px;
    background: #fff;
    color: var(--practice-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.answer-option:has(input:checked) .option-letter {
    border-color: var(--practice-green);
    background: var(--practice-green);
    color: #fff;
}

.option-text {
    padding-top: 3px;
    overflow-wrap: anywhere;
}

.answer-option:has(input:focus-visible) {
    outline: 3px solid rgba(23, 107, 77, 0.25);
    outline-offset: 3px;
}

.answer-option.is-correct {
    border-color: #4d9971;
    background: #edf8f0;
}

.answer-option.is-incorrect {
    border-color: #d88a83;
    background: #fff2f0;
}

.answer-option.is-disabled {
    cursor: default;
}

.answer-option.is-disabled:hover {
    background: inherit;
}

.feedback-panel {
    margin-top: 22px;
    padding: 17px 18px;
    border-radius: 12px;
    background: #f2f6f3;
}

.feedback-panel h3 {
    margin: 0 0 5px;
    font-size: 0.97rem;
}

.feedback-panel p {
    margin: 0;
    color: #4e5e54;
    font-size: 0.92rem;
    white-space: pre-line;
}

.feedback-panel.is-correct {
    background: #edf8f0;
}

.feedback-panel.is-incorrect,
.feedback-panel.is-review {
    background: #fff6e5;
}

.question-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.91rem;
    font-weight: 700;
    text-align: center;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.button:not(:disabled):hover {
    transform: translateY(-1px);
}

.button:focus-visible,
.exit-link:focus-visible,
.back-link:focus-visible,
.brand:focus-visible {
    outline: 3px solid rgba(23, 107, 77, 0.3);
    outline-offset: 3px;
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button-primary {
    background: var(--practice-green);
    color: #fff;
}

.button-primary:not(:disabled):hover {
    background: var(--practice-green-dark);
}

.button-secondary {
    border-color: var(--practice-border);
    background: #fff;
    color: var(--practice-ink);
}

.button-secondary:not(:disabled):hover {
    border-color: #a6c0ae;
    background: #f7faf7;
}

.load-more-area {
    padding-top: 24px;
    text-align: center;
}

.load-more-area p {
    margin: 0 0 15px;
    color: var(--practice-muted);
}

.error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 20px;
}

.practice-note {
    margin: 20px 4px 0;
    color: var(--practice-muted);
    font-size: 0.83rem;
    line-height: 1.7;
}

.practice-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 24px;
    border-top: 1px solid var(--practice-border);
    color: var(--practice-muted);
    font-size: 0.85rem;
}

.practice-footer p {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 560px) {
    .practice-header {
        min-height: 67px;
        padding: 13px 18px;
    }

    .brand-fallback {
        gap: 8px;
    }
    
    .brand-symbol {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }
    
    .brand-name {
        font-size: 0.92rem;
    }

    .exit-link {
        font-size: 0.82rem;
    }

    .practice-main {
        width: min(100% - 28px, 820px);
        padding-top: 25px;
    }

    .back-link {
        margin-bottom: 22px;
    }

    .progress-card {
        padding: 18px;
    }

    .question-card {
        padding: 22px 17px;
    }

    .answer-option {
        gap: 10px;
        padding: 13px;
    }

    .question-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .question-actions .button {
        width: 100%;
        padding: 11px 10px;
    }

    #checkButton,
    #nextButton {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    #previousButton {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}



/* Selected answer */
.answer-option.is-selected {
    background: #eaf8ef;
    border: 1.5px solid #16a34a;
    color: #166534;
}

.answer-option.is-selected .option-letter {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

/* Keep the selected state visible on hover */
.answer-option.is-selected:hover {
    background: #eaf8ef;
    border-color: #16a34a;
}

/* End practice button */
#endPracticeButton,
#endPracticeTopButton {
    cursor: pointer;
}

#endPracticeTopButton {
    border: 1px solid #dce5df;
    background: #ffffff;
    color: #34443a;
    padding: 10px 18px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
}

#endPracticeTopButton:hover {
    background: #f0f5f1;
}

#endPracticeTopButton:disabled,
#endPracticeButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#loadMoreArea .question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}





/* =========================================
   PRACTICE SETUP
========================================= */

.practice-setup {
    padding: clamp(23px, 5vw, 34px);
    margin-bottom: 22px;
    background: var(--practice-surface);
    border: 1px solid var(--practice-border);
    border-radius: var(--practice-radius);
    box-shadow: var(--practice-shadow);
}

.setup-heading {
    margin-bottom: 27px;
}

.setup-step {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--practice-green);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.setup-heading h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.45rem, 4vw, 1.9rem);
    letter-spacing: -0.04em;
}

.setup-heading p {
    max-width: 510px;
    margin: 9px 0 0;
    color: var(--practice-muted);
    font-size: 0.94rem;
}

.setup-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.setup-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.setup-field label {
    color: var(--practice-ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.setup-field select {
    width: 100%;
    min-height: 49px;
    padding: 0 14px;
    border: 1px solid var(--practice-border);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--practice-ink);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.setup-field select:focus {
    border-color: var(--practice-green);
    box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.12);
}

.setup-field small {
    color: var(--practice-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.start-practice-button {
    width: 100%;
    min-height: 51px;
    margin-top: 27px;
}

.setup-status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 9px;
    background: var(--practice-danger-bg);
    color: var(--practice-danger);
    font-size: 0.88rem;
}

@media (max-width: 560px) {
    .practice-setup {
        padding: 22px 17px;
    }

    .setup-fields {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .start-practice-button {
        margin-top: 22px;
    }
}
