:root {
    --bg: #f4efe6;
    --paper: #fffdf8;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #ded4c3;
    --accent: #cc5a2e;
    --accent-dark: #7f2f1c;
    --success: #2f7d4a;
    --danger: #ab2f2f;
    --shadow: 0 18px 40px rgba(63, 38, 17, 0.12);
    --radius: 24px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(204, 90, 46, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(36, 124, 90, 0.12), transparent 20%),
        linear-gradient(180deg, #f6f0e7 0%, #efe5d7 100%);
}

code {
    background: rgba(31, 41, 55, 0.08);
    padding: 2px 6px;
    border-radius: 8px;
}

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

.hero, .panel, .filters, .notice {
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(122, 96, 69, 0.14);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.hero {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    border-radius: 32px;
    padding: 28px;
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    color: var(--accent-dark);
    font-weight: 700;
}

.hero h1, .panel h2, .notice h2, .notice h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 54px);
    line-height: 1.05;
    /* max-width: 10ch; */
}

.hero__desc {
    max-width: 62ch;
    line-height: 1.7;
    color: var(--muted);
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.hero__stats article, .hero__panel {
    border-radius: 24px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.hero__stats article { padding: 18px; }
.hero__stats strong { display: block; font-size: 28px; color: var(--accent-dark); }
.hero__stats span { color: var(--muted); }
.hero__panel { padding: 22px; }
.hero__panel h2 { margin-bottom: 14px; }
.hero__panel ul { margin: 0 0 18px; padding-left: 18px; line-height: 1.8; }

.filters, .notice, .panel {
    border-radius: var(--radius);
    margin-top: 24px;
}

.filters { padding: 20px; }

.filters__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

.field select, .answer-input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 15px;
}

.field--actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button, .field--actions a, .quiz-card a, .topic-card a, .exam-actions a {
    appearance: none;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button, .quiz-card a, .topic-card a {
    background: linear-gradient(135deg, var(--accent) 0%, #ea7a41 100%);
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(204, 90, 46, 0.22);
    font-weight: 700;
}

.field--actions a, .exam-actions a {
    color: var(--accent-dark);
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(204, 90, 46, 0.12);
    font-weight: 700;
}

button:hover, .field--actions a:hover, .quiz-card a:hover, .topic-card a:hover, .exam-actions a:hover {
    transform: translateY(-1px);
}

.notice { padding: 22px; }
.notice p { margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.notice--warning { border-left: 6px solid #d08d2f; }
.notice--success { border-left: 6px solid var(--success); background: rgba(244, 255, 248, 0.96); }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.panel { padding: 22px; }

.panel__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

.panel__head span, .quiz-card__meta, .topic-card__meta, .empty, .answer-result p, .exam-meta span, .quiz-card__footer span {
    color: var(--muted);
}

.topic-list, .quiz-list, .exam-form { display: grid; gap: 16px; }

.topic-card, .quiz-card, .question-card {
    padding: 18px;
    border-radius: 22px;
    background: var(--paper);
    border: 1px solid var(--line);
}

.topic-card.is-active, .quiz-card.is-active {
    border-color: rgba(204, 90, 46, 0.55);
    box-shadow: inset 0 0 0 1px rgba(204, 90, 46, 0.2);
}

.topic-card h3, .quiz-card h3, .question-card h3 {
    margin: 10px 0 8px;
}

.topic-card p, .quiz-card p { line-height: 1.65; }

.quiz-card__footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.panel--exam { margin-top: 24px; }
.panel__head--exam { align-items: center; }

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

.exam-meta span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.06);
}

.options { display: grid; gap: 10px; margin-top: 14px; }

.option {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
}

.option input { margin-top: 4px; }
.answer-input { margin-top: 14px; }

.answer-result {
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
}

.answer-result.is-correct {
    background: rgba(47, 125, 74, 0.1);
    border: 1px solid rgba(47, 125, 74, 0.2);
}

.answer-result.is-wrong {
    background: rgba(171, 47, 47, 0.08);
    border: 1px solid rgba(171, 47, 47, 0.16);
}

.exam-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .hero, .content-grid, .filters__grid { grid-template-columns: 1fr; }
    .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

    .hero, .panel, .filters, .notice {
        padding: 18px;
        border-radius: 22px;
    }

    .hero__stats { grid-template-columns: 1fr 1fr; }
    .panel__head, .quiz-card__footer, .panel__head--exam {
        flex-direction: column;
        align-items: start;
    }
}


.student-panel {
    margin-top: 24px;
}

.student-card {
    display: grid;
    gap: 18px;
    background: rgba(255, 253, 248, 0.95);
    border: 1px solid rgba(122, 96, 69, 0.14);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 22px;
}

.student-card h2 {
    margin: 0 0 8px;
    font-family: Georgia, "Times New Roman", serif;
}

.student-card p {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
}

.student-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.student-form--inline {
    max-width: 520px;
}

.student-form input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 15px;
}

.notice--info {
    border-left: 6px solid #2d6ea3;
    background: rgba(241, 248, 255, 0.96);
}

.quiz-card__header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(47, 125, 74, 0.12);
    color: var(--success);
    font-weight: 700;
    font-size: 13px;
}

.quiz-card__history {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 980px) {
    .student-form {
        grid-template-columns: 1fr;
    }
}
