/* ════════════════════════════════════════════════════════════════════
   exam-app.css — Exam Assessment Generator
   ──────────────────────────────────────────────────────────────────
   Loaded AFTER icms-app.css so it inherits all the existing wizard
   styling (panels, fields, buttons, dropzone). Only adds the bits
   unique to the exam wizard: step indicator, mode-choice cards,
   payment cards, paper download cards, and the trial-preview badge.
   ════════════════════════════════════════════════════════════════════ */

.exam-app-header .header-right { gap: 10px !important; }

/* Header nav buttons — one consistent translucent pill on the dark header
   (gold on hover), so Home / My Documents / Refer & Earn / My Assessments /
   Logout read as a cohesive group (no purple). */
.exam-app-header .header-right .icms-libnav-btn {
	background: rgba(255, 255, 255, 0.07) !important;
	border: 1px solid rgba(255, 255, 255, 0.16) !important;
	color: #fff !important;
}
.exam-app-header .header-right .icms-libnav-btn:hover {
	background: rgba(212, 163, 90, 0.18) !important;
	border-color: rgba(212, 163, 90, 0.45) !important;
	color: #fbbf24 !important;
}
.exam-app-header .header-right .icms-libnav-btn i { color: #fbbf24 !important; }

.exam-app-container { padding-top: 12px !important; }

/* ── Step indicator ─────────────────────────────────────────────
   REMOVED 2026-08-03. The wizard now uses the shared `.icms-steps`
   segmented control in css/icms-forms.css §6, the same component the
   Documents wizard renders — one look across both modules instead of two.

   The ~55 lines that were here (`.exam-steps`, `.exam-step`, its hover /
   focus-visible / active states and `.exam-step-n`) had to be DELETED rather
   than overridden: this sheet is linked at the bottom of the body in
   exam/exam.php, i.e. AFTER icms-forms.css, so at equal specificity these
   rules won on source order and the old pills kept rendering.

   `exam-step` and `data-step` are still on the markup — exam/js/app.js finds
   the segments with querySelectorAll(".exam-step") — they simply carry no
   styling of their own now. Do not re-add rules for them here. */

/* ── Panel: only one visible at a time ────────────────────────── */
.exam-panel { display: none !important; }
.exam-panel.active { display: block !important; }

/* ── Mode choice cards ──────────────────────────────────────────
   REMOVED 2026-08-03, same reason as the step indicator above: this sheet
   loads after css/icms-forms.css, so leaving these in place would have kept
   the old cards winning. The five assessment-mode cards are now the shared
   `.icms-choice` component (icms-forms.css §8) — hidden native radio, redrawn
   mark, whole card clickable, selection driven by :has(input:checked).

   Gone with them: `.exam-choice-row`, `.exam-choice-title`, `.exam-choice-grid`
   and the `:nth-child(1)` column overrides. That nth-child targeting was
   fragile in its own right — inserting any block above the mode cards silently
   re-flowed them from five columns to three.

   `.exam-choice-block` is KEPT below: #examPaperCountBlock still uses it, and
   exam/js/app.js toggles that element's inline display in Tool mode. */
.exam-choice-block { background: #fff; }

/* Mode-inapplicable form fields.
   `.icms-app-panel .field` sets `display:flex !important` (css/icms-app.css),
   which overrode the inline `display:none` that
   refreshExamPracticalFieldVisibility() applies when a duration field doesn't
   apply to the chosen mode — so "Practical only" still showed the Written/Oral
   duration. exam.css loads last, so this rule wins. */
.icms-app-panel .field.exam-field-hidden,
.field.exam-field-hidden { display: none !important; }

/* ── Payment / trial grid ────────────────────────────────────── */
.exam-pay-grid {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 24px;
}
@media (max-width: 880px) { .exam-pay-grid { grid-template-columns: 1fr; } }

.exam-pay-summary {
	background: #0f172a;
	color: #e2e8f0;
	border-radius: 16px;
	padding: 22px;
}
.exam-pay-summary-h {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fbbf24;
	margin: 0 0 14px;
}
.exam-pay-summary-line {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0;
	font-size: 13px;
	color: #cbd5e1;
}
.exam-pay-summary-line strong { color: #fff; }
.exam-pay-summary hr { border: 0; border-top: 1px solid rgba(255,255,255,0.12); margin: 10px 0; }
.exam-pay-summary-total {
	font-size: 14px;
	color: #fff;
	font-weight: 800;
}
.exam-pay-summary-total strong { color: #fbbf24; }
.exam-pay-note { font-size: 11.5px; color: #94a3b8; margin-top: 12px; line-height: 1.45; }

.exam-pay-actions { display: flex; flex-direction: column; gap: 16px; }

/* Card uses flex-wrap so the M-Pesa form drops onto its own line
   beneath the icon + body instead of fighting them for width. The
   body text gets a sensible 240 px minimum so each word can't
   collapse onto its own line — which is what happened when the
   `<div class="exam-pay-form">` (width: 100%) used to be a direct
   flex sibling stealing the whole row. */
.exam-cta-card {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-start;
	border: 1.5px solid #e2e8f0;
	border-radius: 16px;
	padding: 18px;
	background: #fff;
}
.exam-cta-card--trial { border-color: #e7ebf3; background: #f5f7fb; }
.exam-cta-card--pay   { border-color: #e3bd83; background: #ffffff; }
.exam-cta-card-icon {
	width: 44px; height: 44px;
	border-radius: 12px;
	background: #0f172a;
	color: #fbbf24;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 18px;
	flex: 0 0 44px;
}
.exam-cta-card-body {
	flex: 1 1 240px;
	min-width: 0;
}
.exam-cta-card-body h4 {
	margin: 0 0 6px;
	font-size: 14.5px;
	font-weight: 800;
	color: #0f172a;
}
.exam-cta-card-body p {
	margin: 0;
	font-size: 12.5px;
	color: #475569;
	line-height: 1.45;
}

/* Trial-card button hugs its content and sits beside the body when
   there's room, wraps to its own line on narrow screens via the
   parent's flex-wrap. */
.exam-cta-card--trial > button {
	flex: 0 0 auto;
	align-self: center;
	margin-top: 4px;
}

/* M-Pesa form takes the full card width on its own row so the body
   text above can breathe. The `flex-basis: 100%` + flex-wrap trick
   on the parent guarantees the form drops below — no manual
   media queries needed. */
.exam-cta-card--pay > .exam-pay-form {
	flex: 0 0 100%;
	max-width: 100%;
	margin-top: 4px;
}
.exam-pay-form label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.exam-pay-form input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1.5px solid #cbd5e1;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 10px;
	background: #fff;
}
.exam-pay-form input:focus {
	outline: none;
	border-color: #d4a35a;
	box-shadow: 0 0 0 4px rgba(212, 163, 90, 0.18);
}
.exam-pay-form button {
	width: 100%;
	box-sizing: border-box;
}

/* ── Output: per-paper cards ─────────────────────────────────── */
.exam-output { display: none; }
.exam-papers-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
	margin: 20px 0;
}
.exam-paper-card {
	background: #fff;
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.exam-paper-card-head { display: flex; align-items: center; gap: 12px; }
.exam-paper-card-icon {
	width: 38px; height: 38px;
	border-radius: 10px;
	background: #0f172a;
	color: #fbbf24;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
}
.exam-paper-card-titles { min-width: 0; }
.exam-paper-card-title { font-size: 14px; font-weight: 800; color: #0f172a; }
.exam-paper-card-sub   { font-size: 11.5px; color: #64748b; margin-top: 2px; }

.exam-trial-pill {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	background: #fef3c7;
	color: #92400e;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.05em;
}

.exam-paper-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.exam-paper-btn {
	flex: 1 1 calc(50% - 4px);
	background: #0f172a;
	color: #fbbf24;
	border: none;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: background .15s ease;
}
.exam-paper-btn:hover { background: #1e293b; }
.exam-paper-btn:focus-visible { outline: 3px solid rgba(251,191,36,0.6); outline-offset: 2px; }

/* ── Outcomes list ───────────────────────────────────────────── */
.outcomes-preview .outcomes-list { display: flex; flex-direction: column; gap: 8px; }
.outcomes-list .outcome-item {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}
.outcomes-list .outcome-num {
	background: #0f172a; color: #fbbf24;
	font-weight: 800; font-size: 11px;
	padding: 4px 8px; border-radius: 999px;
	white-space: nowrap;
}
.outcomes-list .outcome-title { font-weight: 700; font-size: 13px; color: #0f172a; }
.outcomes-list .outcome-subs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.outcomes-list .outcome-sub {
	background: #fff;
	border: 1px solid #e2e8f0;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 10.5px;
	color: #475569;
}

/* ── My Assessments backdrop hidden state matches shared modals ── */
#myExamPapersPanel.hidden { display: none !important; }
#myExamPapersPanel {
	position: fixed; inset: 0; z-index: 9000;
	background: rgba(10, 18, 40, 0.55);
	backdrop-filter: blur(6px);
	display: flex;
}

/* Reuse libnav-btn style for header chrome */
.icms-libnav-btn--ghost {
	background: rgba(255,255,255,0.1) !important;
	color: #fff !important;
	border: 1px solid rgba(255,255,255,0.2) !important;
}

/* ── Validation feedback ─────────────────────────────────────── */
/* Red ring + soft pulse so the missing field is impossible to
   miss. Auto-removed after 4 s, or as soon as the trainer types
   in the field. */
.exam-field-error,
.exam-app-container .field input.exam-field-error,
.exam-app-container .field select.exam-field-error {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18) !important;
	background: #fef2f2 !important;
	animation: exam-field-pulse 1.2s ease-out 2;
}
@keyframes exam-field-pulse {
	0%, 100% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18); }
	50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.10); }
}

/* Quick horizontal shake to draw attention to the panel that's
   still blocking the trainer (e.g. they tried to advance to
   "Preview & pay" without uploading a curriculum). */
.exam-panel-shake {
	animation: exam-panel-shake 0.42s ease-in-out;
}
@keyframes exam-panel-shake {
	0%, 100% { transform: translateX(0); }
	20%      { transform: translateX(-6px); }
	40%      { transform: translateX(5px); }
	60%      { transform: translateX(-3px); }
	80%      { transform: translateX(2px); }
}

/* ── Step indicator: completed state ─────────────────────────── */
/* When examGoToStep marks earlier steps "done" the trainer sees
   a clear forward-progress trail. */
.exam-step.done {
	background: #fbf2e3;
	border-color: #f7e7cf;
	color: #946b29;
}
.exam-step.done .exam-step-n {
	background: #d4a35a;
	color: #0a1228;
}
.exam-step.done .exam-step-n::before {
	content: "✓";
	font-size: 13px;
}
.exam-step.done .exam-step-n { font-size: 0; }
.exam-step.done .exam-step-n::before { font-size: 14px; }
