/* Training Forms — design system
   Blue/teal professional theme. Mobile-first, RTL-safe. */

:root {
  --color-primary: #0f766e;
  --color-primary-dark: #0b5c56;
  --color-primary-light: #ccfbf1;
  --color-accent: #2563eb;
  --color-accent-light: #dbeafe;
  --color-danger: #dc2626;
  --color-danger-light: #fee2e2;
  --color-success: #16a34a;
  --color-success-light: #dcfce7;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;

  --color-bg: #f4f7f8;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .08);
  --sidebar-width: 240px;
  --font-en: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-ar: "Readex Pro", var(--font-en);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Bilingual blocks: English line, then Arabic line underneath (RTL). */
/* align-items: flex-start keeps each line hugging its own text width and left-anchored —
   without it, a lone .bi block (no sibling to constrain its width, e.g. the "I don't know"
   option) stretches full-width and the RTL Arabic line's text-align:right then pushes it
   to the far right instead of sitting directly under the English line. */
.bi { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.bi-en { font-family: var(--font-en); }
/* Readex Pro's regular (400) renders visibly heavier than the English system font at the
   same nominal weight — drop to its Light (300) face by default so paired EN/AR lines read
   as the same weight. Anywhere a bold/heavy look is wanted, an inline font-weight already
   set on that specific .bi-ar span overrides this (headings, buttons, etc.). */
.bi-ar { font-family: var(--font-ar); font-weight: 300; direction: rtl; text-align: right; color: var(--color-text-muted); }
.bi-ar:only-child { color: inherit; }
/* English-only forms leave text_ar blank — collapse the line entirely instead of showing an
   empty gap under the English text. Works everywhere .bi-ar is used, no per-page changes needed. */
.bi-ar:empty { display: none; }

/* Focus visibility for keyboard nav */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-primary);
  color: #fff; padding: 10px 16px; z-index: 1000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: #1d4ed8; }
.btn-whatsapp { background: #25d366; color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-whatsapp-icon { width: 16px; height: 16px; flex-shrink: 0; fill: currentColor; }
.btn-outline { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn-outline:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: var(--color-danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--color-danger-light); }
.btn-danger-solid { background: var(--color-danger); color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Forms ---------- */
label, .field-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--color-text); }
.field-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

/* ---------- Drop zones (question image, Excel import) ---------- */
.dropzone {
  border: 2px dashed var(--color-border); border-radius: var(--radius-md); padding: 20px;
  text-align: center; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--color-primary); background: var(--color-primary-light); }
.dropzone.dragover { border-color: var(--color-primary); background: var(--color-primary-light); }
.dropzone input[type="file"] { display: block; margin: 0 auto; max-width: 100%; }
.field-error { font-size: 12px; color: var(--color-danger); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff; color: var(--color-text); font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--color-accent); }
.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > .form-group { flex: 1 1 220px; }
fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 6px; }
.radio-row, .checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.radio-row input, .checkbox-row input { width: auto; }
.input-with-icon { position: relative; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Drag-to-reorder (Questions list) ---------- */
.drag-handle {
  cursor: grab; color: var(--color-text-muted); font-size: 18px; line-height: 1; padding-top: 2px; flex-shrink: 0;
  user-select: none; -webkit-user-select: none;
  /* Pointer-Events-based drag (not native HTML5 DnD, see question-reorder.js) needs this so a
     touch drag isn't hijacked by the browser's own page-scroll gesture before JS sees it. */
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.question-card-row.dragging { opacity: .4; }
.answer-row.dragging { opacity: .4; }

/* ---------- Answer builder: "Same as English" Arabic mirror ---------- */
.mirror-toggle {
  display: flex; align-items: center; gap: 5px; margin: 5px 0 0; font-size: 12px;
  font-weight: 400; color: var(--color-text-muted); cursor: pointer;
}
.mirror-toggle input[type="checkbox"] { margin: 0; }
input[name="answer_ar[]"][readonly] { background: var(--color-bg-subtle, #f1f5f9); color: var(--color-text-muted); }

/* ---------- Tabs ---------- */
.tab-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.tab-link {
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-link:hover { color: var(--color-text); text-decoration: none; }
.tab-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ---------- Badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-active { background: var(--color-success-light); color: #166534; }
.badge-inactive { background: #f1f5f9; color: var(--color-text-muted); }
.badge-archived { background: var(--color-warning-light); color: #92400e; }
.badge-test { background: var(--color-accent-light); color: #1e40af; }
.badge-assessment { background: #ede9fe; color: #5b21b6; }
.badge-feedback { background: #ffedd5; color: #9a3412; }
.badge-correct { background: var(--color-success-light); color: #166534; }
.badge-incorrect { background: var(--color-danger-light); color: #991b1b; }
.badge-idk { background: #f1f5f9; color: var(--color-text-muted); }
.badge-level-advanced { background: var(--color-success-light); color: #166534; }
.badge-level-intermediate { background: var(--color-warning-light); color: #92400e; }
.badge-level-basic { background: var(--color-danger-light); color: #991b1b; }

/* ---------- Alerts ---------- */
.alert { padding: 14px 16px; border-radius: var(--radius-md); margin-bottom: 16px; border: 1px solid transparent; }
.alert-info { background: var(--color-accent-light); border-color: #bfdbfe; color: #1e3a8a; }
.alert-success { background: var(--color-success-light); border-color: #bbf7d0; color: #14532d; }
.alert-danger { background: var(--color-danger-light); border-color: #fecaca; color: #7f1d1d; }
.alert-warning { background: var(--color-warning-light); border-color: #fde68a; color: #78350f; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
table.data-table { width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 14px; }
table.data-table th { background: #f8fafc; font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
table.data-table tbody tr:hover { background: #f8fafc; }

/* ---------- Admin shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--sidebar-width); flex-shrink: 0; background: #0b3b37; color: #d1fae5;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar .brand { color: #fff; font-weight: 800; font-size: 17px; margin-bottom: 22px; display: flex; align-items: center; gap: 8px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: #d1fae5; font-weight: 600; font-size: 14px; margin-bottom: 2px;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 20px;
  background: #fff; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 20;
}
.admin-content { padding: 20px; max-width: 1600px; margin: 0 auto; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--color-text); }

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-md);
  }
  html[dir="rtl"] .admin-sidebar { left: auto; right: 0; transform: translateX(100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-block; }
  .admin-content { padding: 14px; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; display: none; }
  .sidebar-backdrop.open { display: block; }
}

/* ---------- Dashboard grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 16px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; color: var(--color-primary); }
.stat-card .stat-label { font-size: 13px; color: var(--color-text-muted); }

/* ---------- Answer distribution (Results pages) ---------- */
.dist-question { margin-bottom: 24px; }
.dist-question:last-child { margin-bottom: 0; }
.dist-question-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dist-question-num { font-weight: 800; color: var(--color-primary); font-size: 13px; }
.dist-question-text { font-weight: 700; flex: 1 1 300px; }
.dist-question-total { font-size: 12px; color: var(--color-text-muted); }
.dist-empty { margin: 0; font-size: 14px; }
.dist-bars { display: flex; flex-direction: column; gap: 12px; }
.dist-row-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.dist-row-pct { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dist-bar-track { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 999px; height: 10px; overflow: hidden; }
.dist-bar-fill { background: var(--color-accent); height: 100%; border-radius: 999px; }
.dist-bar-fill.dist-bar-correct { background: var(--color-success); }
.dist-bar-fill.dist-bar-incorrect { background: var(--color-danger); }
.dist-rating-avg { margin: 0 0 10px; font-size: 14px; }
.dist-text-list { margin: 8px 0 0; padding-left: 20px; }
.dist-text-list li { margin-bottom: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.form-tile {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px;
}
/* The Dashboard's Active-Forms tiles are plain <a> tags (click anywhere → the editor) —
   reset link styling and add a hover lift so that still reads as clickable. */
a.form-tile { text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
a.form-tile:hover { box-shadow: var(--shadow-md); border-color: #94a3b8; }
.form-tile-title { font-weight: 700; font-size: 16px; }
.form-tile-meta { font-size: 12px; color: var(--color-text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.form-tile-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }

/* ---------- Participant / public site ---------- */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.public-header { background: var(--color-primary); color: #fff; padding: 16px 0; }
.public-header .brand { color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.public-main { flex: 1; padding: 28px 0 50px; }
.public-footer { text-align: center; padding: 18px; font-size: 12px; color: var(--color-text-muted); }

.progress-wrap { margin-bottom: 18px; }
.progress-track { background: #e2e8f0; border-radius: 999px; height: 10px; overflow: hidden; }
.progress-fill { background: var(--color-primary); height: 100%; transition: width .25s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--color-text-muted); margin-top: 6px; flex-wrap: wrap; gap: 6px; }
.timer-badge { font-variant-numeric: tabular-nums; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--color-accent-light); color: #1e3a8a; }
.timer-badge.timer-low { background: var(--color-danger-light); color: #991b1b; }

.question-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.question-image { margin: 12px 0; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); max-width: 480px; }
.answer-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.answer-option {
  display: flex; align-items: center; border: 2px solid var(--color-border); border-radius: var(--radius-md);
  padding: 12px 16px; cursor: pointer; transition: border-color .15s, background .15s;
  /* Keeps an English-only answer the same height as its bilingual siblings in the same
     question — a shorter box would otherwise visually single it out before it's read. */
  min-height: 60px;
}
.answer-option > .flex { flex: 1 1 auto; min-width: 0; }
.answer-option:hover { border-color: #94a3b8; }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }
.answer-option.selected { border-color: var(--color-primary); background: var(--color-primary-light); }
.answer-option .opt-label { font-weight: 700; color: var(--color-primary); margin-right: 8px; }
.answer-option.idk-option { border-style: dashed; }

/* Feedback-only question types: free text and star rating. */
.text-answer-input, .paragraph-answer-input {
  width: 100%; margin-top: 16px; border: 2px solid var(--color-border); border-radius: var(--radius-md);
  padding: 12px 16px; font: inherit; color: var(--color-text); transition: border-color .15s;
}
.text-answer-input:focus, .paragraph-answer-input:focus { outline: none; border-color: var(--color-primary); }
.paragraph-answer-input { resize: vertical; min-height: 120px; }

.rating-stars { display: flex; gap: 6px; margin-top: 16px; }
.rating-star { position: relative; cursor: pointer; font-size: 34px; line-height: 1; color: var(--color-border); transition: color .15s, transform .1s; }
.rating-star input { position: absolute; opacity: 0; pointer-events: none; }
.rating-star:hover { color: #cbd5e1; transform: scale(1.1); }
.rating-star.selected { color: var(--color-warning); }

.nav-buttons { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* Post-test review: a visible tint + thick accent bar per question, at a glance, not just
   a thin border and a small badge — correct vs. incorrect should read instantly. */
.review-item { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; background: #fff; border-inline-start-width: 6px; }
.review-item.correct { background: var(--color-success-light); border-color: #86efac; border-inline-start-color: var(--color-success); }
.review-item.incorrect { background: var(--color-danger-light); border-color: #fca5a5; border-inline-start-color: var(--color-danger); }
.review-item .badge { font-size: 13px; padding: 5px 12px; }

/* Boxed "your answer" / "correct answer" callouts inside a review item, so the actual
   answer text stands out from the tinted card background instead of blending into it. */
.answer-pill { background: #fff; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); padding: 10px 12px; }
.answer-pill.pill-correct { border-color: var(--color-success); }
.answer-pill.pill-incorrect { border-color: var(--color-danger); }
.answer-pill .bi-en, .answer-pill .bi-ar { font-weight: 600; }

/* Pre-test/post-test/assessment instructions screen. */
.instructions-card { max-width: 560px; margin: 0 auto; }
.instructions-note { color: var(--color-text-muted); line-height: 1.6; margin-bottom: 20px; }

/* The one thing that actually matters right before they click — its own highlighted box
   instead of blending in as another plain paragraph. */
.time-callout {
  background: var(--color-primary-light); border: 1px solid #99f6e4; border-radius: var(--radius-md);
  padding: 16px 20px; text-align: center; margin-bottom: 4px;
}
.time-callout .bi-en, .time-callout .bi-ar { color: var(--color-primary-dark); }
.time-callout strong { color: var(--color-primary); }

.score-hero {
  text-align: center; padding: 30px 16px; position: relative; overflow: hidden;
  /* Default tone for hero content that isn't tone-banded (e.g. Pre-test's result, which
     isn't graded with the Post-test's great/okay/keep_going system) — .tone-* below overrides. */
  --hero-color: var(--color-primary); --hero-tint: var(--color-primary-light);
}
.score-hero .score-value { font-size: 52px; font-weight: 800; color: var(--color-primary); }

/* Post-test score ring: a tone-matched radial glow behind the card, a real conic-gradient
   progress ring around the score (not just plain text), and the count shown as a pill —
   a lot more engaging at a glance than a flat number. */
.score-hero.tone-great { --hero-color: var(--color-success); --hero-tint: var(--color-success-light); }
.score-hero.tone-okay { --hero-color: var(--color-accent); --hero-tint: var(--color-accent-light); }
.score-hero.tone-keep_going { --hero-color: var(--color-warning); --hero-tint: var(--color-warning-light); }

.score-hero[class*="tone-"]::before {
  content: ''; position: absolute; z-index: 0; top: -70px; left: 50%; transform: translateX(-50%);
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--hero-tint) 0%, transparent 72%);
  pointer-events: none;
}
/* Everything else in the card sits in its own layer above the glow, so the glow can never
   wash out the title/text — it only ever shows in the gaps around them. */
.score-hero-content { position: relative; z-index: 1; }

.score-ring {
  position: relative; width: 168px; height: 168px; margin: 20px auto 0; border-radius: 50%;
  background: conic-gradient(var(--hero-color) calc(var(--pct) * 1%), #e5e7eb 0);
  display: flex; align-items: center; justify-content: center;
  animation: score-ring-in .6s cubic-bezier(.34,1.56,.64,1);
}
.score-ring::before {
  content: ''; position: absolute; inset: 12px; background: var(--color-surface); border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.score-ring-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.score-ring-value { font-size: 32px; font-weight: 800; color: var(--hero-color); line-height: 1; }
.score-ring-emoji { font-size: 26px; line-height: 1; margin-top: 4px; }

.score-count-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 999px;
  background: var(--hero-tint); color: var(--hero-color); font-weight: 700; font-size: 13px;
  position: relative; z-index: 1;
}
/* Used where the count is the primary result on screen (Pre-test), not a secondary detail
   under a percentage ring (Post-test) — same component, sized up to carry that weight. */
.score-count-pill.lg { font-size: 22px; padding: 10px 22px; }

@keyframes score-ring-in {
  from { opacity: 0; transform: scale(.75); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .score-ring { animation: none; }
}

.qr-tile { text-align: center; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.qr-tile img { width: 200px; height: 200px; margin: 0 auto 10px; }
.link-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link-box input { flex: 1 1 240px; font-family: monospace; font-size: 13px; background: #f8fafc; }

.code-mask { font-family: monospace; letter-spacing: 3px; font-size: 16px; font-weight: 700; white-space: nowrap; display: inline-block; }

@media (max-width: 640px) {
  .card { padding: 16px; }
  .question-card { padding: 16px; }
  .btn { padding: 10px 14px; }
  table.data-table th, table.data-table td { padding: 10px; font-size: 13px; }

  /* Freeze the progress bar + countdown timer at the top while a participant scrolls
     through a question on Test/Assessment/Feedback (public/participant/test.php) — mobile
     only, since a desktop screen shows most of a question without scrolling in the first
     place. Scoped to .public-main so it never affects the admin's own Test Mode preview,
     which reuses the same .progress-wrap markup/class under a different page shell. */
  .public-main .progress-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-surface);
    margin: 0 -16px 18px;
    padding: 12px 16px 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  }
}

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
