/*
 * Chaza look & feel — "Ndebele Spark".
 * Inspired by the bold geometric wall art of the amaNdebele: cream walls, thick black outlines and
 * blocks of gold, red, blue and green. Original pattern work (no copied artwork).
 * Mobile-first, no external dependencies, WCAG AA contrast targets, dark mode, reduced motion.
 */
:root {
  --bg: #fff8ec;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #5a5046;
  --line: #141414;
  --gold: #ffb612;
  --red: #de3831;
  --blue: #1e4fd8;
  --green: #0e8a5f;
  --gold-soft: #fff0cc;
  --blue-soft: #e5ecff;
  --red-soft: #ffe6e3;
  --green-soft: #ddf3ea;
  --brand: #141414;
  --brand-ink: #ffb612;
  --link: #1e4fd8;
  --ok-bg: #ddf3ea;
  --ok: #0a6b49;
  --wait-bg: #fff0cc;
  --wait: #6b4700;
  --bad-bg: #ffe6e3;
  --bad: #a3231d;
  --muted-bg: #f1ebe0;
  --radius: 16px;
  --border: 3px solid var(--line);
  --shadow: 4px 4px 0 var(--line);
  --focus: 0 0 0 3px var(--blue);
  --tabs-h: 66px;
  font-size: 17px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #211d19;
    --ink: #fff8ec;
    --muted: #c9bfb2;
    --line: #fff8ec;
    --gold-soft: #3a2e10;
    --blue-soft: #1b2544;
    --red-soft: #3d1a17;
    --green-soft: #12301f;
    --brand: #ffb612;
    --brand-ink: #141414;
    --link: #9db6ff;
    --ok-bg: #12301f;
    --ok: #8ee0b8;
    --wait-bg: #3a2e10;
    --wait: #ffd36b;
    --bad-bg: #3d1a17;
    --bad: #ffb0a8;
    --muted-bg: #2b2621;
    --shadow: 4px 4px 0 #ffb612;
    --focus: 0 0 0 3px #9db6ff;
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
a {
  color: var(--link);
  font-weight: 600;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Ndebele band (decoration) */
.band {
  height: 14px;
  border-top: var(--border);
  border-bottom: var(--border);
  background:
    linear-gradient(90deg, var(--line) 0 3px, transparent 3px) 0 0 / 36px 100%,
    linear-gradient(90deg, var(--gold) 0 25%, var(--red) 25% 50%, var(--blue) 50% 75%, var(--green) 75% 100%)
      0 0 / 144px 100%;
}

/* ---------------------------------------------------------------- Shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  max-width: 980px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 38px;
  height: 38px;
}
.practice-chip {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--gold);
  color: #141414;
}
.view {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--tabs-h) + 32px + env(safe-area-inset-bottom));
  outline: none;
}
.view:focus,
.view:focus-visible {
  box-shadow: none;
}
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: var(--border);
}
.tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
}
.tabs a span {
  font-size: 1.3rem;
  line-height: 1;
}
.tabs a[aria-current='page'] {
  color: var(--ink);
  background: var(--gold-soft);
  box-shadow: inset 0 -5px 0 var(--gold);
}
.offline {
  background: var(--red);
  color: #fff;
  padding: 8px 16px;
  font-weight: 800;
  text-align: center;
}
.loading {
  color: var(--muted);
  text-align: center;
  padding: 40px 0;
}

/* ---------------------------------------------------------------- Type */
h1 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
  font-weight: 900;
}
h2 {
  font-size: 1.2rem;
  margin: 26px 0 10px;
  font-weight: 900;
}
p {
  margin: 0 0 12px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.87rem;
}
.center {
  text-align: center;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------------------------------------------------------- Cards & lists */
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 14px 0;
}
.tiles {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}
.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 900;
  transition: transform 0.08s ease;
}
a.tile:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--line);
}
.tile small {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
}
.tile-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: var(--border);
  background: var(--gold);
  font-size: 1.6rem;
}
.tile-airtime .tile-icon {
  background: var(--blue);
}
.tile-data .tile-icon {
  background: var(--red);
}
.tile-electricity .tile-icon {
  background: var(--gold);
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list.card {
  padding: 4px 16px;
}
.list li + li {
  border-top: 2px dashed var(--muted-bg);
}
.row-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.row-link strong {
  display: block;
}
.row-link .right {
  text-align: right;
  flex: none;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.kv .total {
  font-size: 1.2rem;
  font-weight: 900;
  border-top: var(--border);
  padding-top: 8px;
}

/* ---------------------------------------------------------------- Status */
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 2px solid var(--line);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.tone-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.tone-wait {
  background: var(--wait-bg);
  color: var(--wait);
}
.tone-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.tone-muted {
  background: var(--muted-bg);
  color: var(--muted);
}
.status {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin: 12px 0;
}
.status h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}
.status p {
  margin: 0;
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
  a.tile {
    transition: none;
  }
}
.token {
  text-align: center;
  background: var(--gold);
  color: #141414;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin: 14px 0;
}
.token .muted {
  color: #3d3326;
}
.token-value {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 6px 0 10px;
  overflow-wrap: anywhere;
}
.token .btn-secondary {
  background: #fff;
  color: #141414;
  border-color: #141414;
}

/* ---------------------------------------------------------------- Forms */
label,
.label {
  display: block;
  font-weight: 800;
  margin: 18px 0 6px;
}
.hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.87rem;
}
input[type='text'],
input[type='email'],
input[type='password'],
input[type='tel'],
input[type='number'],
select {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 13px 14px;
  border-radius: 12px;
  border: var(--border);
  background: var(--surface);
  color: var(--ink);
}
input:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--gold);
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
}
.check input {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  flex: none;
  accent-color: var(--green);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips button {
  font: inherit;
  font-weight: 800;
  padding: 10px 16px;
  min-height: 48px;
  border-radius: 999px;
  border: var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.chips button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--gold);
}
.options {
  display: grid;
  gap: 10px;
}
.options button {
  font: inherit;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.options button[aria-pressed='true'] {
  background: var(--gold);
  color: #141414;
  box-shadow: var(--shadow);
}
.error {
  background: var(--bad-bg);
  color: var(--bad);
  border: 3px solid var(--red);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  font-weight: 800;
}
.notice {
  background: var(--blue-soft);
  border: var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 12px 20px;
  border-radius: 14px;
  border: var(--border);
  background: var(--gold);
  color: #141414;
  box-shadow: var(--shadow);
  font: inherit;
  font-weight: 900;
  font-size: 1.08rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--line);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-block {
  display: flex;
  width: 100%;
}
.stack {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.link-button {
  font: inherit;
  background: none;
  border: 0;
  color: var(--link);
  text-decoration: underline;
  padding: 8px 0;
  cursor: pointer;
}

/* ---------------------------------------------------------------- Public website */
.site {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}
.hero {
  display: grid;
  gap: 22px;
  align-items: center;
  padding: 18px 0 6px;
}
.hero h1 {
  font-size: clamp(2rem, 7vw, 3.2rem);
  margin: 0 0 10px;
}
.hero .lead {
  font-size: 1.15rem;
  color: var(--muted);
}
.hero-art {
  justify-self: center;
  width: min(300px, 70vw);
}
@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
  }
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 6px;
}
.grid3 {
  display: grid;
  gap: 16px;
}
@media (min-width: 760px) {
  .grid3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.price-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.price-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 2px dashed var(--muted-bg);
}
.steps {
  counter-reset: s;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps li {
  counter-increment: s;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.steps li::before {
  content: counter(s);
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: var(--border);
  background: var(--gold);
  color: #141414;
  font-weight: 900;
}
.legal h2 {
  margin-top: 28px;
}
.legal li {
  margin-bottom: 6px;
}
.site-footer {
  margin-top: 40px;
  background: var(--ink);
  color: var(--bg);
}
.site-footer .inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: grid;
  gap: 18px;
}
@media (min-width: 760px) {
  .site-footer .inner {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}
.site-footer a {
  color: var(--gold);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.pay-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pay-logos span {
  border: 2px solid currentColor;
  border-radius: 8px;
  padding: 2px 10px;
  font-weight: 800;
  font-size: 0.85rem;
}
.site-nav {
  display: flex;
  gap: 16px;
  align-items: center;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav .btn {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.95rem;
}
@media (max-width: 480px) {
  .site-nav .nav-extra {
    display: none;
  }
  .hero-art {
    width: 170px;
    order: -1;
  }
}

/* ---------------------------------------------------------------- Practice payment page */
.paypage {
  display: grid;
  place-items: center;
  padding: 16px;
}
.pay-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.practice-banner {
  background: var(--gold);
  color: #141414;
  font-weight: 800;
  border: var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

/* ---------------------------------------------------------------- Printable receipt */
.receipt-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}
.receipt-page table {
  width: 100%;
  border-collapse: collapse;
}
.receipt-page th,
.receipt-page td {
  text-align: left;
  padding: 6px 0;
  border-bottom: 2px dashed var(--muted-bg);
  vertical-align: top;
}
.receipt-page td {
  text-align: right;
  font-weight: 700;
}
.receipt-page .token {
  display: block;
}
.receipt-page .token-label {
  display: block;
}
.receipt-page .token-value {
  font-size: 1.4rem;
}
@media print {
  .no-print,
  .band {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  .token,
  .status {
    box-shadow: none;
  }
}
