/* Dark theme + yellow navbar */

:root {
  --bg-page: #0c1017;
  --bg-muted: #151b26;
  --bg-elevated: #1a2230;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #2d3748;
  --card-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --header-border: rgba(0, 0, 0, 0.2);
  --nav-yellow: #facc15;
  --nav-yellow-hover: #eab308;
  --nav-text: #0f172a;
  --accent-green: #22c55e;
  --accent-green-hover: #16a34a;
  --tile-active-ring: #facc15;
  --focus-ring: rgba(250, 204, 21, 0.35);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --radius-card: 14px;
  --radius-field: 10px;
  --radius-hero: 12px;
  --max-w: 520px;
  --buy-grey: #64748b;
  --buy-grey-hover: #475569;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.5;
  padding-bottom: 5.5rem;
}

body.is-service {
  padding-bottom: 5.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--nav-yellow);
  color: var(--nav-text);
  font-weight: 600;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
}

/* —— App header: yellow bar (dashboard + service) —— */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--nav-yellow);
  border-bottom: 1px solid var(--header-border);
  color: var(--nav-text);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.app-header--service {
  background: var(--nav-yellow);
  border-bottom-color: var(--header-border);
  color: var(--nav-text);
}

.app-header__left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.nav-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -0.25rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.nav-back:hover {
  background: rgba(0, 0, 0, 0.08);
}
.app-header--service .nav-back:hover {
  background: rgba(0, 0, 0, 0.08);
}

.app-header__brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: inherit;
}
.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}
.app-header--service .menu-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
}

.menu-bars {
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 45;
}
.drawer-backdrop[hidden] {
  display: none;
}

.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 88vw);
  height: 100%;
  background: var(--bg-elevated);
  z-index: 50;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  padding: 1rem 1.25rem;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s ease, visibility 0.22s;
  color: var(--text);
}
.site-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.drawer-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.drawer-close {
  border: 1px solid var(--border);
  background: var(--bg-page);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}

.drawer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.drawer-links a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.drawer-links a:hover {
  color: var(--nav-yellow);
}

/* —— Dashboard —— */
.view-dashboard[hidden] {
  display: none;
}

.dash-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
}

.dash-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 4.5vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.dash-notice {
  margin: 0 0 1.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
  padding: 0 0.25rem;
}

.dash-pin {
  margin-right: 0.15rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 0.85rem;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-elevated);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  font: inherit;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.dash-tile:hover {
  border-color: #475569;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}
.dash-tile:focus-visible {
  outline: 2px solid var(--tile-active-ring);
  outline-offset: 2px;
}

.dash-tile__art {
  flex: 1;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dash-tile__label {
  display: block;
  width: 100%;
  padding: 0.65rem 0.5rem;
  background: var(--bg-muted);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
}
.dash-tile__label u {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.dash-tile__art--airtime {
  background: #1e293b;
}
.art-airtime-word {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.art-airtime-circles {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.mini-circ {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.mini-circ--red {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}
.mini-circ--yellow {
  background: linear-gradient(135deg, #facc15, #ca8a04);
}
.mini-circ--tele {
  background: linear-gradient(135deg, #dc2626, #991b1b);
}

.dash-tile__art--mtn {
  background: #ffcb00;
}
.art-mtn-oval {
  background: #1a1a1a;
  color: #ffcb00;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
}

.dash-tile__art--at-ishare {
  background: #0c1e3c;
  justify-content: flex-end;
  padding-bottom: 0.35rem;
}
.art-at-word {
  color: #fff;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  margin-bottom: auto;
  margin-top: 0.85rem;
}
.art-at-wave {
  display: block;
  width: 100%;
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    #e11d48,
    #e11d48 6px,
    #be123c 6px,
    #be123c 12px
  );
}

.dash-tile__art--at-bigtime {
  background: linear-gradient(135deg, #1d4ed8 50%, #dc2626 50%);
}
.art-bigtime-at {
  color: #fff;
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.dash-tile__art--telecel {
  background: #2a1518;
  gap: 0.15rem;
}
.art-tel-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e11d48;
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-tel-sub {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fca5a5;
}

.dash-tile__art--checker {
  background: #0f2418;
  gap: 0.2rem;
}
.art-check-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #22c55e;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-check-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #86efac;
}

.dash-tile__art--afa {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 45%, #312e81 100%);
  gap: 0.35rem;
}
.art-afa-badge {
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1;
}
.art-afa-caption {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.wrap-help,
.wrap-footer {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.help-block {
  margin-top: 0.5rem;
  padding: 1.25rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.help-block__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.help-block__text {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.btn-outline {
  display: inline-flex;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.btn-outline:hover {
  border-color: var(--nav-yellow);
  color: var(--nav-yellow);
}

.site-footer {
  margin-top: 1rem;
  padding-bottom: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.site-footer p {
  margin: 0;
}

/* —— Service detail view —— */
.view-service[hidden] {
  display: none;
}

.view-service {
  background: var(--bg-page);
  padding: 1.25rem 1rem 2rem;
}

.service-screen {
  max-width: 400px;
  margin: 0 auto;
}

.service-hero {
  width: min(220px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  border-radius: var(--radius-hero);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.service-hero__inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Hero inner reuses tile art layout */
.service-hero__inner.hero--airtime {
  background: #1e293b;
}
.service-hero__inner.hero--mtn {
  background: #ffcb00;
}
.service-hero__inner.hero--at-ishare {
  background: #0c1e3c;
  justify-content: flex-end;
  padding-bottom: 0.5rem;
}
.service-hero__inner.hero--at-bigtime {
  background: linear-gradient(135deg, #1d4ed8 50%, #dc2626 50%);
}
.service-hero__inner.hero--telecel {
  background: #2a1518;
  gap: 0.35rem;
}
.service-hero__inner.hero--checker {
  background: #0f2418;
  gap: 0.35rem;
}
.service-hero__inner.hero--afa {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 45%, #312e81 100%);
  gap: 0.35rem;
}

.service-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.service-price {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.service-block {
  margin-bottom: 1.15rem;
}

.bundle-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  background: var(--bg-elevated);
}

.bundle-price-row__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.data-size-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.data-size-price:not(:empty) {
  color: var(--nav-yellow);
}

.data-size-price:empty::before {
  content: "—";
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.service-section-label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.service-section-label--spaced {
  margin-top: 0.85rem;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

#afa-grid {
  grid-template-columns: repeat(2, 1fr);
}
#afa-grid .size-btn {
  font-size: 0.72rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.size-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  min-height: 40px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.size-btn:hover {
  border-color: #64748b;
}
.size-btn.is-selected {
  border-color: var(--nav-yellow);
  background: rgba(250, 204, 21, 0.12);
  box-shadow: inset 0 0 0 1px var(--nav-yellow);
}

/* Network-specific hover/selected color on data bundle chips */
.view-service[data-network-theme="mtn"] #size-grid .size-btn:hover,
.view-service[data-network-theme="mtn"] #size-grid .size-btn.is-selected {
  border-color: #facc15;
}
.view-service[data-network-theme="mtn"] #size-grid .size-btn.is-selected {
  background: rgba(250, 204, 21, 0.12);
  box-shadow: inset 0 0 0 1px #facc15;
}

.view-service[data-network-theme="telecel"] #size-grid .size-btn:hover,
.view-service[data-network-theme="telecel"] #size-grid .size-btn.is-selected {
  border-color: #ef4444;
}
.view-service[data-network-theme="telecel"] #size-grid .size-btn.is-selected {
  background: rgba(239, 68, 68, 0.14);
  box-shadow: inset 0 0 0 1px #ef4444;
}

.view-service[data-network-theme="airteltigo"] #size-grid .size-btn:hover,
.view-service[data-network-theme="airteltigo"] #size-grid .size-btn.is-selected {
  border-color: #3b82f6;
}
.view-service[data-network-theme="airteltigo"] #size-grid .size-btn.is-selected {
  background: rgba(59, 130, 246, 0.14);
  box-shadow: inset 0 0 0 1px #3b82f6;
}

.checker-row {
  margin-bottom: 0;
}

.service-select {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-field);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.service-phone-wrap {
  margin-bottom: 1rem;
}

.beneficiary-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.req {
  color: #dc2626;
  font-weight: 700;
}

.service-input {
  width: 100%;
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-field);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}
.service-input::placeholder {
  color: var(--text-muted);
  text-transform: lowercase;
}
.service-input:focus {
  outline: none;
  border-color: var(--nav-yellow);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-buy {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: var(--radius-field);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--buy-grey);
  cursor: pointer;
}
.btn-buy:hover {
  background: var(--buy-grey-hover);
}
.btn-buy:focus-visible {
  outline: 2px solid var(--nav-yellow);
  outline-offset: 2px;
}

/* —— FAB —— */
.fab-ai {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem 0.65rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: var(--accent-green);
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35);
}
.fab-ai:hover {
  background: var(--accent-green-hover);
}
.fab-ai:focus-visible {
  outline: 2px solid var(--nav-yellow);
  outline-offset: 2px;
}
.fab-ai__icon {
  flex-shrink: 0;
}

.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(340px, calc(100% - 2rem));
  padding: 0.75rem 1rem;
  border-radius: var(--radius-field);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  z-index: 60;
  box-shadow: var(--card-shadow);
}
.toast[hidden] {
  display: none;
}

@media (min-width: 640px) {
  .dash-main {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .dash-tile__art {
    min-height: 120px;
  }
}
