:root {
    --exam-blue: #0b5f9e;
    --exam-blue-dark: #063f6f;
    --exam-blue-light: #eaf4fb;
    --exam-navy: #12344d;
    --exam-text: #263746;
    --exam-muted: #657786;
    --exam-border: #d7e1e8;
    --exam-surface: #ffffff;
    --exam-background: #f4f7f9;
    --exam-success: #247447;
    --exam-success-light: #edf8f1;
    --exam-warning: #8a5a00;
    --exam-warning-light: #fff6df;
    --exam-danger: #a12d2d;
    --exam-danger-light: #fff1f1;
    --exam-shadow: 0 12px 32px rgba(18, 52, 77, 0.09);
}

* {
    box-sizing: border-box;
}

html,
body.ast-exam-page {
    min-height: 100%;
}

body.ast-exam-page {
    background: var(--exam-background);
    color: var(--exam-text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
}

.ast-exam-page a {
    color: var(--exam-blue);
}

.ast-exam-page a:hover,
.ast-exam-page a:focus {
    color: var(--exam-blue-dark);
}

.exam-page-shell {
    min-height: 100vh;
}

.exam-page-header {
    background: var(--exam-surface);
    border-bottom: 1px solid var(--exam-border);
}

.exam-page-header__inner {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1060px;
    min-height: 68px;
    padding: 12px 24px;
}

.exam-back-link {
    align-items: center;
    color: var(--exam-blue-dark) !important;
    display: inline-flex;
    font-size: 15px;
    font-weight: 700;
    gap: 8px;
    text-decoration: none !important;
}

.exam-back-link:hover,
.exam-back-link:focus {
    text-decoration: underline !important;
}

.exam-session-note {
    align-items: center;
    color: var(--exam-muted);
    display: flex;
    font-size: 13px;
    gap: 7px;
    text-align: right;
}

.exam-session-note__icon {
    color: var(--exam-success);
}

.exam-main {
    margin: 0 auto;
    max-width: 920px;
    padding: 34px 24px 56px;
}

.exam-print-warning {
    display: none;
}

.exam-noscript-message {
    background: var(--exam-warning-light);
    border-bottom: 1px solid #efd59a;
    color: #654400;
    padding: 12px 24px;
    text-align: center;
}

.exam-alert {
    align-items: flex-start;
    border: 1px solid;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    padding: 15px 17px;
}

.exam-alert--warning {
    background: var(--exam-warning-light);
    border-color: #e7c773;
    color: #684500;
}

.exam-alert__icon {
    align-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 24px;
    font-size: 14px;
    font-weight: 700;
    height: 24px;
    justify-content: center;
}

.exam-course-header {
    align-items: flex-start;
    background: linear-gradient(135deg, var(--exam-blue-dark), var(--exam-blue));
    border-radius: 16px;
    box-shadow: var(--exam-shadow);
    color: #ffffff;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 28px 30px;
    position: relative;
}

.exam-course-header::after {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    content: "";
    height: 190px;
    position: absolute;
    right: -55px;
    top: -80px;
    width: 190px;
}

.exam-course-header__content {
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.exam-course-eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    opacity: 0.86;
    text-transform: uppercase;
}

.exam-course-code {
    font-size: 14px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.exam-course-title {
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.exam-live-badge {
    background: #ffffff;
    border-radius: 999px;
    color: var(--exam-blue-dark);
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
    position: relative;
    z-index: 1;
}

.exam-progress-card {
    background: var(--exam-surface);
    border: 1px solid var(--exam-border);
    border-radius: 14px;
    margin-bottom: 20px;
    padding: 20px 22px;
}

.exam-progress-card__top {
    align-items: flex-end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.exam-progress-label {
    color: var(--exam-muted);
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.exam-progress-value {
    color: var(--exam-navy);
    font-size: 20px;
}

.exam-progress-percentage {
    color: var(--exam-blue-dark);
    font-size: 17px;
    font-weight: 700;
}

.exam-progress-track {
    background: #e6edf2;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.exam-progress-fill {
    background: var(--exam-blue);
    border-radius: inherit;
    height: 100%;
    min-width: 0;
    transition: width 180ms ease;
    width: 0;
}

.exam-progress-help {
    color: var(--exam-muted);
    font-size: 14px;
    margin: 12px 0 0;
}

.exam-question-card {
    background: var(--exam-surface);
    border: 1px solid var(--exam-border);
    border-radius: 16px;
    box-shadow: var(--exam-shadow);
    overflow: hidden;
    position: relative;
}

.exam-question-card.is-submitting::after {
    background: rgba(255, 255, 255, 0.78);
    content: "";
    inset: 0;
    position: absolute;
    z-index: 4;
}

.exam-question-card.is-submitting::before {
    animation: exam-spin 0.7s linear infinite;
    border: 4px solid #d8e6ef;
    border-radius: 50%;
    border-top-color: var(--exam-blue);
    content: "";
    height: 38px;
    left: calc(50% - 19px);
    position: absolute;
    top: calc(50% - 19px);
    width: 38px;
    z-index: 5;
}

@keyframes exam-spin {
    to {
        transform: rotate(360deg);
    }
}

.exam-question-card__header {
    align-items: flex-start;
    background: var(--exam-blue-light);
    border-bottom: 1px solid var(--exam-border);
    display: flex;
    gap: 16px;
    padding: 24px 26px;
}

.exam-question-number {
    align-items: center;
    background: var(--exam-blue);
    border-radius: 10px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 38px;
    font-size: 20px;
    font-weight: 700;
    height: 38px;
    justify-content: center;
}

.exam-question-text {
    color: var(--exam-navy);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.45;
    margin: 2px 0 0;
}

.exam-question-card__body {
    padding: 24px 26px 28px;
}

.exam-answer-instruction {
    color: var(--exam-muted);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.exam-answer-list {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    margin: 0 !important;
    width: 100% !important;
}

.exam-answer-list tbody,
.exam-answer-list tr,
.exam-answer-list td {
    width: 100% !important;
}

.exam-answer-list td {
    padding: 0 !important;
}

.exam-answer-list input[type="radio"] {
    height: 1px;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.exam-answer-list label {
    background: #ffffff;
    border: 2px solid var(--exam-border);
    border-radius: 12px;
    color: var(--exam-text);
    cursor: pointer;
    display: block;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    margin: 0 !important;
    min-height: 58px;
    padding: 15px 18px 15px 54px;
    position: relative;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
    width: 100%;
}

.exam-answer-list label::before {
    background: #ffffff;
    border: 2px solid #9aabb8;
    border-radius: 50%;
    content: "";
    height: 22px;
    left: 17px;
    position: absolute;
    top: 17px;
    width: 22px;
}

.exam-answer-list label::after {
    background: var(--exam-blue);
    border-radius: 50%;
    content: "";
    height: 10px;
    left: 23px;
    opacity: 0;
    position: absolute;
    top: 23px;
    transform: scale(0.6);
    transition: opacity 120ms ease, transform 120ms ease;
    width: 10px;
}

.exam-answer-list label:hover {
    background: #f8fbfd;
    border-color: #8eb8d3;
}

.exam-answer-list input[type="radio"]:focus + label {
    border-color: var(--exam-blue);
    box-shadow: 0 0 0 3px rgba(11, 95, 158, 0.18);
    outline: none;
}

.exam-answer-list input[type="radio"]:checked + label {
    background: var(--exam-blue-light);
    border-color: var(--exam-blue);
    color: var(--exam-blue-dark);
    font-weight: 700;
}

.exam-answer-list input[type="radio"]:checked + label::before {
    border-color: var(--exam-blue);
}

.exam-answer-list input[type="radio"]:checked + label::after {
    opacity: 1;
    transform: scale(1);
}

.exam-answer-status {
    color: var(--exam-blue-dark);
    font-size: 14px;
    font-weight: 700;
    min-height: 22px;
    padding-top: 8px;
}

.exam-noscript-submit {
    margin-top: 18px;
}

.exam-secondary-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.exam-btn,
.ast-exam-page input.exam-btn,
.ast-exam-page a.exam-btn {
    align-items: center;
    border: 2px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;
    justify-content: center;
    line-height: 1.25;
    min-height: 44px;
    padding: 10px 18px;
    text-align: center;
    text-decoration: none !important;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
    width: auto;
}

.exam-btn:hover,
.exam-btn:focus {
    text-decoration: none !important;
    transform: translateY(-1px);
}

.exam-btn:focus {
    box-shadow: 0 0 0 3px rgba(11, 95, 158, 0.2);
    outline: none;
}

.exam-btn--primary,
.ast-exam-page input.exam-btn--primary {
    background: var(--exam-blue);
    border-color: var(--exam-blue);
    color: #ffffff !important;
}

.exam-btn--primary:hover,
.exam-btn--primary:focus,
.ast-exam-page input.exam-btn--primary:hover,
.ast-exam-page input.exam-btn--primary:focus {
    background: var(--exam-blue-dark);
    border-color: var(--exam-blue-dark);
    color: #ffffff !important;
}

.exam-btn--secondary,
.ast-exam-page input.exam-btn--secondary {
    background: #ffffff;
    border-color: #9eb2c0;
    color: var(--exam-blue-dark) !important;
}

.exam-btn--secondary:hover,
.exam-btn--secondary:focus,
.ast-exam-page input.exam-btn--secondary:hover,
.ast-exam-page input.exam-btn--secondary:focus {
    background: #f4f8fa;
    border-color: var(--exam-blue);
}

.exam-btn--warning {
    background: var(--exam-warning-light);
    border-color: #d4a844;
    color: #654400 !important;
}

.exam-btn--warning:hover,
.exam-btn--warning:focus {
    background: #ffeab8;
    color: #533800 !important;
}

.exam-btn--link {
    background: transparent;
    border-color: transparent;
    color: var(--exam-blue) !important;
}

.exam-btn--link:hover,
.exam-btn--link:focus {
    background: var(--exam-blue-light);
}

.exam-result-card {
    background: var(--exam-surface);
    border: 1px solid var(--exam-border);
    border-radius: 16px;
    box-shadow: var(--exam-shadow);
    overflow: hidden;
}

.exam-result-card__header {
    align-items: flex-start;
    background: var(--exam-blue-light);
    border-bottom: 1px solid var(--exam-border);
    display: flex;
    gap: 18px;
    padding: 28px 30px;
}

.exam-result-card.is-passed .exam-result-card__header {
    background: var(--exam-success-light);
}

.exam-result-card.is-failed .exam-result-card__header {
    background: var(--exam-danger-light);
}

.exam-result-icon {
    align-items: center;
    background: var(--exam-blue);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 54px;
    font-size: 27px;
    font-weight: 700;
    height: 54px;
    justify-content: center;
}

.exam-result-card.is-passed .exam-result-icon {
    background: var(--exam-success);
}

.exam-result-card.is-failed .exam-result-icon {
    background: var(--exam-danger);
}

.exam-result-eyebrow {
    color: var(--exam-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.exam-result-title {
    color: var(--exam-navy);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    margin: 3px 0 7px;
}

.exam-result-course {
    color: var(--exam-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 8px;
}

.exam-result-course strong {
    color: var(--exam-text);
}

.exam-score-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 26px 30px 0;
}

.exam-score-item {
    background: #f7f9fb;
    border: 1px solid var(--exam-border);
    border-radius: 11px;
    min-width: 0;
    padding: 14px;
}

.exam-score-item__label {
    color: var(--exam-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.exam-score-item__value {
    color: var(--exam-navy);
    display: block;
    font-size: 23px;
    line-height: 1.2;
}

.exam-score-item__value--date {
    font-size: 16px;
    padding-top: 4px;
}

.exam-result-message {
    background: #f8fbfd;
    border: 1px solid var(--exam-border);
    border-radius: 11px;
    margin: 24px 30px 0;
    padding: 18px;
}

.exam-result-message:empty {
    display: none;
}

.exam-result-message a {
    font-weight: 700;
    text-decoration: underline;
}

.exam-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 24px 30px 30px;
}

.exam-error-card {
    align-items: flex-start;
    background: var(--exam-surface);
    border: 1px solid #e5b4b4;
    border-radius: 16px;
    box-shadow: var(--exam-shadow);
    display: flex;
    gap: 18px;
    padding: 28px;
}

.exam-error-card__icon {
    align-items: center;
    background: var(--exam-danger);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 48px;
    font-size: 24px;
    font-weight: 700;
    height: 48px;
    justify-content: center;
}

.exam-error-card__title {
    color: var(--exam-danger);
    font-size: 24px;
    margin: 0 0 10px;
}

.exam-error-card__message {
    color: var(--exam-text);
    margin-bottom: 20px;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .exam-score-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .exam-page-header__inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        min-height: 0;
        padding: 14px 18px;
    }

    .exam-session-note {
        text-align: left;
    }

    .exam-main {
        padding: 22px 14px 42px;
    }

    .exam-course-header {
        border-radius: 12px;
        padding: 23px 20px;
    }

    .exam-course-title {
        font-size: 24px;
    }

    .exam-live-badge {
        padding: 6px 10px;
    }

    .exam-progress-card {
        padding: 18px;
    }

    .exam-question-card__header,
    .exam-question-card__body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .exam-question-text {
        font-size: 18px;
    }

    .exam-answer-list label {
        font-size: 15px;
        min-height: 56px;
        padding: 14px 14px 14px 50px;
    }

    .exam-result-card__header {
        padding: 22px 20px;
    }

    .exam-result-title {
        font-size: 24px;
    }

    .exam-score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 20px 20px 0;
    }

    .exam-result-message {
        margin: 20px 20px 0;
    }

    .exam-result-actions {
        padding: 20px;
    }

    .exam-result-actions .exam-btn,
    .exam-result-actions input.exam-btn,
    .exam-secondary-actions .exam-btn {
        width: 100%;
    }

    .exam-secondary-actions {
        justify-content: stretch;
    }

    .exam-error-card {
        padding: 22px 20px;
    }
}

@media (max-width: 479px) {
    .exam-course-header {
        display: block;
    }

    .exam-live-badge {
        display: inline-block;
        margin-top: 14px;
    }

    .exam-question-card__header {
        display: block;
    }

    .exam-question-number {
        margin-bottom: 12px;
    }

    .exam-result-card__header {
        display: block;
    }

    .exam-result-icon {
        margin-bottom: 14px;
    }

    .exam-score-grid {
        grid-template-columns: 1fr;
    }

    .exam-error-card {
        display: block;
    }

    .exam-error-card__icon {
        margin-bottom: 14px;
    }
}

@media print {
    body.ast-exam-page {
        background: #ffffff;
    }

    .exam-page-header,
    .exam-main,
    .exam-noscript-message {
        display: none !important;
    }

    .exam-print-warning {
        color: #000000;
        font-size: 18px;
        padding: 30px;
    }
}
