/* ============================================================
   Akademia – reviznytechnik.app
   Design: clean academic, blue/gold palette
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1D4ED8;
  --primary-dark:  #1e3a8a;
  --primary-light: #DBEAFE;
  --accent:        #F59E0B;
  --accent-dark:   #D97706;
  --success:       #10B981;
  --error:         #EF4444;
  --warning:       #F59E0B;
  --bg:            #F0F4FF;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --text:          #1E293B;
  --muted:         #64748B;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,.12);
  --top-bar-h:     60px;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, select, textarea { font: inherit; }

/* ── Utilities ────────────────────────────────────────────── */
.hidden    { display: none !important; }
.muted     { color: var(--muted); font-size: .875rem; }
.hint-text { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; transition: filter .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover  { filter: brightness(1.07); }
.btn:active { filter: brightness(.95); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-accent   { background: var(--accent); color: #fff; }
.btn-outline  { border: 2px solid var(--primary); color: var(--primary); }
.btn-ghost    { color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--border); border-radius: var(--radius-sm); }
.btn-full     { width: 100%; }
.btn-sm       { padding: 6px 12px; font-size: .85rem; }
.btn-lg       { padding: 14px 32px; font-size: 1.05rem; }
.btn-link     { color: var(--primary); font-size: .9rem; padding: 0; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }
.btn-danger   { background: var(--error); color: #fff; }

/* ── Fields ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field span { font-size: .875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .select-field, .search-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  font-size: .95rem; color: var(--text); transition: border-color .15s;
}
.field input:focus, .select-field:focus, .search-input:focus {
  outline: none; border-color: var(--primary);
}
.select-field { cursor: pointer; }
.search-input { padding-left: 10px; }

/* ── Messages ─────────────────────────────────────────────── */
.error-msg { color: var(--error); font-size: .875rem; margin-top: 6px; }
.info-msg  { color: var(--success); font-size: .875rem; margin-top: 6px; background: #D1FAE5; padding: 8px 12px; border-radius: var(--radius-sm); }

/* ── Top bar ──────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--top-bar-h); background: var(--primary-dark);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.brand       { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo  { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.brand-title { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.brand-sub   { color: var(--accent); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.top-nav     { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.nav-btn     { color: rgba(255,255,255,.7); padding: 6px 14px; border-radius: 6px; font-size: .9rem; font-weight: 500; transition: background .15s, color .15s; }
.nav-btn:hover  { color: #fff; background: rgba(255,255,255,.1); }
.nav-btn.active { color: #fff; background: rgba(255,255,255,.15); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang-btn    { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 4px 10px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.lang-btn:hover { background: rgba(255,255,255,.2); }
.top-bar .btn-ghost { color: rgba(255,255,255,.7); }
.top-bar .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Auth screen ──────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1D4ED8 60%, #2563EB 100%);
  padding: 24px;
}
.auth-card {
  background: var(--surface); border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 20px;
}
.auth-brand { text-align: center; }
.auth-logo  { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; margin-bottom: 12px; }
.auth-logo.small { width: 40px; height: 40px; }
.auth-brand h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }
.auth-brand h2 { font-size: 1.3rem; font-weight: 700; color: var(--primary-dark); }
.auth-subtitle { font-size: 1rem; font-weight: 700; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.auth-tagline  { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.form-row-end { display: flex; justify-content: flex-end; }
.auth-switch { text-align: center; font-size: .875rem; color: var(--muted); }

/* ── App main ─────────────────────────────────────────────── */
.app-main { padding-top: var(--top-bar-h); }

/* ── Views ────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

.view-container {
  max-width: 860px; margin: 0 auto; padding: 28px 20px;
}
.view-container.wide  { max-width: 1080px; }
.view-container.centered { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - var(--top-bar-h)); text-align: center; }

.back-btn { color: var(--primary); font-weight: 600; font-size: .9rem; margin-bottom: 18px; padding: 6px 0; }
.back-btn:hover { text-decoration: underline; }

/* ── Loading ──────────────────────────────────────────────── */
.loading-center { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dashboard ────────────────────────────────────────────── */
.dashboard-header { margin-bottom: 28px; }
.dashboard-header h2 { font-size: 1.5rem; font-weight: 700; }

/* Bundle grid */
.bundle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 36px; }
@media (max-width: 620px) { .bundle-grid { grid-template-columns: 1fr; } }

.bundle-card {
  background: var(--surface); border-radius: var(--radius);
  border: 2px solid var(--border); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.bundle-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.bundle-card--premium { border-color: var(--accent); }
.bundle-card--premium:hover { border-color: var(--accent-dark); }

.bundle-badge {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 99px; width: fit-content;
}
.bundle-badge--base    { background: var(--primary-light); color: var(--primary); }
.bundle-badge--premium { background: #FEF3C7; color: #92400E; }

.bundle-title { font-size: 1.1rem; font-weight: 700; }
.bundle-desc  { font-size: .9rem; color: var(--muted); }
.bundle-includes { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.bundle-includes li { font-size: .875rem; padding-left: 16px; position: relative; }
.bundle-includes li::before { content: "✓"; color: var(--success); position: absolute; left: 0; font-weight: 700; }
.bundle-footer { margin-top: auto; padding-top: 8px; }

/* Chapter list */
.section-heading { margin-bottom: 16px; }
.section-heading h3 { font-size: 1.1rem; font-weight: 700; }
.section-heading-sm { font-size: 1rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 24px 0 10px; }

.chapters-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-item {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.chapter-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.chapter-item-icon { font-size: 1.5rem; width: 40px; text-align: center; flex-shrink: 0; }
.chapter-item-body { flex: 1; }
.chapter-item-title { font-weight: 600; font-size: .95rem; }
.chapter-item-meta  { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.chapter-item-progress { flex-shrink: 0; width: 60px; text-align: right; font-size: .8rem; font-weight: 600; color: var(--primary); }

/* ── Chapter view ─────────────────────────────────────────── */
.chapter-header { margin-bottom: 18px; }
.chapter-header h2 { font-size: 1.3rem; font-weight: 700; }
.progress-track { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.progress-track.slim { height: 4px; width: 120px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .3s; }
.progress-label { font-size: .8rem; color: var(--muted); margin-bottom: 20px; display: block; }

.sections-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.section-item {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: border-color .15s;
}
.section-item:hover { border-color: var(--primary); }
.section-item.done { border-color: var(--success); background: #F0FDF4; }
.section-item-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .75rem; font-weight: 700; }
.section-item.done .section-item-check { background: var(--success); border-color: var(--success); color: #fff; }
.section-item-title { flex: 1; font-size: .9rem; font-weight: 500; }
.section-item-arrow { color: var(--muted); font-size: .85rem; }

.chapter-quiz-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Reader ───────────────────────────────────────────────── */
.reader-container { max-width: 740px; }
.reader-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.reader-arrows { display: flex; gap: 8px; }
.reader-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; color: var(--primary-dark); }
.reader-done-row { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Markdown body */
.markdown-body { line-height: 1.75; color: var(--text); }
.markdown-body h1, .markdown-body h2 { font-size: 1.25rem; font-weight: 700; margin: 1.4em 0 .6em; color: var(--primary-dark); }
.markdown-body h3 { font-size: 1rem; font-weight: 700; margin: 1.2em 0 .5em; }
.markdown-body p  { margin-bottom: .9em; }
.markdown-body ul, .markdown-body ol { margin: .6em 0 .9em 1.4em; }
.markdown-body li { margin-bottom: .3em; }
.markdown-body strong { font-weight: 700; }
.markdown-body em { font-style: italic; }
.markdown-body code { background: #F1F5F9; padding: 2px 6px; border-radius: 4px; font-size: .9em; font-family: monospace; }
.markdown-body pre { background: #F1F5F9; padding: 14px; border-radius: var(--radius-sm); overflow-x: auto; margin: .9em 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 4px solid var(--primary); padding-left: 14px; color: var(--muted); margin: .9em 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: .9em 0; font-size: .9em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 7px 12px; }
.markdown-body th { background: var(--primary-light); font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }

/* ── Quiz ─────────────────────────────────────────────────── */
.quiz-header { margin-bottom: 20px; }
.quiz-header h2 { font-size: 1.2rem; font-weight: 700; }
.quiz-meta-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

.question-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 28px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.question-text { font-size: 1.05rem; font-weight: 600; margin-bottom: 20px; line-height: 1.5; }

.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  text-align: left; padding: 12px 16px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); font-size: .95rem;
  font-weight: 500; transition: border-color .15s, background .15s; cursor: pointer;
  display: flex; align-items: flex-start; gap: 10px;
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }
.option-btn.selected  { border-color: var(--primary); background: var(--primary-light); }
.option-btn.correct   { border-color: var(--success); background: #D1FAE5; }
.option-btn.incorrect { border-color: var(--error); background: #FEE2E2; }
.option-btn:disabled  { cursor: default; }
.option-label { font-weight: 700; color: var(--muted); flex-shrink: 0; min-width: 20px; }

.question-feedback { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.feedback-row  { display: flex; align-items: center; gap: 8px; }
.feedback-icon { font-size: 1.2rem; }
.feedback-text { font-weight: 600; font-size: .95rem; }
.explanation-text { font-size: .875rem; }

/* Quiz results */
.quiz-results { text-align: center; padding: 40px 20px; }
.result-donut {
  width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; border: 8px solid var(--border);
}
.result-donut.pass { border-color: var(--success); color: var(--success); }
.result-donut.fail { border-color: var(--error); color: var(--error); }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ── Exam ─────────────────────────────────────────────────── */
.exam-intro-card {
  background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius);
  padding: 32px; max-width: 520px; display: flex; flex-direction: column; gap: 18px;
}
.exam-rules { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.exam-rules li { font-size: .95rem; padding-left: 20px; position: relative; }
.exam-rules li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.exam-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.exam-progress-row { display: flex; align-items: center; gap: 12px; flex: 1; }
.exam-timer-box { display: flex; flex-direction: column; align-items: flex-end; }
.exam-timer-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.exam-timer { font-size: 1.4rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.exam-timer.warning { color: var(--error); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.exam-options .option-btn { cursor: pointer; }
.exam-options .option-btn.exam-selected { border-color: var(--primary); background: var(--primary-light); }

.exam-nav-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.exam-results { padding: 20px 0; }

/* ── Progress view ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.stat-card .stat-val { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .stat-lbl { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.history-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.history-item {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
}
.history-score { font-weight: 700; }
.history-score.pass { color: var(--success); }
.history-score.fail { color: var(--error); }

/* ── Profile ──────────────────────────────────────────────── */
.profile-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.profile-identity { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; flex-shrink: 0; }
.profile-name  { font-weight: 700; font-size: 1.05rem; }
.profile-email { font-size: .875rem; }
.profile-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.profile-actions { padding-top: 8px; border-top: 1px solid var(--border); }

.bundles-status-list { display: flex; flex-direction: column; gap: 8px; }
.bundle-status-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--bg); border-radius: var(--radius-sm); }
.bundle-status-row .bundle-status-name { font-weight: 600; font-size: .9rem; }
.badge-active   { background: #D1FAE5; color: #065F46; border-radius: 99px; padding: 2px 10px; font-size: .8rem; font-weight: 700; }
.badge-inactive { background: var(--border); color: var(--muted); border-radius: 99px; padding: 2px 10px; font-size: .8rem; font-weight: 700; }

/* Cert reward */
.cert-reward-panel { background: #FFFBEB; border: 2px solid var(--accent); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.cert-reward-header { display: flex; gap: 12px; align-items: flex-start; }
.cert-reward-icon { font-size: 2rem; }
.cert-status-box { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .875rem; }

/* ── Admin ────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 2px solid var(--border); padding-bottom: 0; }
.tab-btn { padding: 10px 18px; font-size: .9rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content.active { display: block; }

.admin-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-toolbar-title { font-size: 1rem; font-weight: 700; flex: 1; }

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-item {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.admin-item-body { flex: 1; }
.admin-item-title { font-weight: 600; font-size: .9rem; }
.admin-item-meta  { font-size: .8rem; color: var(--muted); }
.admin-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; background: var(--error); color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 700; padding: 0 5px; margin-left: 4px; }

/* Admin forms */
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-form label { font-size: .875rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem; font-family: inherit;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { outline: none; border-color: var(--primary); }
.admin-form textarea { min-height: 220px; resize: vertical; font-family: monospace; font-size: .85rem; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-form .option-field { display: flex; gap: 8px; align-items: center; }
.admin-form .option-field input { flex: 1; }
.correct-radio-label { font-size: .8rem; font-weight: normal; color: var(--muted); }
.correct-radio-label input[type=radio] { margin-right: 4px; }

/* ── Payment result ───────────────────────────────────────── */
.result-box { background: var(--surface); border-radius: var(--radius); padding: 40px 32px; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; box-shadow: var(--shadow-md); }
.result-box--success { border-top: 6px solid var(--success); }
.result-box--cancel  { border-top: 6px solid var(--muted); }
.result-icon-big { font-size: 3rem; }
.result-box--success .result-icon-big { color: var(--success); }
.result-box--cancel  .result-icon-big { color: var(--muted); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 28px;
  max-width: 580px; width: 100%; max-height: 90vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow-md);
}
.modal-close { position: absolute; top: 14px; right: 16px; font-size: 1.1rem; color: var(--muted); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; padding-right: 28px; }
.modal-body  { margin-bottom: 20px; font-size: .95rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Toasts ───────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: .9rem; max-width: 340px; pointer-events: all;
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
  box-shadow: var(--shadow-md);
}
.toast--visible   { opacity: 1; transform: translateY(0); }
.toast--success   { background: var(--success); }
.toast--error     { background: var(--error); }
.toast--warning   { background: var(--accent); }

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 640px) {
  .top-nav { display: none; }
  .auth-card { padding: 28px 20px; }
  .question-card { padding: 20px; }
  .admin-toolbar { flex-direction: column; align-items: flex-start; }
  .admin-form .form-row { grid-template-columns: 1fr; }
}
