* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}
.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}
.site-header {
    background: #0f172a;
    color: #fff;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 16px;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
}
.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.nav a {
    color: #dbeafe;
    text-decoration: none;
}
.page { padding: 28px 0 40px; }
.hero {
    margin-bottom: 24px;
}
.hero h1, .card h1 { margin-top: 0; }
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 24px;
    margin-bottom: 20px;
}
.narrow-card { max-width: 640px; margin-inline: auto; }
.form-card { max-width: 820px; }
.quiz-shell { max-width: 860px; margin-inline: auto; }
.grid {
    display: grid;
    gap: 20px;
}
.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.quiz-card h2 { margin-top: 0; }
.meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}
.meta span, .question-number, .progress-text, .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    background: #e2e8f0;
}
.btn {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
}
.btn:hover { background: #1d4ed8; }
.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}
.btn-secondary:hover { background: #d1d5db; }
.form-stack {
    display: grid;
    gap: 14px;
}
.form-stack label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}
input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}
.checkbox-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    font-weight: 500 !important;
}
.alert {
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.quiz-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 12px;
}
.progress {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 20px;
}
.progress-bar {
    height: 100%;
    background: #22c55e;
}
.question-box h2 { margin-bottom: 18px; }
.answer-option {
    display: grid !important;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
}
.answer-option input[type="radio"] {
    width: 18px;
    height: 18px;
}
.answer-option--correct {
    border-color: #22c55e;
    background: #f0fdf4;
}
.answer-option--wrong {
    border-color: #ef4444;
    background: #fef2f2;
}
.feedback {
    padding: 16px;
    border-radius: 14px;
}
.feedback--success { background: #dcfce7; }
.feedback--error { background: #fee2e2; }
.score-panel {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 18px 0;
}
.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}
.result-item {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}
.result-item:first-child { border-top: 0; padding-top: 0; }
.text-success { color: #166534; font-weight: 700; }
.text-error { color: #991b1b; font-weight: 700; }
.actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.table-card { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}
.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.table-actions a, .link-button {
    color: #2563eb;
    text-decoration: none;
    font: inherit;
}
.link-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.stack-gap {
    display: grid;
    gap: 18px;
}
.site-footer {
    padding: 24px 0 40px;
    color: #6b7280;
}
@media (max-width: 700px) {
    .site-header__inner,
    .quiz-topbar,
    .section-header,
    .score-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .answer-option {
        grid-template-columns: auto 1fr;
    }
    .answer-option input[type="radio"] {
        grid-row: span 2;
    }
}
