/* ════════════════════════════════════════════════════════════════════
   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; }
.exam-app-container { padding-top: 24px !important; }

/* ── Step indicator ───────────────────────────────────────────── */
.exam-steps {
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
	flex-wrap: wrap;
	font-family: var(--font-body, 'Plus Jakarta Sans'), system-ui, sans-serif;
}
.exam-step {
	flex: 1 1 180px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: #fff;
	border: 1.5px solid #e2e8f0;
	border-radius: 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: #64748b;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease, transform .12s ease;
}
/* Switchable tabs — clear affordance that a step can be clicked. The
   active/done states still win because they're defined after this. */
.exam-step:hover {
	border-color: #c7b3f5;
	color: #4c1d95;
	box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
}
.exam-step:focus-visible {
	outline: 2px solid #7c3aed;
	outline-offset: 2px;
}
.exam-step.active:hover { color: #fbbf24; }
.exam-step .exam-step-n {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f1f5f9;
	color: #64748b;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 12px;
}
.exam-step.active {
	background: #0f172a;
	border-color: #0f172a;
	color: #fbbf24;
}
.exam-step.active .exam-step-n {
	background: #fbbf24;
	color: #0f172a;
}

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

/* ── Mode + paper-count choice cards ─────────────────────────── */
.exam-choice-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 24px;
	row-gap: 18px;
	margin-top: 26px;
}
@media (max-width: 1024px) { .exam-choice-row { grid-template-columns: 1fr; } }

.exam-choice-block { background: #fff; }
.exam-choice-title {
	font-size: 12px;
	font-weight: 800;
	color: #1e293b;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.exam-choice-title i { color: #c08833; }
.exam-choice-title .required { color: #dc2626; }
.exam-choice-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 12px;
}
.exam-choice-block:nth-child(1) .exam-choice-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) {
	.exam-choice-grid { grid-template-columns: 1fr !important; }
}

.exam-choice-card {
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, transform .1s ease;
	background: #fff;
	display: flex;
	gap: 10px;
	align-items: flex-start;
}
.exam-choice-card:hover { border-color: #94a3b8; }
.exam-choice-card input[type="radio"] { margin-top: 3px; accent-color: #c08833; }
.exam-choice-card-body { flex: 1; min-width: 0; }
.exam-choice-card-title {
	font-size: 13.5px;
	font-weight: 800;
	color: #0f172a;
	margin-bottom: 4px;
}
.exam-choice-card-sub {
	font-size: 11.5px;
	color: #475569;
	line-height: 1.4;
}
.exam-choice-card:has(input[type="radio"]:checked) {
	border-color: #c08833;
	background: #fffaf2;
	box-shadow: 0 0 0 3px rgba(212, 163, 90, 0.15);
}

/* ── 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: #c7d2fe; background: #f5f3ff; }
.exam-cta-card--pay   { border-color: #fde68a; background: #fffbeb; }
.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: #ecfdf5;
	border-color: #6ee7b7;
	color: #047857;
}
.exam-step.done .exam-step-n {
	background: #10b981;
	color: #fff;
}
.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; }
