* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f2f4f2;
    color: #293731;
}

.topbar {
    min-height: 90px;
    padding: 18px 6%;
    background: #ffffff;
    border-bottom: 1px solid #d5dfda;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    color: #27483d;
    font-size: 25px;
}

.topbar p {
    margin: 5px 0 0;
    color: #74817b;
}

.container {
    width: min(1180px, 92%);
    margin: 35px auto;
}

.card {
    background: #ffffff;
    border: 1px solid #dae2de;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(34, 55, 46, 0.08);
}

.start-screen {
    padding: 50px;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 8px 15px;
    background: #dcebe4;
    color: #2c5a49;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.start-screen h2,
.result-screen h2 {
    margin: 20px 0 10px;
    color: #25463a;
}

.intro {
    max-width: 720px;
    margin: 0 auto 35px;
    color: #66756e;
    line-height: 1.7;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.info-card {
    padding: 25px;
    background: #f6f9f7;
    border: 1px solid #d9e3de;
    border-radius: 13px;
}

.info-card h3 {
    margin-top: 0;
    color: #466357;
}

.info-card strong {
    display: block;
    color: #29473c;
    font-size: 21px;
}

.info-card p {
    color: #79857f;
}

.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;
    color: #ffffff;
    background: #3d6857;
    font-weight: bold;
}

.primary-btn:hover {
    background: #2d5144;
}

.secondary-btn {
    padding: 12px 25px;
    border: 1px solid #bac8c2;
    border-radius: 9px;
    color: #3b574c;
    background: white;
    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: #78857f;
    font-size: 10px;
}

.timer strong {
    color: #294c40;
    font-size: 24px;
}

.module-bar {
    margin-bottom: 18px;
    padding: 17px 23px;
    background: white;
    border: 1px solid #d8e1dd;
    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: #75837d;
    font-size: 12px;
    font-weight: bold;
}

.difficulty {
    padding: 8px 15px;
    background: #e3ede8;
    color: #375e4f;
    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 #dae3de;
    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;
    color: #4b5e56;
    background: white;
    border: 1px solid #c8d3ce;
    border-radius: 6px;
}

.nav-btn.answered {
    background: #d8e9e0;
    border-color: #9dc3b1;
}

.nav-btn.current {
    color: #ffffff;
    background: #3d6857;
    border-color: #3d6857;
}

.question-card {
    min-height: 580px;
    padding: 35px;
}

.question-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#questionNumber {
    color: #6f7f78;
}

.skill-badge {
    padding: 6px 11px;
    background: #edf2ef;
    color: #586f65;
    border-radius: 6px;
    font-size: 12px;
}

.passage {
    margin: 25px 0;
    padding: 23px;
    background: #f6f9f7;
    border-left: 4px solid #688d7e;
    border-radius: 0 10px 10px 0;
    color: #35463e;
    line-height: 1.8;
}

#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: #303f38;
    border: 1px solid #c7d2cd;
    border-radius: 9px;
    line-height: 1.5;
}

.answer-btn:hover {
    background: #f3f7f5;
    border-color: #738f84;
}

.answer-btn.selected {
    background: #dcebe4;
    border: 2px solid #416d5c;
}

.answer-letter {
    width: 30px;
    height: 30px;
    margin-right: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf2ef;
    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 #d5e7de;
    border-radius: 50%;
    color: #2f5949;
    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: #f5f8f6;
    border-radius: 10px;
}

.results-grid span,
.results-grid strong {
    display: block;
}

.results-grid span {
    margin-bottom: 8px;
    color: #718078;
}

.results-grid strong {
    color: #304a40;
    font-size: 21px;
}

.result-buttons {
    margin-top: 25px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.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 #dae3de;
    border-radius: 12px;
}

.review-card.correct {
    border-left: 5px solid #4c9c69;
}

.review-card.incorrect {
    border-left: 5px solid #c45b5b;
}

.review-card p {
    line-height: 1.65;
}

.correct-text {
    color: #2f7046;
}

.wrong-text {
    color: #a34242;
}

footer {
    padding: 35px;
    color: #87928d;
    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;
    }
}