* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f1f4f2;
    color: #293630;
}

.topbar {
    min-height: 90px;
    padding: 18px 6%;
    background: #ffffff;
    border-bottom: 1px solid #d4deda;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    color: #24483b;
    font-size: 25px;
}

.topbar p {
    margin: 5px 0 0;
    color: #718078;
}

.container {
    width: min(1180px, 92%);
    margin: 35px auto;
}

.card {
    background: #ffffff;
    border: 1px solid #d8e2dd;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(30, 54, 44, 0.08);
}

.start-screen {
    padding: 50px;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 8px 15px;
    background: #d8e9e0;
    color: #285b47;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.start-screen h2,
.result-screen h2 {
    margin: 20px 0 10px;
    color: #234538;
}

.intro {
    max-width: 720px;
    margin: 0 auto 35px;
    color: #65746c;
    line-height: 1.7;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.info-card {
    padding: 25px;
    background: #f5f8f6;
    border: 1px solid #d7e2dc;
    border-radius: 13px;
}

.info-card h3 {
    margin-top: 0;
    color: #456257;
}

.info-card strong {
    display: block;
    color: #27463a;
    font-size: 21px;
}

.info-card p {
    color: #77847d;
}

.instructions {
    max-width: 750px;
    margin: 30px auto;
    padding: 22px 30px;
    text-align: left;
    background: #f7faf8;
    border-radius: 12px;
}

.instructions li {
    margin: 9px 0;
    line-height: 1.5;
}

button {
    font: inherit;
    cursor: pointer;
}

.primary-btn {
    padding: 13px 26px;
    border: none;
    border-radius: 9px;
    background: #386653;
    color: #ffffff;
    font-weight: bold;
}

.primary-btn:hover {
    background: #294f40;
}

.secondary-btn {
    padding: 12px 25px;
    border: 1px solid #b9c7c1;
    border-radius: 9px;
    background: white;
    color: #39574b;
    font-weight: bold;
}

.secondary-btn:hover {
    background: #f0f5f2;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.timer {
    padding: 8px 15px;
    border: 1px solid #d7e0dc;
    border-radius: 10px;
    text-align: right;
}

.timer span {
    display: block;
    color: #74837c;
    font-size: 10px;
}

.timer strong {
    color: #274a3e;
    font-size: 24px;
}

.module-bar {
    margin-bottom: 18px;
    padding: 17px 23px;
    background: #ffffff;
    border: 1px solid #d7e1dc;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-bar span,
.module-bar strong {
    display: block;
}

#moduleLabel {
    margin-bottom: 4px;
    color: #73817a;
    font-size: 12px;
    font-weight: bold;
}

.difficulty {
    padding: 8px 15px;
    background: #dfebe5;
    color: #315c4b;
    border-radius: 20px;
    font-weight: bold;
}

.test-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.navigator {
    height: fit-content;
    padding: 20px;
    background: white;
    border: 1px solid #d8e2dd;
    border-radius: 14px;
}

.navigator h3 {
    margin-top: 0;
}

.question-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.nav-btn {
    width: 31px;
    height: 31px;
    padding: 0;
    background: white;
    color: #4a5c54;
    border: 1px solid #c6d2cc;
    border-radius: 6px;
}

.nav-btn.answered {
    background: #d6e8df;
    border-color: #9ac1ae;
}

.nav-btn.current {
    background: #386653;
    color: white;
    border-color: #386653;
}

.question-card {
    min-height: 590px;
    padding: 35px;
}

.question-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#questionNumber {
    color: #6d7d75;
}

.skill-badge {
    padding: 6px 11px;
    background: #ebf1ee;
    color: #566d63;
    border-radius: 6px;
    font-size: 12px;
}

.passage {
    margin: 25px 0;
    padding: 23px;
    background: #f5f8f6;
    border-left: 4px solid #608777;
    border-radius: 0 10px 10px 0;
    color: #34453d;
    line-height: 1.82;
}

#questionText {
    margin: 24px 0 20px;
    font-size: 19px;
    line-height: 1.55;
}

.answers {
    display: grid;
    gap: 11px;
}

.answer-btn {
    width: 100%;
    padding: 15px 18px;
    text-align: left;
    background: white;
    color: #2f3e37;
    border: 1px solid #c5d1cb;
    border-radius: 9px;
    line-height: 1.5;
}

.answer-btn:hover {
    background: #f2f7f4;
    border-color: #6d8b7f;
}

.answer-btn.selected {
    background: #d9e9e1;
    border: 2px solid #396955;
}

.answer-letter {
    width: 30px;
    height: 30px;
    margin-right: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ebf1ee;
    border-radius: 50%;
    font-weight: bold;
}

.navigation {
    margin-top: 35px;
    display: flex;
    justify-content: space-between;
}

.result-screen {
    max-width: 760px;
    margin: auto;
    padding: 50px;
    text-align: center;
}

.score-circle {
    width: 135px;
    height: 135px;
    margin: 30px auto;
    border: 9px solid #d2e6dc;
    border-radius: 50%;
    color: #2c5847;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-circle.large {
    width: 165px;
    height: 165px;
}

.score-circle strong {
    font-size: 27px;
}

.results-grid {
    margin: 30px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.results-grid div {
    padding: 20px;
    background: #f4f8f6;
    border-radius: 10px;
}

.results-grid span,
.results-grid strong {
    display: block;
}

.results-grid span {
    margin-bottom: 8px;
    color: #708078;
}

.results-grid strong {
    color: #2e493e;
    font-size: 21px;
}

.result-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.review-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-card {
    margin-bottom: 16px;
    padding: 25px;
    background: white;
    border: 1px solid #d8e2dd;
    border-radius: 12px;
}

.review-card.correct {
    border-left: 5px solid #499967;
}

.review-card.incorrect {
    border-left: 5px solid #c25858;
}

.review-card p {
    line-height: 1.65;
}

.correct-text {
    color: #2d7045;
}

.wrong-text {
    color: #a13f3f;
}

footer {
    padding: 35px;
    color: #85918b;
    text-align: center;
    font-size: 13px;
}

.hidden {
    display: none !important;
}

@media (max-width: 800px) {

    .test-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .test-layout {
        grid-template-columns: 1fr;
    }

    .navigator {
        order: 2;
    }

    .question-nav {
        grid-template-columns: repeat(9, 1fr);
    }

    .start-screen,
    .question-card,
    .result-screen {
        padding: 25px;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}