:root {
  --bg: #eef5f7;
  --card: #ffffff;
  --text: #22313f;
  --muted: #667585;
  --primary: #16697a;
  --primary-dark: #0f4d5a;
  --accent: #f6a623;
  --border: #d8e4e8;
  --danger: #b42318;
  --success: #1f7a4d;
  --soft: #f7fbfc;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
.public-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.card { width: min(920px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 26px; padding: 34px; box-shadow: 0 16px 40px rgba(18, 53, 66, .12); }
.hero-card { text-align: left; }
.form-card { max-width: 620px; }
.wide-card { max-width: 980px; }
.brand { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; }
.brand img { width: 86px; height: 86px; object-fit: contain; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; color: var(--primary); font-weight: 700; font-size: 13px; margin: 0 0 8px; }
h1 { margin: 0 0 18px; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; }
h2 { margin-top: 0; }
.lead { font-size: 21px; color: var(--primary-dark); font-weight: 700; }
.privacy-note, .muted { color: var(--muted); }
.info-box, .alert, .score-box { border-radius: 18px; padding: 18px; margin: 20px 0; }
.info-box { background: #fef8ec; border: 1px solid #f7d28b; }
.alert-error { background: #fff1f0; border: 1px solid #ffccc7; color: var(--danger); }
.alert-success { background: #ecfdf3; border: 1px solid #abefc6; color: var(--success); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 700; text-decoration: none; cursor: pointer; font-size: 16px; line-height: 1; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: #edf4f6; color: var(--primary-dark); }
.btn-danger { background: #fff1f0; color: var(--danger); }
.btn-small { padding: 8px 12px; font-size: 13px; }
.btn.is-loading { opacity: .65; cursor: wait; }
.stacked-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; font-weight: 700; }
input[type="text"], input[type="password"], select { width: 100%; padding: 14px 15px; border: 1px solid var(--border); border-radius: 14px; font-size: 18px; background: white; }
fieldset { border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
legend { font-weight: 700; color: var(--primary); }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quiz-card { max-width: 980px; }
.quiz-topline { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.pill { background: #edf4f6; color: var(--primary-dark); border-radius: 999px; padding: 8px 13px; font-weight: 700; }
.pill-multiple { background: #fff2d7; color: #7a4a00; }
.progress { height: 12px; background: #ddebef; border-radius: 999px; overflow: hidden; margin: 0 0 24px; }
.progress div { height: 100%; background: var(--primary); }
.question-title { font-size: clamp(26px, 3vw, 38px); line-height: 1.2; margin-bottom: 24px; }
.answers-list { display: grid; gap: 14px; }
.answer-option { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 13px; padding: 18px; border: 2px solid var(--border); border-radius: 18px; background: var(--soft); cursor: pointer; font-size: 19px; font-weight: 600; }
.answer-option:hover { border-color: var(--primary); background: #f1fafc; }
.answer-option input { width: 22px; height: 22px; }
.answer-letter { width: 34px; height: 34px; border-radius: 999px; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 800; }
.quiz-actions { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.score-box { text-align: center; background: #eefbf4; border: 1px solid #b9e8ce; }
.score-box span { display: block; color: var(--muted); }
.score-box strong { display: block; font-size: 56px; color: var(--success); margin: 8px 0; }
.score-box small { font-size: 22px; }
.admin-page { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: #f5f8fa; }
.admin-sidebar { background: #102f3a; color: white; padding: 26px; }
.admin-sidebar h1 { font-size: 28px; }
.admin-sidebar p { color: #c7d9df; }
.admin-sidebar nav { display: grid; gap: 10px; margin-top: 30px; }
.admin-sidebar a { color: white; text-decoration: none; padding: 11px 13px; border-radius: 12px; background: rgba(255,255,255,.08); }
.admin-sidebar a:hover { background: rgba(255,255,255,.17); }
.admin-main { padding: 30px; overflow-x: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin: 22px 0; }
.stat-card, .admin-section, .question-admin-card { background: white; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: 0 8px 20px rgba(18, 53, 66, .06); }
.stat-card span { color: var(--muted); display: block; }
.stat-card strong { font-size: 28px; color: var(--primary-dark); }
.admin-section { margin: 20px 0; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 16px; overflow: hidden; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #edf4f6; color: var(--primary-dark); }
.filter-bar { display: flex; gap: 12px; align-items: end; margin: 18px 0; }
.actions-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-cell form { margin: 0; }
.question-admin-card { margin-bottom: 18px; }
.question-admin-card h2 { display: flex; justify-content: space-between; gap: 14px; font-size: 20px; }
.question-admin-card.ok h2 span { color: var(--success); }
.question-admin-card.ko h2 span { color: var(--danger); }
.admin-answer-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.admin-answer-list li { padding: 10px; border-radius: 10px; background: #f7fafb; }
.correct-answer { border-left: 5px solid var(--success); }
.selected-answer { background: #fff7e8 !important; }
.explanation { color: var(--muted); }
code { background: #edf4f6; padding: 2px 6px; border-radius: 6px; }
.print-toolbar { position: sticky; top: 0; background: white; padding: 12px; border-bottom: 1px solid #ddd; z-index: 2; }
.pdf-body { background: white; color: #111; }
.pdf-question-page { min-height: 100vh; padding: 34px 42px; page-break-after: always; }
.pdf-header { border-bottom: 3px solid #16697a; margin-bottom: 28px; }
.pdf-header p { color: #16697a; font-weight: 700; }
.pdf-theme { color: #555; font-weight: 700; }
.pdf-question-page h1 { font-size: 34px; }
.pdf-question-page h2 { font-size: 26px; line-height: 1.25; margin: 30px 0; }
.pdf-answers { font-size: 20px; line-height: 1.45; }
.pdf-answers li { margin: 14px 0; padding: 10px; border-radius: 8px; }
.pdf-correct { background: #eaf8ef; border-left: 5px solid #1f7a4d; }
.pdf-correction-box { margin-top: 32px; border: 2px solid #16697a; border-radius: 18px; padding: 20px; font-size: 18px; }
@media (max-width: 820px) {
  .admin-page { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .stats-grid, .two-cols { grid-template-columns: 1fr; }
  .quiz-actions { flex-direction: column-reverse; }
  .btn { width: 100%; }
}
@media print {
  .print-toolbar, .admin-sidebar { display: none !important; }
  body { background: white; }
  .pdf-question-page { min-height: auto; height: 100vh; padding: 18mm; }
  .pdf-question-page:last-child { page-break-after: auto; }
}
