/* ============================================================
   VoltUtility — light-first theme with dark toggle
   Design language: green ⚡ brand + receipt paper motif
   ============================================================ */

/* ---------- Light theme (default) ---------- */
:root {
  color-scheme: light;
  --bg: #eef1f6;
  --bg-glow: #ffffff;
  --panel: #ffffff;
  --card: #f5f7fa;
  --border: #e1e6ee;
  --border-strong: #c9d3e0;
  --text: #0b1526;
  --muted: #5a6b85;
  --accent: #16a34a;
  --accent-strong: #15803d;
  --accent-soft: rgba(22, 163, 74, 0.12);
  --accent-fg: #15803d;
  --green-glow: rgba(22, 163, 74, 0.5);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.14);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.1);
  --radius: 16px;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.07);
  --shadow-green: 0 16px 38px -20px rgba(22, 163, 74, 0.45);
  --header-bg: rgba(255, 255, 255, 0.78);
  --backdrop: rgba(30, 41, 59, 0.55);
  --zig-gap: #c7d1de;
  --receipt-stage-a: #12203a;
  --receipt-stage-b: #0a1122;
  --err-text: #b91c1c;
  --placeholder: #9aa8bd;
  --on-green: #06260f;
  --toggle-bg: #e8edf4;
}

/* ---------- Dark theme ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060a13;
  --bg-glow: #101a30;
  --panel: #0d1424;
  --card: #070d1a;
  --border: #1e2a44;
  --border-strong: #2b3a5c;
  --text: #e6ecf5;
  --muted: #8fa0b8;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent-fg: #4ade80;
  --green-glow: rgba(34, 197, 94, 0.55);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.35);
  --shadow-green: 0 18px 40px -18px rgba(34, 197, 94, 0.4);
  --header-bg: rgba(8, 13, 24, 0.72);
  --backdrop: rgba(3, 7, 17, 0.82);
  --zig-gap: #0b1220;
  --receipt-stage-a: #101b30;
  --receipt-stage-b: #070d1a;
  --err-text: #fca5a5;
  --placeholder: #41506b;
  --on-green: #052e16;
  --toggle-bg: #0d1424;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 560px at 50% -12%, var(--bg-glow) 0%, var(--bg) 58%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 18px 14px 52px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.modal-open { overflow: hidden; }

.container {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

button { font-family: inherit; }

/* ================= Header (sticky, responsive) ================= */
.app-header {
  position: sticky;
  top: 10px;
  z-index: 60;
  max-width: 960px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: 18px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 2px 6px 2px 2px;
  border-radius: 12px;
  text-align: left;
  outline: none;
}
.brand:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, var(--accent-strong));
  color: var(--on-green);
  font-weight: 900;
  font-size: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3), 0 8px 22px -8px var(--green-glow);
}
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-title { font-size: 17px; font-weight: 900; letter-spacing: 0.02em; line-height: 1.15; white-space: nowrap; }
.brand-sub {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.nav-pill,
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 15px;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.nav-pill:hover, .theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-pill:active, .theme-btn:active { transform: translateY(1px); }
.nav-pill:focus-visible, .theme-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.nav-ico { font-size: 13px; }
.theme-btn { width: 38px; padding: 0; }
.theme-btn svg { display: none; }

/* which icon shows depends on theme */
html[data-theme="light"] .theme-btn .icon-moon { display: block; }
html[data-theme="dark"] .theme-btn .icon-sun { display: block; }

/* ================= Panels & views ================= */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.hint { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.view { display: none; }
.view.active { display: block; animation: viewIn 0.26s ease; }
/* Keep the transaction card compact on wide screens — no stretched inputs/buttons */
#view-form .panel { max-width: 560px; margin: 0 auto; }
#view-provider .panel { max-width: 780px; margin: 0 auto; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= Payment step bar ================= */
.flowbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 9px 10px;
  box-shadow: var(--shadow-sm);
  margin-top: 2px;
}
.flow-back {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.flow-back:hover { border-color: var(--accent); color: var(--accent); }
.flow-back:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.steps { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }

.step {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 8px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.step:disabled { opacity: 0.45; cursor: not-allowed; }
.step:not(:disabled):hover { color: var(--accent); }
.step-n {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 10.5px;
  font-weight: 900;
  color: var(--muted);
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.step.cur { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-fg); }
.step.cur .step-n { background: linear-gradient(135deg, #22c55e, var(--accent-strong)); border: none; color: var(--on-green); }
.step.done { color: var(--accent-fg); }
.step.done .step-n { background: var(--accent); border: none; color: var(--on-green); }
.step-l { overflow: hidden; text-overflow: ellipsis; }

/* ================= Hero ================= */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  padding: 40px 36px 34px;
  overflow: hidden;
  position: relative;
  gap: 34px;
  background:
    radial-gradient(520px 260px at 90% -10%, var(--accent-soft) 0%, transparent 60%),
    var(--panel);
}
.hero-copy { position: relative; }
.hero { --hero-cta-w: 340px; }
.hero-actions .btn-primary { width: var(--hero-cta-w); max-width: 100%; }
.hero h2 { font-size: 40px; font-weight: 900; line-height: 1.06; letter-spacing: -0.028em; margin: 18px 0 0; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 24px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.hero-tags span { display: inline-flex; align-items: center; gap: 6px; }

/* Compact hero CTA card (replaces the tall decorative receipt) */
.hero-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  max-width: 100%;
  width: var(--hero-cta-w);
  justify-self: end;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  background:
    radial-gradient(240px 150px at 100% 0%, var(--accent-soft) 0%, transparent 62%),
    var(--panel);
  box-shadow: var(--shadow);
}
.cta-ico {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(150deg, var(--accent-soft) 0%, transparent 100%);
  border: 1px solid var(--accent);
  display: grid; place-items: center;
  font-size: 21px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hero-cta h3 { margin: 3px 0 0; font-size: 17px; font-weight: 900; letter-spacing: -0.015em; }
.hero-cta p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.hero-cta .btn-primary { margin-top: 6px; }
.cta-note { font-size: 11.5px; color: var(--muted); }
.receipt-stage {
  width: 340px;
  max-width: 100%;
  padding: 22px 10px 24px;
  border-radius: 20px;
  background: linear-gradient(165deg, var(--receipt-stage-a), var(--receipt-stage-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 22px 48px -18px rgba(2, 6, 16, 0.55);
}
.receipt-stage .receipt-wrap { width: 100%; padding: 0; }
.receipt-stage .receipt { transform: rotate(-1deg); }
.receipt-stage .zig { background-color: transparent; }

/* ================= Services ================= */
/* ============ Coming soon: iOS & Android apps ============ */
.apps-band {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding: 20px 24px;
}
.apps-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.apps-copy h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.015em; }
.apps-copy .hint { margin: 0; }
.apps-chip {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-fg);
}
.apps-badges { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.store-badge { display: block; width: auto; max-width: 100%; }
/* Official badge artwork is used unaltered; the sizes below keep the two marks
   visually equal (the Google asset carries 41px of built-in clear space). */
.store-badge.appstore { height: 48px; }
.store-badge.gplay { height: 71px; }
/* Black badges on the dark theme sit on a white plate — the artwork is untouched. */
html[data-theme="dark"] .store-badge { background: #fff; border-radius: 10px; padding: 4px 6px; }
@media (max-width: 760px) {
  .apps-band { flex-direction: column; align-items: flex-start; padding: 18px 18px; }
  .store-badge.appstore { height: 44px; }
  .store-badge.gplay { height: 65px; }
}

.services-head { text-align: center; padding: 15px; }
.services-head h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; }
.services-head p { font-size: 13px; color: var(--muted); margin-top: 7px; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.service-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-green);
}
.service-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.service-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(150deg, var(--accent-soft) 0%, transparent 100%);
  border: 1px solid var(--accent);
  font-size: 22px;
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.service-body { min-width: 0; }
.service-name { display: block; font-size: 14.5px; font-weight: 800; }
.service-desc { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.service-card .go {
  font-size: 16px; font-weight: 800; color: var(--accent);
  transition: transform 0.18s ease;
}
.service-card:hover .go { transform: translateX(4px); }

/* ================= Logo strip ================= */
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.logo-chip {
  width: 66px; height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  opacity: 0.92;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}
.logo-chip:hover { transform: translateY(-2px); opacity: 1; border-color: var(--accent); }
.logo-chip img {
  position: absolute;
  left: 8px; top: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  object-position: center center;
  display: block;
}

/* ================= Provider grid ================= */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.provider-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.provider-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}
.provider-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.provider-badge {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-fg);
  font-weight: 900;
  font-size: 10.5px;
  letter-spacing: -0.01em;
  display: grid; place-items: center;
  font-family: "Space Mono", monospace;
}
.provider-logo {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.provider-logo img {
  position: absolute;
  left: 6px; top: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
  object-position: center center;
  display: block;
}
.provider-text { min-width: 0; }
.pv-name { display: block; font-size: 13.5px; font-weight: 800; line-height: 1.35; }
.pv-area { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.provider-card.more {
  border-style: dashed;
  cursor: default;
  justify-content: center;
}
.provider-card.more:hover { border-color: var(--border); transform: none; box-shadow: none; }
.provider-card.more span { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }

/* ================= Plan chooser (data bundles / TV packages) ================= */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 15px;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.plan-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.plan-size { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.plan-meta { font-size: 11.5px; color: var(--muted); }
.plan-price { margin-top: 5px; font-family: "Space Mono", monospace; font-size: 13.5px; font-weight: 700; }
.plan-loading { font-size: 12.5px; color: var(--muted); padding: 10px 2px; }

/* ================= Forms ================= */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.field input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.field input::placeholder { color: var(--placeholder); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.invalid { border-color: var(--red); }
.field-note { font-size: 11px; color: var(--muted); }
.field .input-wrap { position: relative; }
.field .naira {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 800; font-size: 14px;
  pointer-events: none;
}
.field .naira + input { padding-left: 30px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.quick button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  min-height: 0;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.quick button.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-fg); }

/* ================= Buttons ================= */
button {
  border: none;
  border-radius: 12px;
  min-height: 46px;
  padding: 0 20px;
  background: linear-gradient(135deg, #22c55e, var(--accent-strong));
  color: var(--on-green);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.full { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  min-height: 46px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }

/* Secondary / tinted action — deliberately distinct from the primary CTA */
.btn-soft {
  background: var(--accent-soft);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  min-height: 46px;
  box-shadow: none;
}
.btn-soft:hover { filter: none; border-color: var(--accent-strong); background: var(--accent-soft); }
.btn-primary { min-height: 46px; padding: 0 24px; }

.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.actions button { flex: 0 0 auto; min-width: 134px; }
.actions button.full { flex: 1 1 100%; width: 100%; }

/* ================= Chips ================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.chip-green {
  background: var(--accent-soft);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
}
.chip-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber);
}
.chip-slate {
  background: #eef2f6;
  color: #4b5563;
  border: 1px solid #d6dce3;
  font-size: 10px;
}

/* ================= Transaction meta strip ================= */
.txn-customer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}
.txn-customer .muted { color: var(--muted); font-weight: 600; font-size: 12px; }

/* ================= Summary ================= */
.summary {
  margin-top: 18px;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), rgba(22, 163, 74, 0.03));
  border-radius: 14px;
  padding: 16px 18px;
}
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.receipt-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "Space Mono", monospace;
}
.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.summary-row span { color: var(--muted); }
.summary-row strong { font-weight: 800; word-break: break-word; text-align: right; }
.summary-row.total { padding: 10px 0 4px; font-size: 15px; }
.summary-row.total strong { color: var(--accent-fg); font-size: 21px; }
.summary-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }

.pay-label { display: inline-flex; align-items: center; gap: 8px; }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(6, 38, 15, 0.35);
  border-top-color: var(--on-green);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Error ================= */
.error {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--err-text);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

/* ================= Footer ================= */
.app-footer {
  max-width: 960px;
  margin: 34px auto 0;
  padding: 20px 4px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 22px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-name {
  font-family: "Space Mono", monospace;
  letter-spacing: 0.06em;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.footer-tag { font-size: 11px; line-height: 1.35; }
.footer-contacts { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-mail {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.footer-mail:hover { border-color: var(--accent); transform: translateY(-1px); }
.footer-mail .fm-label { font-size: 12px; font-weight: 800; letter-spacing: -0.005em; }
.footer-mail .fm-note {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-copy { font-size: 11px; }
.footer-docs {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.footer-docs:hover { border-color: var(--accent); transform: translateY(-1px); }
.footer-docs .fm-label { font-size: 12px; font-weight: 800; letter-spacing: -0.005em; }
.footer-docs .fm-note {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-footer .mono { font-family: "Space Mono", monospace; letter-spacing: 0.06em; }

/* ================= Modal ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 14px;
  overflow-y: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-body {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 470px;
  margin: auto;
  animation: popIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.modal-actions .btn-ghost { background: var(--panel); border: 1px solid var(--border); color: var(--text); }

/* ================= Receipt paper (fixed light paper, both themes) ================= */
.receipt-wrap {
  position: relative;
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  padding: 14px 0;
}
.receipt {
  position: relative;
  max-width: 470px;
  margin: 0 auto;
  background: #ffffff;
  color: #111827;
  font-family: "Space Mono", "Courier New", Courier, monospace;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 18px 46px rgba(2, 6, 16, 0.32);
}

/* Torn-paper zig-zag edges — white teeth PNG, themed gap colour */
.zig {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  pointer-events: none;
  background-color: var(--zig-gap);
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAMCAYAAAADFL+5AAAAPklEQVR42sXOOQ4AIAzEwPz/04aSAnEtyU5vyREbdCFQe+8Ag/KeicreO8BCes+BtJ4LGb13gAffegRyj1kDKaUFJnKnvWsAAAAASUVORK5CYII=");
  background-repeat: repeat-x;
  background-size: 32px 12px;
}
.zig-top { top: 2px; }
.zig-bottom { bottom: 2px; transform: rotate(180deg); }

.receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 2px dashed #d1d5db;
}
.receipt-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.receipt-brand .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 15px;
  border-radius: 8px;
  box-shadow: none;
}
.receipt-title-text { display: block; font-size: 16px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.receipt-sub-text {
  display: block;
  font-size: 9px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  white-space: nowrap;
}
.receipt .chip { font-size: 10px; }

.receipt-amount { padding: 18px 22px 4px; text-align: center; }
.receipt-amount .label { color: #9ca3af; }
.receipt-amount .amount {
  font-size: 28px; font-weight: 700; color: #111827;
  letter-spacing: 0.01em; line-height: 1.25; word-break: break-word;
}

/* VAT breakdown on the paper receipt */
.receipt-lines {
  margin: 10px 22px 0;
  padding: 11px 0;
  border-top: 1px dashed #d1d5db;
  border-bottom: 1px dashed #d1d5db;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.receipt-lines .line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}
.receipt-lines .line .v {
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #111827;
  white-space: nowrap;
}
.receipt-lines .line.vat .v { color: #b45309; }

.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  padding: 14px 22px 12px;
}
.receipt-grid .label { color: #9ca3af; font-size: 9px; }
.receipt-grid .value { font-size: 13px; font-weight: 700; color: #111827; word-break: break-word; }

.receipt-address { padding: 2px 22px 14px; }
.receipt-address .label { color: #9ca3af; font-size: 9px; display: block; margin-bottom: 3px; }
.receipt-address .value { font-size: 12.5px; font-weight: 700; color: #111827; line-height: 1.5; display: block; }

.token-strip,
.notice-strip {
  margin: 6px 22px 18px;
  padding: 13px 16px;
  border: 1px dashed;
  border-radius: 8px;
}
.token-strip { background: #f0faf4; border-color: #86c9a3; }
.token-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #15803d;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.token {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #14532d;
  text-align: left;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.notice-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffbeb;
  border-color: #fcd34d;
  margin-top: 16px;
  margin-bottom: 2px;
}
.notice-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.notice-strip strong {
  display: block;
  color: #b45309;
  font-size: 14px;
  line-height: 1.45;
}
.notice-sub {
  display: block;
  color: #92703a;
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.45;
}

.receipt-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 22px;
  border-top: 2px dashed #d1d5db;
  font-size: 10px;
  color: #6b7280;
}

.label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
}

/* ================= Responsive ================= */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-cta { justify-self: start; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { padding: 14px 12px 56px; }
  /* 16px+ inputs: anything smaller makes iOS/Android zoom the whole screen on focus */
  .field input, .field select, .find-row input, .find-row select, input, select, textarea { font-size: 16px; }
  .app-header { top: 8px; padding: 10px 12px; }
  .brand-mark { width: 38px; height: 38px; font-size: 17px; }
  .brand-title { font-size: 16px; }
  .brand-sub { max-width: 150px; }
  .hero { padding: 32px 24px 30px; gap: 28px; --hero-cta-w: 100%; }
  .hero h2 { font-size: 30px; line-height: 1.12; margin: 14px 0 0; }
  .hero-actions { margin-top: 22px; gap: 10px; }
  .hero-actions .btn-primary { width: 100%; }
  .hero-tags { margin-top: 20px; gap: 6px 12px; }
  .hero-cta { padding: 22px; gap: 13px; max-width: 100%; }
  .hero-cta h3 { font-size: 16px; }
  .cta-ico { width: 46px; height: 46px; font-size: 20px; }
  .services-head { padding: 20px 15px 14px; }
  .provider-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brand-sub { display: none; }
  .hero-tags { display: none; }
  .hero { padding: 28px 20px 26px; gap: 24px; }
  .hero h2 { font-size: 27px; }
  .nav-label { display: none; }
  .nav-pill { width: 46px; padding: 0; }
  .theme-btn { width: 46px; }
  .logo-chip { width: 58px; height: 46px; padding: 7px; }
  .logo-strip { gap: 8px; padding: 2px 4px 14px; }
  .service-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .provider-grid { grid-template-columns: 1fr; }
  .receipt-grid { grid-template-columns: 1fr; }
  .receipt-amount .amount { font-size: 24px; }
  .token { font-size: 16px; letter-spacing: 0.06em; }
  .step-l { display: none; }
  .step { gap: 0; }
  .step-n { width: 24px; height: 24px; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions button { width: 100%; }
  .app-footer { flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 20px 0 0; }
  .footer-brand { align-items: center; }
  .footer-contacts { flex-direction: column; width: 100%; }
  .footer-mail { align-items: center; }
}

/* ---------- Find-a-receipt modal ---------- */
.find-body { max-width: 540px; }
.find-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.find-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
/* Once a receipt is on screen only the receipt + close button remain */
.find-card.result-only .find-head { justify-content: flex-end; margin-bottom: 8px; }
.find-card.result-only .find-head-text,
.find-card.result-only .find-row,
.find-card.result-only #findError { display: none; }
.find-head h3 { font-size: 17px; font-weight: 900; }
.find-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.find-sub .mono { font-family: "Space Mono", monospace; }
.find-x {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  min-height: 0;
  border-radius: 8px;
}
.find-x:hover { color: var(--accent); filter: none; }
.find-row { display: flex; gap: 10px; }
.find-row input {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-family: "Space Mono", "Courier New", monospace;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.find-row input::placeholder { color: var(--placeholder); text-transform: none; }
.find-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.find-row .btn-primary { min-height: 46px; white-space: nowrap; }
.find-result { margin-top: 18px; }
.find-result .receipt-stage {
  width: 100%;
  padding: 20px 14px;
  border-radius: 18px;
  background: linear-gradient(165deg, var(--receipt-stage-a), var(--receipt-stage-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 22px 48px -18px rgba(2, 6, 16, 0.55);
}
.find-result .receipt-wrap { width: 100%; padding: 0; }
.find-result .zig { background-color: transparent; }
.find-result .receipt { transform: none; }
@media (max-width: 520px) {
  .find-row { flex-direction: column; }
  .find-row .btn-primary { width: 100%; }
}

/* ---------- Service-unavailable notice modal ---------- */
.notice-body { max-width: 440px; }
.notice-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.notice-icon {
  font-size: 38px;
  line-height: 1;
  display: block;
  margin-bottom: 14px;
}
.notice-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.notice-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  max-width: 34ch;
}
.notice-body .modal-actions { margin-top: 14px; }

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .app-header, .flowbar, .modal-backdrop, .modal-actions, .app-footer { display: none !important; }
}
