/* Pop Network bus Wi-Fi portal.
   Dark by default; light variant for bright daylight (header toggle, remembered in a cookie).
   ORANGE = PopCommerce, open without sign-in.  BLUE = Wi-Fi sign-in / online.
   GREEN  = fresh produce merchant content (BabaMboga). All text meets WCAG AA. */

:root, [data-theme="dark"] {
  --bg: #141110;
  --surface: #1D1916;
  --surface-2: #26201C;
  --line: #3A312B;
  --text: #F7F1EA;
  --muted: #B8ADA2;
  --faint: #8E847B;
  --control-line: #776A61;  /* input + toggle edges, 3.3:1 on surface */

  --shop: #FF4A26;          /* PopCommerce orange fill, ink text 5.6:1 */
  --shop-ink: #160A05;
  --shop-text: #FF8763;     /* orange text on dark, 6.9:1 */
  --shop-tint: #2C1D17;
  --shop-line: #6B3624;

  --net: #009DFD;           /* Pop blue fill, ink text 6.4:1 */
  --net-ink: #031426;
  --net-text: #6CC6FF;      /* blue text on dark, 9:1 */
  --net-tint: #0F1E2E;
  --net-line: #1F4766;
  --online: #0B3B61;
  --online-text: #E6F5FF;

  --fresh: #14301F;         /* BabaMboga green */
  --fresh-line: #2B5A3E;
  --fresh-text: #93D9AC;

  --wm-pop: #2EB0FF;
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #FFF6EF;
  --surface: #FFFFFF;
  --surface-2: #FFEEE3;
  --line: #EED8CA;
  --text: #22150E;
  --muted: #6A574C;
  --faint: #7D685C;          /* 4.9:1 on bg */
  --control-line: #9A8679;   /* 3.5:1 on surface */

  --shop: #FF4A26;
  --shop-ink: #1A0B05;
  --shop-text: #B5300D;
  --shop-tint: #FFE3D5;
  --shop-line: #F2B39C;

  --net: #0077CC;
  --net-ink: #FFFFFF;
  --net-text: #0062A8;
  --net-tint: #E4F3FF;
  --net-line: #A9D6F7;
  --online: #0062A8;
  --online-text: #FFFFFF;

  --fresh: #E7F3EA;
  --fresh-line: #B9DCC4;
  --fresh-text: #1D5A37;

  --wm-pop: #0077CC;
  --shadow: 0 1px 2px rgba(80,40,20,.06), 0 8px 24px rgba(80,40,20,.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 Inter, "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
svg { width: 1.15em; height: 1.15em; flex: none; }
a { color: inherit; }
b { font-weight: 700; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

.shell { min-height: 100vh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; }

/* ---------------- header */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.wm { font-weight: 800; font-size: 22px; letter-spacing: -.03em; line-height: 1; }
.wm-pop { color: var(--wm-pop); }
.wm-network { color: var(--text); }
.wm-commerce { color: var(--shop-text); }
.theme-toggle {
  display: inline-flex; align-items: center; font-size: 14px; color: var(--muted);
  text-decoration: none; padding: 6px 2px;
}
.theme-toggle span { display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle svg { width: 16px; height: 16px; }
.t-when-light { display: none !important; }
[data-theme="light"] .t-when-light { display: inline-flex !important; }
[data-theme="light"] .t-when-dark { display: none !important; }

/* ---------------- zone strip: what works right now */
.zone {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; font-size: 14px; line-height: 1.35;
  border-bottom: 1px solid;
}
.zone b { font-weight: 700; }
.zone-shop { background: var(--shop-tint); color: var(--shop-text); border-color: var(--shop-line); }
.zone-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--shop); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--shop) 22%, transparent); }
.zone-signin { background: var(--net-tint); color: var(--net-text); border-color: var(--net-line); }
.zone-online { background: var(--online); color: var(--online-text); border-color: transparent; }
.zone-icon { display: inline-flex; }
.zone-steps { margin-left: auto; display: inline-flex; gap: 4px; }
.zone-steps i { width: 22px; height: 4px; border-radius: 4px; background: var(--net-line); }
.zone-steps i.on { background: var(--net); }

/* ---------------- page body */
.wrap { flex: 1; padding: 26px 20px 8px; display: flex; flex-direction: column; gap: 20px; }
.intro { display: flex; flex-direction: column; gap: 10px; }
.eyebrow {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.eyebrow-shop { color: var(--shop-text); }
.eyebrow-net { color: var(--net-text); }
h1 { margin: 0; font-size: 34px; line-height: 1.06; letter-spacing: -.025em; font-weight: 800; }
h2 { margin: 0; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; }
.lede { margin: 0; color: var(--muted); font-size: 16px; }
.lede b { color: var(--text); }
.fine { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------------- buttons */
.actions { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 14px 18px; border-radius: 10px; border: 1.5px solid transparent;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%;
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--net); outline-offset: 2px; }
.btn-net { background: var(--net); color: var(--net-ink); }
.btn-net:hover { filter: brightness(1.06); }
.btn-net-line { background: transparent; color: var(--net-text); border-color: var(--net-text); }
.btn-shop { background: var(--shop); color: var(--shop-ink); }
.btn-shop:hover { filter: brightness(1.05); }
.btn-shop-line { background: transparent; color: var(--shop-text); border-color: var(--shop-text); }
.btn[disabled] { opacity: .6; }

.link-net {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--net-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-net[disabled] { color: var(--faint); text-decoration: none; cursor: default; }
.row-links { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--faint); font-size: 15px; margin: -4px 0 0; }

.row-link {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 12px; border: 1px solid var(--shop-line); background: var(--shop-tint);
  color: var(--shop-text); text-decoration: none;
}
.row-link > span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.row-link small { color: var(--muted); font-size: 13.5px; }
.row-link-net { border-color: var(--line); background: var(--surface); color: var(--net-text); }

/* ---------------- welcome: how Wi-Fi works */
.how {
  list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  border: 1px solid var(--net-line); background: var(--net-tint); border-radius: 12px;
}
.how li { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.25; }
.how li > span:last-child { display: flex; flex-direction: column; }
.how small { color: var(--muted); font-size: 12.5px; }
.how-n {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--net); color: var(--net-ink); font-size: 12.5px; font-weight: 800;
}

/* ---------------- product carousel */
.carousel-wrap { display: flex; flex-direction: column; gap: 10px; }
.carousel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.swipe-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
.swipe-hint svg { width: 13px; height: 13px; }
.carousel {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -20px; padding: 0 20px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.car-card {
  /* Deliberately narrow: two full cards plus a clearly cut-off sliver of a
     third fit in view, so the row reads as scrollable instead of "just two". */
  flex: 0 0 auto; width: 44%; max-width: 180px; scroll-snap-align: start;
  display: block; text-decoration: none; color: var(--text);
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow);
}
.car-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--fresh); }
.car-media .pv-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--fresh-text); }
.pv-fallback svg { width: 30px; height: 30px; }
.merchant {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(10,8,6,.72); color: #fff; backdrop-filter: blur(4px);
}
.merchant svg { width: 14px; height: 14px; }
.merchant-fresh svg { color: #93D9AC; }
.car-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
.car-title { font-size: 15px; line-height: 1.3; font-weight: 700; }
.car-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.car-price b { font-size: 16px; }
.was { color: var(--faint); margin-left: 6px; font-size: 12.5px; }
.car-cta { display: inline-flex; color: var(--shop-text); }
.car-cta svg { width: 15px; height: 15px; }

/* ---------------- sign-in */
.notice {
  border: 1px solid var(--net-line); background: var(--net-tint); border-radius: 12px; padding: 16px;
  font-size: 14.5px; line-height: 1.45;
}
.notice-head {
  margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--net-text);
}
.notice dl { margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.notice dl > div { display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.notice dt { color: var(--net-text); font-weight: 700; }
.notice dd { margin: 0; color: var(--text); }

.form { display: flex; flex-direction: column; gap: 12px; }
label { font-weight: 700; font-size: 15px; }
.phone-field {
  display: flex; align-items: stretch; border: 1.5px solid var(--control-line); border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.phone-field:focus-within { border-color: var(--net); box-shadow: 0 0 0 3px color-mix(in srgb, var(--net) 30%, transparent); }
.cc { display: grid; place-items: center; padding: 0 14px; color: var(--muted); border-right: 1px solid var(--line); font-weight: 600; background: var(--surface-2); }
.phone-field input, .code {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 20px; padding: 14px; outline: none;
}
.code {
  border: 1.5px solid var(--control-line); border-radius: 10px; background: var(--surface);
  font-size: 28px; letter-spacing: .5em; text-align: center; padding: 14px 0 14px .5em; font-variant-numeric: tabular-nums;
}
.code:focus { border-color: var(--net); box-shadow: 0 0 0 3px color-mix(in srgb, var(--net) 30%, transparent); }
.code::placeholder, .phone-field input::placeholder { color: var(--faint); }

.toggle {
  display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 42px; height: 24px; border-radius: 999px; background: var(--control-line); position: relative; flex: none; transition: background .15s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--net); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid var(--net); outline-offset: 2px; }
.opt { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }

.alert {
  margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 15px;
  background: var(--shop-tint); border: 1px solid var(--shop-line); color: var(--text);
}

/* ---------------- connecting */
.pulse {
  width: 64px; height: 64px; border-radius: 50%; margin: 10px auto 6px; display: grid; place-items: center;
  background: var(--net-tint); color: var(--net-text); border: 1px solid var(--net-line);
  animation: pulse 1.4s ease-in-out infinite;
}
.pulse svg { width: 28px; height: 28px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--net) 12%, transparent); } }

/* ---------------- online */
.allowance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.allowance > span {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding: 14px; border-radius: 12px; border: 1px solid var(--net-line); background: var(--net-tint);
}
.allowance svg { grid-row: span 2; color: var(--net-text); width: 22px; height: 22px; }
.allowance b { font-size: 20px; line-height: 1.1; }
.allowance small { color: var(--muted); font-size: 13px; }

.shop-block {
  display: flex; flex-direction: column; gap: 12px; margin-top: 6px;
  padding: 20px 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--shop);
}
.route-line { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.track { flex: 1; display: flex; align-items: center; justify-content: space-between; border-top: 2px dashed var(--line); height: 0; }
.track i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-top: -1px; }
.track i.bus { width: 12px; height: 12px; background: var(--shop); }
.deals { display: flex; flex-direction: column; }
.deal {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--text);
  border-top: 1px solid var(--line);
}
.deal:first-child { border-top: 0; }
.deal-thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none;
  background: var(--shop-tint); color: var(--shop-text); display: grid; place-items: center;
}
.deal-thumb-fresh { background: var(--fresh); color: var(--fresh-text); }
.deal-thumb .pv-img { width: 100%; height: 100%; object-fit: cover; }
.deal-thumb .pv-fallback { color: inherit; }
.deal-thumb .pv-fallback svg { width: 22px; height: 22px; }
.deal-body { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.deal-title { font-weight: 700; }
.deal-note { color: var(--muted); font-size: 13.5px; }
.deal-price { display: flex; flex-direction: column; align-items: flex-end; color: var(--shop-text); white-space: nowrap; }
.deal-price .was { margin: 0; font-size: 12.5px; }

/* ---------------- prose pages */
.prose { display: flex; flex-direction: column; gap: 8px; }
.prose h1 { margin-bottom: 6px; }
.prose h2 { font-size: 18px; margin-top: 12px; }
.prose p { margin: 0; color: var(--muted); }
.prose p b { color: var(--text); }
.draft { padding: 8px 12px; border-radius: 8px; background: var(--shop-tint); color: var(--shop-text) !important; font-weight: 700; font-size: 13.5px; }
.key-row { display: flex; gap: 10px; align-items: flex-start; }
.key { width: 14px; height: 14px; border-radius: 4px; flex: none; margin-top: 4px; }
.key-shop { background: var(--shop); }
.key-net { background: var(--net); }

/* ---------------- footer */
.foot {
  display: flex; justify-content: flex-start; gap: 8px; padding: 18px 20px 26px; margin-top: 18px;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 14px;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .btn { transition: none; } }
@media (max-width: 350px) { h1 { font-size: 30px; } .how { grid-template-columns: 1fr; } }
.deal-price .tbc { font-size: 13px; font-weight: 700; }
