:root {
    --bg: #0c0b10;
    --surface: #17131d;
    --surface-2: #211a29;
    --gold: #d9b66f;
    --gold-soft: #f4dfaa;
    --ink: #f7f2e8;
    --muted: #b8a994;
    --line: rgba(244, 223, 170, 0.18);
    --danger: #ff8f8f;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(217, 182, 111, 0.16), transparent 34rem),
        linear-gradient(135deg, #0c0b10 0%, #17131d 48%, #10151b 100%);
}

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

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.topbar,
.hero,
.exam-header,
.records-head,
.result-layout {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
}

.topbar {
    padding: 14px 0 34px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #111;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    box-shadow: 0 16px 32px rgba(217, 182, 111, 0.18);
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand small,
.muted {
    color: var(--muted);
}

.nav a {
    color: var(--gold-soft);
}

.messages {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.message {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.message.error {
    color: var(--danger);
    border-color: rgba(255, 143, 143, 0.35);
}

.hero {
    min-height: 390px;
    padding: 56px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, rgba(217, 182, 111, 0.18), rgba(49, 57, 66, 0.28));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-copy {
    max-width: 720px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: clamp(42px, 8vw, 92px);
    line-height: 0.95;
}

h2 {
    margin-bottom: 8px;
    font-size: 30px;
}

h3 {
    margin-bottom: 12px;
    font-size: 24px;
}

.lead,
.exam-header p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero-panel,
.exam-stats,
.identity-row,
.question-card,
.characteristic,
.answer-review,
.records-table-wrap,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(23, 19, 29, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-panel {
    min-width: 220px;
    padding: 28px;
}

.hero-panel strong {
    display: block;
    margin: 8px 0;
    color: var(--gold-soft);
    font-size: 64px;
}

.panel-label,
.test-chip {
    display: inline-block;
    color: var(--gold-soft);
    font-size: 13px;
}

.section-head,
.records-head {
    margin: 44px 0 20px;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.test-card {
    display: grid;
    gap: 24px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    box-shadow: var(--shadow);
}

.test-card p,
.review-item span,
.records-table td {
    color: var(--muted);
}

.card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card-meta span {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--gold-soft);
}

.actions,
.submit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.button.primary {
    color: #111;
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    border-color: transparent;
}

.button.ghost {
    color: var(--gold-soft);
    background: rgba(255, 255, 255, 0.05);
}

.exam-header,
.records-head {
    align-items: flex-start;
}

.exam-header {
    margin: 28px 0;
}

.exam-header > div {
    max-width: 760px;
}

.exam-stats {
    display: grid;
    min-width: 230px;
    padding: 22px;
}

.exam-stats span {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.exam-stats span:last-child {
    border-bottom: 0;
}

.identity-row {
    display: grid;
    gap: 10px;
    padding: 22px;
}

.time-panel,
.result-meta {
    display: grid;
    gap: 8px;
    margin: 18px 0 22px;
    padding: 18px 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.time-panel span,
.result-meta span {
    color: var(--muted);
    font-size: 13px;
}

.time-panel strong,
.result-meta strong {
    color: var(--gold-soft);
}

label {
    font-weight: 800;
}

input[type="text"] {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

input[type="text"]:focus {
    border-color: rgba(244, 223, 170, 0.7);
}

.progress-wrap {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 22px 0;
}

.progress-line {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-line span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), var(--gold-soft));
    transition: width 180ms ease;
}

.question-list {
    display: grid;
    gap: 18px;
}

.question-card {
    margin: 0;
    padding: 24px;
}

.question-card legend {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 0 0 18px;
    font-size: 20px;
    font-weight: 900;
}

.question-card legend span {
    color: var(--gold);
}

.options {
    display: grid;
    gap: 10px;
}

.option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.option:has(input:checked) {
    color: var(--ink);
    border-color: rgba(244, 223, 170, 0.7);
    background: rgba(217, 182, 111, 0.12);
}

.option input {
    margin-top: 3px;
    accent-color: var(--gold);
}

.submit-row {
    justify-content: flex-end;
    margin-top: 24px;
}

.result-layout {
    align-items: flex-start;
    margin-top: 32px;
}

.result-main {
    flex: 1;
    min-width: 0;
}

.score-ring {
    display: grid;
    width: min(310px, 100%);
    aspect-ratio: 1;
    place-items: center;
    margin: 28px 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 58%, transparent 59%),
        conic-gradient(var(--gold) calc(var(--score) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.score-ring strong {
    align-self: end;
    font-size: 54px;
}

.score-ring span {
    align-self: start;
    color: var(--muted);
}

.result-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 760px;
}

.result-meta div {
    display: grid;
    gap: 6px;
}

.characteristic {
    max-width: 760px;
    padding: 26px;
}

.characteristic p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.answer-review {
    width: min(430px, 100%);
    padding: 24px;
}

.review-item {
    display: grid;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.review-item:last-child {
    border-bottom: 0;
}

.review-item em {
    color: var(--danger);
    font-style: normal;
}

.review-item.is-wrong {
    border-left: 3px solid var(--danger);
    padding-left: 12px;
}

.table-link {
    color: var(--gold-soft);
    font-weight: 800;
}

.records-table-wrap {
    overflow-x: auto;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th,
.records-table td {
    padding: 18px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.records-table th {
    color: var(--gold-soft);
    font-size: 13px;
    text-transform: uppercase;
}

.empty-state {
    padding: 28px;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 16px;
    }

    .topbar,
    .hero,
    .exam-header,
    .records-head,
    .result-layout {
        align-items: stretch;
        flex-direction: column;
    }

    .hero {
        min-height: auto;
        padding: 30px 20px;
    }

    h1 {
        font-size: 46px;
    }

    .submit-row {
        justify-content: stretch;
    }

    .button {
        width: 100%;
    }

    .result-meta {
        grid-template-columns: 1fr;
    }
}
