/* =========================================================================
   Page-level compositions: hero, pricing, vouchers, the WAEC hand-off modal,
   receipts and charts.
   ========================================================================= */

/* ---- hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding: var(--space-16) 0 var(--space-20);
  background-image: var(--gradient-mesh);
  overflow: hidden;
}
@media (min-width: 768px) { .hero { padding: var(--space-24) 0; } }

.hero-inner { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 992px) { .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); } }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
}
.hero-eyebrow svg { width: 15px; height: 15px; color: var(--gold-600); }

.hero-title {
  margin-top: var(--space-5);
  font-size: var(--text-4xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero-text {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--text-muted);
  max-width: 54ch;
}
.hero-cta { margin-top: var(--space-8); display: flex; gap: var(--space-3); flex-wrap: wrap; }

.hero-trust {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  align-items: center;
}
.hero-trust-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.hero-trust-item svg { width: 17px; height: 17px; color: var(--success-500); flex: none; }

/* The floating preview card in the hero. */
.hero-visual { position: relative; }
.hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  z-index: 1;
}
.hero-card-glow {
  position: absolute;
  inset: -18% -12%;
  background: var(--gradient-brand);
  filter: blur(72px);
  opacity: 0.2;
  border-radius: 50%;
  z-index: 0;
}

.hero-steps { display: grid; gap: var(--space-3); }
.hero-step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.hero-step-num {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  flex: none;
}
.hero-step.is-final .hero-step-num { background: var(--success-500); }

/* ---- section scaffolding ------------------------------------------------ */
.section { padding: var(--space-16) 0; }
@media (min-width: 768px) { .section { padding: var(--space-20) 0; } }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 62ch; margin-bottom: var(--space-10); }
.section-head.is-centered { margin-inline: auto; text-align: center; }
.section-eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-brand);
}
.section-title { margin-top: var(--space-2); font-size: var(--text-3xl); }
.section-text { margin-top: var(--space-4); font-size: var(--text-lg); color: var(--text-muted); line-height: var(--leading-loose); }

/* ---- feature cards ------------------------------------------------------ */
.feature {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: var(--brand-50);
  color: var(--brand-600);
  margin-bottom: var(--space-4);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-title { font-size: var(--text-md); font-weight: var(--weight-bold); }
.feature-text { margin-top: var(--space-2); color: var(--text-muted); line-height: var(--leading-normal); }

/* ---- step list ---------------------------------------------------------- */
.steps { display: grid; gap: var(--space-6); counter-reset: step; }
@media (min-width: 768px) { .steps-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); } }

.step { position: relative; padding-left: var(--space-16); counter-increment: step; }
.steps-row .step { padding-left: 0; }
.step::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: #fff;
  font-weight: var(--weight-black);
  font-size: var(--text-lg);
  box-shadow: var(--shadow-brand);
}
.steps-row .step::before { position: static; margin-bottom: var(--space-4); }
.step-title { font-size: var(--text-md); font-weight: var(--weight-bold); }
.step-text { margin-top: var(--space-2); color: var(--text-muted); }

/* ---- product / pricing card -------------------------------------------- */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.product-card.is-featured { border-color: var(--brand-400); box-shadow: var(--shadow-lg); }

.product-head {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--brand-50), transparent);
}
.product-exam {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--brand-600);
}
.product-name { margin-top: var(--space-2); font-size: var(--text-xl); font-weight: var(--weight-black); }
.product-desc { margin-top: var(--space-2); font-size: var(--text-base); color: var(--text-muted); }

.product-body { padding: var(--space-6); flex: 1; display: flex; flex-direction: column; }

/*  The price breakdown.
    The voucher cost and OUR fee are always two separate lines. A student
    should never be able to come away believing the platform fee is a WAEC
    charge, so the layout makes the split unavoidable. */
.price-breakdown {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-base);
}
.price-line dt { color: var(--text-muted); }
.price-line dd { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.price-line-note { font-size: var(--text-xs); color: var(--text-subtle); }

.price-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-strong);
}
.price-total dt { font-weight: var(--weight-bold); }
.price-total dd {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.product-features { margin-top: var(--space-5); display: grid; gap: var(--space-2); }
.product-feature { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-base); color: var(--text-muted); }
.product-feature svg { width: 17px; height: 17px; color: var(--success-500); flex: none; margin-top: 3px; }

.product-foot { padding: var(--space-6); padding-top: 0; }

.stock-pill {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

/* ---- voucher card ------------------------------------------------------- */
.voucher {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.voucher:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.voucher.is-used   { opacity: 0.78; }
.voucher.is-void   { opacity: 0.6; }

.voucher-top {
  padding: var(--space-5);
  background: var(--ink-900);
  background-image: var(--gradient-mesh);
  color: #fff;
}
.voucher-top .voucher-exam {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: rgba(255, 255, 255, 0.62);
}
.voucher-product { margin-top: var(--space-1); font-size: var(--text-lg); font-weight: var(--weight-bold); color: #fff; }

/* The perforation between the stub and the body - a small piece of physical
   metaphor that makes a digital voucher read as a voucher. */
.voucher-perf {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--border);
}
.voucher-perf::before, .voucher-perf::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
}
.voucher-perf::before { left: -11px; }
.voucher-perf::after  { right: -11px; }

.voucher-body { padding: var(--space-5); flex: 1; display: grid; gap: var(--space-4); }

.voucher-field { display: grid; gap: var(--space-1); }
.voucher-field-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-subtle);
}
.voucher-value {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  word-break: break-all;
}
.voucher-value.is-hidden { color: var(--text-subtle); letter-spacing: 0.28em; }

.voucher-foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.voucher-foot .btn { flex: 1 1 auto; }

.voucher-meta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* =========================================================================
   The official WAEC hand-off modal
   The single most sensitive surface in the product. Its job is to make it
   unmistakable that the student is leaving this platform for WAEC's own
   service - which is why the destination host is printed in full, and why
   the disclosure sits above the button rather than in small print below it.
   ========================================================================= */

.waec-modal .modal-header {
  background: var(--ink-900);
  background-image: var(--gradient-mesh);
  border-bottom: 0;
  color: #fff;
}
.waec-modal .modal-title { color: #fff; }
.waec-modal .modal-close { color: rgba(255, 255, 255, 0.7); }
.waec-modal .modal-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.waec-official {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--gold-300);
}
.waec-official svg { width: 14px; height: 14px; }

.waec-destination {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  word-break: break-all;
}
.waec-destination svg { width: 18px; height: 18px; color: var(--success-500); flex: none; }

.waec-frame {
  width: 100%;
  height: min(70dvh, 720px);
  border: 0;
  background: var(--bg-sunken);
  display: block;
}

.waec-checklist { display: grid; gap: var(--space-3); }
.waec-checklist li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-base); }
.waec-checklist svg { width: 18px; height: 18px; color: var(--brand-500); flex: none; margin-top: 2px; }

/* ---- receipt ------------------------------------------------------------ */
.receipt {
  max-width: 720px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.receipt-head {
  padding: var(--space-8);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.receipt-body { padding: var(--space-8); }
.receipt-rows { display: grid; gap: var(--space-3); }
.receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.receipt-row:last-child { border-bottom: 0; }
.receipt-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 2px solid var(--text);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
}
.receipt-foot {
  padding: var(--space-6) var(--space-8);
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}
.receipt-stamp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--success-500);
  border-radius: var(--radius-sm);
  color: var(--success-600);
  font-weight: var(--weight-black);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  transform: rotate(-2deg);
}

/* ---- charts (inline SVG, no library) ------------------------------------ */
.chart { width: 100%; overflow: hidden; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-area { fill: url(#chartGradient); }
.chart-line { fill: none; stroke: var(--brand-500); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-alt { stroke: var(--gold-500); stroke-dasharray: 5 4; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-subtle); font-size: 10px; font-family: var(--font-sans); }
.chart-dot { fill: var(--surface); stroke: var(--brand-500); stroke-width: 2.5; }
.chart-bar { fill: var(--brand-500); rx: 3; transition: fill var(--duration-fast) var(--ease-out); }
.chart-bar:hover { fill: var(--brand-700); }

.chart-legend { display: flex; gap: var(--space-5); flex-wrap: wrap; font-size: var(--text-sm); color: var(--text-muted); }
.chart-legend-item { display: flex; align-items: center; gap: var(--space-2); }
.chart-legend-swatch { width: 12px; height: 3px; border-radius: var(--radius-pill); background: var(--brand-500); }
.chart-legend-swatch.alt { background: var(--gold-500); }

/* ---- FAQ ---------------------------------------------------------------- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.faq-item[open] { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  cursor: pointer;
  list-style: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: "";
  width: 11px; height: 11px;
  border-right: 2.2px solid var(--text-muted);
  border-bottom: 2.2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-base) var(--ease-spring);
  flex: none;
  margin-top: -4px;
}
.faq-item[open] .faq-question::after { transform: rotate(-135deg); margin-top: 3px; }
.faq-answer {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-muted);
  line-height: var(--leading-loose);
  animation: fade-up var(--duration-base) var(--ease-out) both;
}

/* ---- CTA band ----------------------------------------------------------- */
.cta-band {
  position: relative;
  padding: var(--space-16) var(--space-8);
  border-radius: var(--radius-2xl);
  background: var(--ink-900);
  background-image: var(--gradient-mesh);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.cta-band h2 { color: #fff; font-size: var(--text-3xl); }
.cta-band p { color: rgba(255, 255, 255, 0.74); max-width: 56ch; margin: var(--space-4) auto 0; font-size: var(--text-lg); }

/* ---- legal / prose ------------------------------------------------------ */
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-4); font-size: var(--text-xl); }
.prose h3 { margin-top: var(--space-6); margin-bottom: var(--space-3); font-size: var(--text-md); }
.prose p { margin-bottom: var(--space-4); line-height: var(--leading-loose); color: var(--text-muted); }
.prose ul { margin: 0 0 var(--space-4) var(--space-5); list-style: disc; color: var(--text-muted); }
.prose li { margin-bottom: var(--space-2); line-height: var(--leading-normal); }
.prose strong { color: var(--text); font-weight: var(--weight-semibold); }

/* ---- support thread ----------------------------------------------------- */
.thread { display: grid; gap: var(--space-4); }
.thread-message {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 88%;
}
.thread-message.is-staff {
  margin-left: auto;
  background: var(--brand-50);
  border-color: var(--brand-200);
}
.thread-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.thread-body { white-space: pre-wrap; line-height: var(--leading-normal); word-break: break-word; }

/* ---- key/value list ----------------------------------------------------- */
.kv { display: grid; gap: var(--space-3); }
.kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: var(--space-4);
  align-items: baseline;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-key { font-size: var(--text-sm); color: var(--text-muted); }
.kv-val { font-weight: var(--weight-medium); word-break: break-word; }
@media (max-width: 520px) {
  .kv-row { grid-template-columns: 1fr; gap: var(--space-1); }
}

/* Admin article editor: writing surface plus a settings rail. */
.article-editor {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 1100px) {
  .article-editor { grid-template-columns: minmax(0, 1fr) 22rem; }
}
.article-editor .textarea.mono { font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.65; }

/* Media library grid. */
.media-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.media-item {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.media-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-sunken);
}
.media-item figcaption { display: grid; gap: var(--space-2); padding: var(--space-3); }
.media-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}
