/* ============================================================
   CBE Security Training — bilingual, RTL/LTR aware
   Palette: Midnight Executive — navy primary, cyan accent
   ============================================================ */
:root {
  --bg-page-1: #0b1538;
  --bg-page-2: #182a5e;
  --bg-card: #ffffff;
  --bg-card-soft: #f6f8ff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-mute: #94a3b8;
  --primary: #1E2761;
  --primary-2: #2747a3;
  --accent: #00c2d1;
  --accent-2: #29e0ee;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --line: #e2e8f0;
  --line-soft: #eef2ff;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.20);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(0, 194, 209, 0.18), transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, rgba(41, 224, 238, 0.15), transparent 60%),
    linear-gradient(180deg, var(--bg-page-1), var(--bg-page-2));
  color: var(--ink);
  font-family: 'Heebo', 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* RTL/LTR auto via [dir] on <html> */
html[dir="ltr"] body { font-family: 'Inter', 'Heebo', system-ui, sans-serif; }

/* Language token visibility — controlled by html[data-lang] */
.lang-en, .lang-he { display: none; }
html[data-lang="en"] .lang-en { display: inline; }
html[data-lang="he"] .lang-he { display: inline; }
html[data-lang="en"] .lang-en.block { display: block; }
html[data-lang="he"] .lang-he.block { display: block; }
/* Default before lang chosen: show Hebrew (matches initial dir) */
html:not([data-lang]) .lang-he { display: inline; }

.hidden { display: none !important; }

/* ─── Stage layouts ─── */
.stage {
  min-height: 100vh;
  width: 100%;
  padding: clamp(20px, 4vw, 56px);
  position: relative;
}
.stage-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
}

/* ─── Brand mark ─── */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  margin-bottom: 8px;
}
.brand-shield {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--primary);
  box-shadow: 0 6px 18px rgba(0, 194, 209, 0.40);
}
.brand-shield.small {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.brand-text { text-align: start; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.5px; }
.brand-sub { font-size: 0.80rem; opacity: 0.78; margin-top: 2px; }

/* ─── Hero ─── */
.hero-title {
  color: #fff;
  font-size: clamp(2.0rem, 4.5vw, 3.4rem);
  font-weight: 800;
  margin: 4px 0 0 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
  margin: 0;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px));
  gap: 18px;
  margin-top: 12px;
}
.lang-card {
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid transparent;
  border-radius: var(--r-lg);
  padding: 26px 22px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lang-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 22px 44px rgba(0, 194, 209, 0.30);
}
.lang-flag { font-size: 2.4rem; }
.lang-name { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.lang-meta { font-size: 0.85rem; color: var(--ink-mute); }

.footer-mini {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

/* ─── Register form ─── */
.welcome-title {
  color: #fff;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin: 0;
}
.welcome-text {
  color: rgba(255, 255, 255, 0.78);
  max-width: 540px;
  font-size: 1.02rem;
  margin: 0;
}

.register-form {
  background: var(--bg-card);
  width: min(440px, 100%);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: start;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.field input {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(39, 71, 163, 0.12);
}

/* ─── Buttons ─── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 8px 18px rgba(30, 39, 97, 0.30);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(30, 39, 97, 0.36); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--line);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--bg-card-soft); border-color: var(--primary-2); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 4px;
}
.btn-link:hover { color: #fff; }

/* ─── Training stage layout ─── */
#stage-training {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 40px);
  background: var(--primary);
  color: #fff;
  border-bottom: 4px solid var(--accent);
  gap: 20px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-titles { line-height: 1.15; }
.topbar-title { font-weight: 800; letter-spacing: 0.5px; }
.topbar-sub { font-size: 0.85rem; opacity: 0.75; }
.topbar-right { flex: 1; max-width: 380px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.progress-label { font-size: 0.85rem; opacity: 0.85; text-align: end; }
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-content {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 40px) 32px;
}
.topic-icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.topic-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 194, 209, 0.15), rgba(41, 224, 238, 0.20));
  font-size: 2rem;
}
.topic-id {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-card-soft);
  color: var(--primary-2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.topic-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--primary);
  margin: 8px 0 4px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.topic-intro {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.topic-section {
  background: var(--bg-card-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.topic-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 10px;
}
.topic-section ul, .topic-section ol {
  margin: 8px 0;
  padding-inline-start: 22px;
}
.topic-section li { margin-bottom: 6px; line-height: 1.6; }
.topic-section code {
  background: rgba(15, 23, 42, 0.07);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: 'Consolas', 'Monaco', monospace;
}
.topic-section table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.topic-section th, .topic-section td {
  padding: 8px 12px;
  text-align: start;
  border-bottom: 1px solid var(--line);
}
.topic-section th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.topic-section tr:last-child td { border-bottom: none; }

/* Quiz */
.quiz-wrap {
  margin-top: 28px;
  background: linear-gradient(135deg, rgba(30, 39, 97, 0.04), rgba(0, 194, 209, 0.06));
  border: 1.5px solid rgba(30, 39, 97, 0.10);
  border-radius: var(--r-lg);
  padding: 26px;
}
.quiz-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.quiz-question {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 18px;
  line-height: 1.5;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-family: inherit;
  font-size: 1rem;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz-option:hover {
  border-color: var(--primary-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.quiz-option.correct {
  border-color: var(--good);
  background: rgba(34, 197, 94, 0.06);
  cursor: default;
}
.quiz-option.wrong {
  border-color: var(--bad);
  background: rgba(239, 68, 68, 0.06);
  cursor: default;
}
.quiz-option.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.quiz-bullet {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-card-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quiz-option.correct .quiz-bullet { background: var(--good); color: #fff; }
.quiz-option.wrong .quiz-bullet { background: var(--bad); color: #fff; }

/* Topic footer */
.topic-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 40px);
  background: #fff;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.dots { display: flex; gap: 6px; flex: 1; justify-content: center; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s, transform 0.2s;
}
.dot.active { background: var(--primary-2); transform: scale(1.4); }
.dot.done { background: var(--good); }

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: start;
  animation: slideUp 0.25s ease;
}
.modal-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bad);
  margin: 0 0 12px;
}
.modal-body {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 22px;
}
.modal-body code { background: rgba(15, 23, 42, 0.07); padding: 1px 6px; border-radius: 4px; font-family: 'Consolas', monospace; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── Completion ─── */
.success-mark {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 40px rgba(0, 194, 209, 0.40);
  margin-bottom: 8px;
}
.cert-summary {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 26px 32px;
  box-shadow: var(--shadow-md);
  width: min(520px, 100%);
  text-align: start;
}
.cert-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.cert-row:last-child { border-bottom: none; }
.cert-key { color: var(--ink-mute); font-size: 0.9rem; font-weight: 500; }
.cert-val { color: var(--ink); font-weight: 700; }

.cert-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ─── Mobile tweaks ─── */
@media (max-width: 600px) {
  .lang-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; padding: 14px 18px; }
  .topbar-right { max-width: 100%; }
  .progress-label { text-align: start; }
  .topic-content { padding: 20px 18px; }
  .topic-section { padding: 16px 18px; }
  .quiz-wrap { padding: 18px; }
  .topic-footer { padding: 12px 18px; }
  .btn-ghost { padding: 9px 14px; font-size: 0.88rem; }
  .btn-primary { padding: 11px 18px; font-size: 0.95rem; }
}

/* ─── Admin styles ─── */
.admin-page {
  background: linear-gradient(180deg, var(--bg-page-1), var(--bg-page-2));
  min-height: 100vh;
  padding: 30px 20px;
  font-family: 'Inter', 'Heebo', system-ui, sans-serif;
}
.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.admin-header {
  background: var(--primary);
  color: #fff;
  padding: 22px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid var(--accent);
}
.admin-header h1 { font-size: 1.3rem; font-weight: 800; margin: 0; letter-spacing: 0.5px; }
.admin-header h1 small { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.7; margin-top: 2px; }
.admin-header button {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
.admin-header button:hover { background: rgba(255, 255, 255, 0.20); }

.admin-body { padding: 30px; }
.admin-body h2 { font-size: 1.1rem; color: var(--primary); margin: 24px 0 12px; font-weight: 700; }
.admin-body h2:first-child { margin-top: 0; }

.admin-login-card {
  max-width: 420px;
  margin: 60px auto;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.admin-login-card h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0 0 8px;
  text-align: center;
}
.admin-login-card .login-sub {
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.create-client-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: stretch;
}
.create-client-row input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
}
.create-client-row input:focus { outline: none; border-color: var(--primary-2); }

.client-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.client-card {
  background: var(--bg-card-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1.6fr 1fr auto auto;
  gap: 14px;
  align-items: center;
}
.client-info .client-name { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.client-info .client-date { font-size: 0.82rem; color: var(--ink-mute); margin-top: 2px; }
.client-link {
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.client-link span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-link button {
  flex-shrink: 0;
  background: var(--primary-2);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}
.client-stats {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
}
.client-stats div { text-align: center; }
.client-stats .num { font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.client-stats .lbl { color: var(--ink-mute); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; }

.btn-mini {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--primary-2); background: #fff; }
.btn-mini.danger:hover { border-color: var(--bad); color: var(--bad); }

.enrollments-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 12px;
}
.enrollments-table th, .enrollments-table td {
  padding: 10px 14px;
  text-align: start;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.92rem;
}
.enrollments-table th {
  background: var(--bg-card-soft);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.enrollments-table tr:last-child td { border-bottom: none; }
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-pill.done { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.status-pill.pending { background: rgba(245, 158, 11, 0.15); color: #b45309; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-mute);
  font-style: italic;
}

.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  animation: slideUp 0.25s ease;
}

@media (max-width: 720px) {
  .client-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .admin-header { padding: 18px 20px; }
  .admin-body { padding: 20px; }
}

/* ============================================================
   Additions for personalization + livelier visuals
   ============================================================ */

/* Landing page hero illustration */
.hero-illustration {
  width: min(520px, 100%);
  max-width: 100%;
  margin: -10px 0 4px;
  display: flex;
  justify-content: center;
}
.hero-illustration svg { width: 100%; height: auto; }

/* Hero title client name highlight */
.hero-client {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  white-space: nowrap;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-client { color: var(--accent-2); background: transparent; }
}

/* Stage 1 hero title - allow client name to break to its own line on small screens */
#stage-language .hero-title { max-width: 900px; }

/* Powered-by footer attribution */
.powered-by {
  margin-top: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.powered-by strong { color: rgba(255, 255, 255, 0.7); font-weight: 600; }

/* Stage 2 client pill */
.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 194, 209, 0.15);
  border: 1px solid rgba(0, 194, 209, 0.40);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
}
.client-pill strong { color: #29e0ee; font-weight: 700; }
.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #29e0ee;
  box-shadow: 0 0 0 0 rgba(41, 224, 238, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(41, 224, 238, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(41, 224, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(41, 224, 238, 0); }
}

/* ─── Topic hero layout (with illustration) ─── */
.topic-hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.topic-hero-left { min-width: 0; }
.topic-hero-illustration {
  background: linear-gradient(135deg, rgba(0,194,209,0.06), rgba(41,224,238,0.10));
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topic-hero-illustration svg { width: 100%; height: auto; max-height: 200px; }
.topic-icon-inline { font-size: 1.6rem; margin-inline-end: 8px; vertical-align: -3px; }
@media (max-width: 760px) {
  .topic-hero { grid-template-columns: 1fr; }
  .topic-hero-illustration { order: -1; max-width: 320px; margin: 0 auto; }
}

/* ─── Completion stage — celebration + score badge ─── */
.celebration-illustration { width: min(320px, 80%); margin-bottom: -10px; }
.celebration-illustration svg { width: 100%; height: auto; }
.score-badge {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--r-lg);
  padding: 20px 28px;
  box-shadow: var(--shadow-md);
  text-align: center;
  min-width: 260px;
  border-top: 4px solid var(--accent);
}
.score-num {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.score-label {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
}
.score-sub {
  font-size: 0.88rem;
  margin-top: 8px;
}
.score-sub.passed { color: #16a34a; font-weight: 600; }
.score-sub.not-passed { color: var(--ink-mute); }

/* Subtle background decoration on body for liveliness */
html, body { position: relative; }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(0, 194, 209, 0.07), transparent 30%),
    radial-gradient(circle at 90% 90%, rgba(41, 224, 238, 0.06), transparent 30%);
  pointer-events: none;
  z-index: 0;
}
.stage { position: relative; z-index: 1; }

/* Animation when quiz options are right/wrong */
@keyframes bounce-correct {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes shake-wrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.quiz-option.correct { animation: bounce-correct 0.5s ease; }
.quiz-option.wrong { animation: shake-wrong 0.45s ease; }

/* ─── Admin: passed-count badge + Export CSV button ─── */
.pass-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 18px 0 26px;
}
.pass-stat {
  background: linear-gradient(135deg, rgba(30,39,97,0.04), rgba(0,194,209,0.07));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 18px 22px;
  text-align: center;
}
.pass-stat.highlight {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border: none;
}
.pass-stat-num {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.pass-stat.highlight .pass-stat-num { color: #29e0ee; }
.pass-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mute);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pass-stat.highlight .pass-stat-label { color: rgba(255,255,255,0.7); }

.btn-export {
  background: #fff;
  border: 1.5px solid var(--good);
  color: var(--good);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-export:hover {
  background: var(--good);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.30);
}

/* Topbar client name should fit */
.topbar-title {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
