
* {
    box-sizing: border-box;
}

:root {
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --red: #9f2d24;
    --red-dark: #7f211b;
    --background: #f3f5f7;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
    background: #202a35;
    color: white;
    padding: 16px 22px;
}

.nav {
    max-width: 1100px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.brand {
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.15rem;
}

.navlinks {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.navlinks a {
    color: #e2e8f0;
    text-decoration: none;
}

.navlinks a:hover {
    text-decoration: underline;
}

main {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 18px;
}

.hero {
    background: linear-gradient(135deg, #fff, #f8e9e6);
    border: 1px solid #ead6d2;
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 22px;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-top: 0;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

h2 {
    font-size: 1.4rem;
}

p {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

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

.card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 4px 16px #0f172a08;
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 650;
    margin: 12px 0 6px;
}

input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: white;
    font: inherit;
    color: inherit;
}

select[multiple] {
    min-height: 130px;
}

textarea {
    min-height: 85px;
    resize: vertical;
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 9px;
    padding: 11px 17px;
    background: var(--red);
    color: white;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    background: var(--red-dark);
}

.btn.secondary {
    background: #334155;
}

.btn.danger {
    background: #991b1b;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.notice {
    padding: 12px 15px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    margin: 14px 0;
}

.notice.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.pill {
    display: inline-block;
    background: #f1f5f9;
    color: #334155;
    border-radius: 99px;
    padding: 3px 10px;
    font-size: .82rem;
    font-weight: 700;
}

.question {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin: 8px 0;
    background: white;
    font-weight: 400;
    cursor: pointer;
}

.option input {
    width: auto;
    margin-top: 5px;
}

.option:has(input:checked) {
    border-color: var(--red);
    background: #fff8f6;
}

.score {
    font-size: 2.5rem;
    font-weight: 850;
    color: var(--red);
}

.correct, .wrong {
    padding: 12px 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.correct {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
}

.wrong {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
}

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

th, td {
    text-align: left;
    padding: 11px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: #f8fafc;
}

.tablewrap {
    overflow-x: auto;
}

.inline {
    display: inline;
}

footer {
    text-align: center;
    color: var(--muted);
    padding: 30px 15px;
}

@media (max-width: 600px) {
    header {
        padding: 14px;
    }

    .nav {
        align-items: flex-start;
    }

    .navlinks {
        gap: 10px;
    }

    main {
        margin: 20px auto;
    }

    .hero, .card {
        padding: 18px;
    }

    th, td {
        padding: 8px;
    }
}
