/* ============================================================
   DataFlexGH design tokens

   Color   ink #17261F (warm charcoal-green, not flat black)
           paper #FAF6EE (warm sand, not cold grey)
           gold #E3A008 (kente-gold - the ONE bold accent, spent
                         only on commit/confirm moments: Buy Now,
                         Place Order, success states)
           clay #B24A2B (failure/danger - warm terracotta, not
                         stock bootstrap red)
           line #E4DCC8 (warm sand-grey hairline, not cold grey)
   Type    Display: Space Grotesk 600 (headlines only - one
                     weight, one file, kept small on purpose:
                     the person loading this page is about to
                     spend their own data to buy more data)
           Body: system font stack (no extra network request)
   Principle: brand colors on network cards are real information
              (telco recognition), not decoration - everything
              else around them stays quiet. One accent color,
              spent deliberately. The loading state reuses the
              header's own signal-bar mark instead of a generic
              spinner - the one on-brand animated moment.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600&display=swap');

:root {
  --ink: #17261f;
  --ink-soft: #223328;
  --paper: #faf6ee;
  --bg: #f2ecdd;
  --muted: #6b6355;
  --line: #e4dcc8;
  --gold: #e3a008;
  --gold-ink: #4a3200;
  --success: #1f7a4d;
  --danger: #b24a2b;
  --radius: 16px;
  --maxw: 480px;
  --display-font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; }

.topbar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.topbar .brand .bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.topbar .brand .bars span {
  width: 3px;
  background: var(--gold);
  display: block;
}
.topbar .brand .bars span:nth-child(1) { height: 30%; }
.topbar .brand .bars span:nth-child(2) { height: 55%; }
.topbar .brand .bars span:nth-child(3) { height: 75%; }
.topbar .brand .bars span:nth-child(4) { height: 100%; }

.topbar .menu-icon {
  width: 24px;
  height: 18px;
  position: relative;
}
.topbar .menu-icon span,
.topbar .menu-icon::before,
.topbar .menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}
.topbar .menu-icon::before { top: 0; }
.topbar .menu-icon span { top: 8px; }
.topbar .menu-icon::after { bottom: 0; }

main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 18px 60px;
}

.hero-title {
  font-family: var(--display-font);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 4px 0 6px;
  color: var(--ink);
}

.hero-sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.network-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.network-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(23, 38, 31, 0.14);
  border: none;
  cursor: pointer;
  isolation: isolate;
}

/* Subtle diagonal texture unique to each brand block - tactile
   richness without needing image assets. */
.network-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0px,
    rgba(255, 255, 255, 0.08) 2px,
    transparent 2px,
    transparent 14px
  );
  z-index: 0;
}

.network-card .label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  z-index: 1;
}

.network-card .mark {
  font-weight: 800;
  font-size: 1.05rem;
  padding: 10px 18px;
  border-radius: 999px;
  text-align: center;
  z-index: 1;
}

.help-block {
  text-align: center;
  margin-top: 40px;
}
.help-block h3 {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.help-block p {
  color: var(--muted);
  margin: 0;
}

.whatsapp-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  font-size: 1.4rem;
}

/* ---- Bundle / banner ---- */

.network-banner {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: -1px;
  isolation: isolate;
}
.network-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0px,
    rgba(255, 255, 255, 0.08) 2px,
    transparent 2px,
    transparent 14px
  );
  z-index: 0;
}
.network-banner .mark {
  font-weight: 800;
  font-size: 1.5rem;
  padding: 14px 26px;
  border-radius: 999px;
  z-index: 1;
}
.network-banner .banner-label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 1;
}

.panel {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 0;
}

.panel h2 {
  font-family: var(--display-font);
  font-weight: 600;
  margin: 0 0 2px;
  font-size: 1.2rem;
}
.price-range {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.bundle-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px 6px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.bundle-btn.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

label.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

input[type="tel"], input[type="text"], input[type="password"] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 1rem;
  margin-bottom: 16px;
  background: #fff;
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.summary-strip {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  margin-bottom: 18px;
  line-height: 1.6;
}
.summary-strip strong { font-weight: 700; }

.btn-primary {
  width: 100%;
  background: var(--gold);
  color: var(--gold-ink);
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: filter 0.15s ease;
}
.btn-primary:hover:not(:disabled) { filter: brightness(0.95); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.error-text {
  color: var(--danger);
  font-size: 0.88rem;
  margin: -8px 0 14px;
}

/* ---- Order summary / checkout ---- */

.order-title {
  font-family: var(--display-font);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 6px 0 20px;
}

.order-card {
  background: var(--paper);
  border-left: 5px solid;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(23, 38, 31, 0.10);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.order-card .badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.order-card .details p { margin: 2px 0; color: var(--muted); font-size: 0.92rem; }
.order-card .details .amount { font-size: 1.2rem; font-weight: 800; color: var(--ink); margin-top: 6px; }

.totals {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.totals .row { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .row.total { font-weight: 800; font-size: 1.05rem; }

.section-label {
  font-weight: 700;
  margin-bottom: 10px;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf3dc;
  border: 1px solid #f0dfae;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 20px;
  font-weight: 600;
}

.status-box {
  text-align: center;
  padding: 30px 10px;
}

/* Signal-bar loader - the same four bars from the header mark,
   filling in sequence. Ties the loading state to the product
   itself (waiting on a network) instead of a generic spinner. */
.status-box .signal-loader {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin-bottom: 18px;
}
.status-box .signal-loader span {
  width: 7px;
  background: var(--gold);
  border-radius: 2px;
  animation: signal-pulse 1.2s ease-in-out infinite;
}
.status-box .signal-loader span:nth-child(1) { height: 30%; animation-delay: 0s; }
.status-box .signal-loader span:nth-child(2) { height: 55%; animation-delay: 0.15s; }
.status-box .signal-loader span:nth-child(3) { height: 75%; animation-delay: 0.3s; }
.status-box .signal-loader span:nth-child(4) { height: 100%; animation-delay: 0.45s; }
@keyframes signal-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}
.status-box.success .signal-loader,
.status-box.failed .signal-loader { display: none; }

.status-box .icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
  animation: pop-in 0.35s ease;
}
@keyframes pop-in {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.status-box h3 { font-family: var(--display-font); font-weight: 600; margin: 6px 0 4px; }

/* ---- Admin ---- */

.admin-shell { max-width: 760px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  background: none;
  border: none;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab-btn.active { color: var(--ink); border-color: var(--gold); }

table.orders-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9rem;
}
table.orders-table th, table.orders-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.orders-table th { background: var(--bg); font-size: 0.8rem; letter-spacing: 0.4px; color: var(--muted); }

.empty-state { text-align: center; color: var(--muted); padding: 40px 10px; }

.login-shell {
  max-width: 360px;
  margin: 60px auto;
  padding: 0 18px;
}
.login-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 8px 20px rgba(23, 38, 31, 0.12);
}
.login-card h2 { font-family: var(--display-font); font-weight: 600; }
