/* =========================================================
   Mikrotik Hotspot — Glassmorphism Elegant UI
   Version: 4.0 — adds navbar-bawah + QR button + drawer menu
   ---------------------------------------------------------
   Features:
   - iOS safe-area-insets (notch / Dynamic Island)
   - Dynamic viewport height (100dvh) with fallbacks
   - 16px input font-size (prevents iOS auto-zoom)
   - 44px+ tap targets (Apple HIG / Material Design)
   - Fluid typography via clamp()
   - Breakpoints: 360 / 480 / 768 / 1024 / 1440 / 1920 (TV)
   - Landscape phone handling
   - AndroidTV / SmartTV: D-pad focus rings, large fonts (10ft viewing)
   - Voucher-first layout for TV (single prominent input)
   - Reduced-motion support
   - NEW v4: Bottom navbar with floating QR button (links to MYQR scanner)
   - NEW v4: Top-left hamburger drawer menu (full menu navigation)
   - NEW v4: TV-mode: bottom navbar hidden (use D-pad instead)
   ========================================================= */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Prevent iOS text size adjust on orientation change */
  -webkit-text-size-adjust: 100%;
          text-size-adjust: 100%;
  /* Smooth scrolling without breaking position:fixed */
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  /* Use 100% as fallback, then layer on modern units */
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Design Tokens ----------
   NOTE: All design tokens (colors, typography, spacing, motion) are
   defined in master.css. This file uses those tokens via var().
   Do NOT redefine tokens here — that would override master.css.
   ---------------------------------- */

/* ---------- Base ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", "Inter", "Helvetica Neue", "Noto Sans SC",
    Roboto, system-ui, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  /* Prevent iOS rubber-band scroll affecting fixed background */
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
  /* Safety net — dark canvas even if .bg-aurora fails */
  background-color: var(--c-bg-1);
  /* Allow text selection but optimize for touch */
  -webkit-touch-callout: none;
}

/* Disable double-tap-to-zoom on buttons (iOS) */
button,
.btn,
a.btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

/* Allow text selection in inputs */
input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

/* ---------- Animated Aurora Background ---------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, var(--c-bg-1) 0%, var(--c-bg-2) 50%, var(--c-bg-3) 100%);
  overflow: hidden;
}

.bg-aurora::before,
.bg-aurora::after {
  content: "";
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: drift 22s var(--ease) infinite alternate;
  will-change: transform;
}

.bg-aurora::before {
  top: -20vmax;
  left: -15vmax;
  background: radial-gradient(circle at center, var(--c-accent-1) 0%, transparent 60%);
}

.bg-aurora::after {
  bottom: -25vmax;
  right: -20vmax;
  background: radial-gradient(circle at center, var(--c-accent-2) 0%, transparent 60%);
  animation-delay: -8s;
  animation-duration: 28s;
}

.bg-orb {
  position: fixed;
  width: 40vmax;
  height: 40vmax;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  opacity: 0.4;
  background: radial-gradient(circle at center, var(--c-accent-3) 0%, transparent 60%);
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: drift 32s var(--ease) infinite alternate;
  animation-delay: -4s;
  will-change: transform;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(8vmax, 6vmax) scale(1.1); }
  100% { transform: translate(-6vmax, -4vmax) scale(0.95); }
}

/* ---------- Particles (decorative) ---------- */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.particles span {
  position: absolute;
  display: block;
  width: 4px;
  height: 4px;
  background: var(--particle-color, rgba(255, 255, 255, 0.55));
  border-radius: 50%;
  box-shadow: 0 0 8px var(--particle-glow, rgba(255, 255, 255, 0.7));
  animation: floatUp linear infinite;
  opacity: 0;
}

/* Light theme: dark particles on light bg */
:root {
  --particle-color: rgba(109, 94, 252, 0.4);
  --particle-glow: rgba(109, 94, 252, 0.5);
}
/* Dark theme: white particles */
html[data-theme="dark"] {
  --particle-color: rgba(255, 255, 255, 0.55);
  --particle-glow: rgba(255, 255, 255, 0.7);
}

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Responsive padding with safe-area-inset for iOS */
  padding:
    calc(20px + var(--safe-top))
    calc(20px + var(--safe-right))
    calc(20px + var(--safe-bottom))
    calc(20px + var(--safe-left));
}

.page__inner {
  width: 100%;
  max-width: 460px;
  /* Tiny horizontal margin to keep card off screen edge on smallest phones */
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Brand / Logo ---------- */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  animation: rise 0.7s var(--ease) both;
}

.brand__mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.5);
  position: relative;
  flex-shrink: 0;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 12px;
  background: var(--topbar-bg, rgba(11, 16, 38, 0.6));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand__mark svg {
  position: relative;
  z-index: 1;
}

.brand__name {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--brand-name-gradient, linear-gradient(135deg, #fff 0%, #b8c4ff 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand__sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Glass Card ---------- */
.card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  /* Fluid padding: smaller on phones, larger on tablets/desktops */
  padding: clamp(24px, 5vw, 40px) clamp(20px, 4vw, 32px) clamp(22px, 4vw, 30px);
  overflow: hidden;
  animation: rise 0.8s var(--ease) both;
  /* Prevent mask-image from cutting shadow on iOS */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Subtle top highlight */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%);
}

/* Corner glow */
.card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(109, 94, 252, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.card > * { position: relative; z-index: 1; }

.card__title {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.card__subtitle {
  color: var(--text-secondary);
  font-size: clamp(13px, 3.5vw, 15px);
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field {
  position: relative;
  margin-bottom: 16px;
}

.field__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.field__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field__icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}

.field__input {
  width: 100%;
  /* 52px on desktop, 50px on phone; always >= 44px tap target */
  height: clamp(50px, 12vw, 56px);
  padding: 0 16px 0 46px;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  /* CRITICAL: 16px+ prevents iOS Safari from auto-zooming on focus */
  font-size: 16px;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.field__input::placeholder {
  color: var(--text-muted);
}

.field__input:hover {
  background: var(--glass-bg-strong);
}

.field__input:focus {
  border-color: var(--c-accent-2);
  background: var(--glass-bg-strong);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15);
}

.field__input:focus ~ .field__icon,
.field__wrap:focus-within .field__icon {
  color: var(--c-accent-2);
}

.field__toggle {
  position: absolute;
  right: 8px;
  /* Apple HIG minimum 44x44 tap target */
  width: var(--tap-min);
  height: var(--tap-min);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.field__toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.field__toggle:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.96);
}

/* =========================================================
   v4.1 — Inline Scan button (next to voucher input)
   ========================================================= */

.field__wrap--with-scan {
  /* keep input + scan button side by side */
}

.field__input--with-scan {
  /* Make room for the scan button on the right */
  padding-right: 110px;
}

.field__scan-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-accent-1) 0%, var(--c-accent-2) 100%);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
  box-shadow:
    0 4px 12px rgba(109, 94, 252, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 2;
}
.field__scan-btn:hover { filter: brightness(1.1); transform: translateY(-50%) scale(1.02); }
.field__scan-btn:active { transform: translateY(-50%) scale(0.97); }
.field__scan-btn svg { flex-shrink: 0; }
.field__scan-btn-text { line-height: 1; }

.field__scan-btn:focus-visible {
  outline: 2px solid var(--c-accent-2);
  outline-offset: 2px;
  box-shadow:
    0 4px 12px rgba(109, 94, 252, 0.45),
    0 0 0 4px rgba(0, 212, 255, 0.3);
}

/* Small phones: shrink scan button */
@media (max-width: 360px) {
  .field__input--with-scan { padding-right: 92px; }
  .field__scan-btn { padding: 0 10px; font-size: 12px; height: 36px; gap: 4px; }
  .field__scan-btn svg { width: 18px; height: 18px; }
  .field__scan-btn-text { font-size: 12px; }
}

/* TV: larger scan button */
body.is-tv .field__input--with-scan { padding-right: 200px; }
body.is-tv .field__scan-btn {
  height: 64px;
  padding: 0 28px;
  font-size: 22px;
  border-radius: 18px;
  gap: 10px;
  right: 12px;
}
body.is-tv .field__scan-btn svg { width: 28px; height: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Min 50px (mobile) — 56px (desktop); always >= 44 tap target */
  height: clamp(50px, 12vw, 56px);
  width: 100%;
  padding: 0 24px;
  border: none;
  border-radius: var(--r-md);
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              filter var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(135deg, var(--c-accent-1) 0%, var(--c-accent-2) 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(109, 94, 252, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transition: left 0.7s var(--ease);
}

@media (hover: hover) {
  .btn--primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 14px 38px rgba(109, 94, 252, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  .btn--primary:hover::before { left: 100%; }
}

.btn--primary:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.95);
}

.btn--ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  text-decoration: none;
}

@media (hover: hover) {
  .btn--ghost:hover {
    background: var(--glass-bg-strong);
    transform: translateY(-2px);
  }
}

.btn--ghost:active { transform: translateY(0) scale(0.98); }

.btn--danger {
  background: linear-gradient(135deg, var(--c-danger) 0%, #ff7b54 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(255, 77, 109, 0.4);
}

@media (hover: hover) {
  .btn--danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
  }
}

/* v6.4 — Camera button (Hubungkan dengan Kamera)
   Distinct gradient (indigo → magenta) to differentiate from primary button */
.btn--camera {
  background: linear-gradient(135deg, #6d5efc 0%, #ff5fa2 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.4);
  margin-top: 8px;
}
@media (hover: hover) {
  .btn--camera:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 32px rgba(109, 94, 252, 0.55);
  }
}
.btn--camera:active {
  transform: translateY(0) scale(0.98);
}

.btn--danger:active { transform: translateY(0) scale(0.98); }

/* ---------- Alert / Error ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.45);
  color: #ffd5dc;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 18px;
  animation: shake 0.5s var(--ease);
  word-break: break-word;
}

.alert--info {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.4);
  color: #c8f3ff;
  animation: rise 0.5s var(--ease);
}

.alert--success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.45);
  color: #d5ffe2;
  animation: rise 0.5s var(--ease);
}

.alert svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.alert--empty { display: none; }

/* ---------- Info Row ---------- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
  font-size: 13px;
  min-height: 44px;
}

.row__label {
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.row__value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: "SF Mono", "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
  text-align: right;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.row__value.status--ok    { color: var(--c-accent-4); }
.row__value.status--idle  { color: var(--text-muted); }
.row__value.status--error { color: var(--c-danger); }

/* ---------- Divider ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

/* ---------- Footer / Links ---------- */
.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  animation: rise 1s var(--ease) both;
  /* Respect iOS safe-area for bottom of portrait phones */
  padding-bottom: var(--safe-bottom);
}

.footer a {
  color: var(--c-accent-2);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--dur) var(--ease);
}

.footer a:hover { color: var(--c-accent-1); text-decoration: underline; }

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.link-row a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
  padding: 6px 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.link-row a:hover { color: var(--c-accent-2); }

/* ---------- Trial banner ---------- */
.trial-banner {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(109, 94, 252, 0.12);
  border: 1px solid rgba(109, 94, 252, 0.35);
  text-align: center;
  font-size: 13px;
  color: #d8d0ff;
  animation: rise 0.9s var(--ease) both;
}

.trial-banner a {
  color: var(--c-accent-2);
  font-weight: 700;
  text-decoration: none;
}

.trial-banner a:hover { text-decoration: underline; }

/* ---------- Spinner ---------- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

/* =========================================================
   Responsive Breakpoints
   ---------------------------------------------------------
   Strategy: mobile-first. Base styles target phones (<= 480px).
   Then progressively enhance for tablet (768px+) and desktop (1024px+).
   ========================================================= */

/* ---------- Very small phones (iPhone SE 1st gen, older Androids) ---------- */
@media (max-width: 360px) {
  .page {
    padding:
      calc(16px + var(--safe-top))
      calc(14px + var(--safe-right))
      calc(16px + var(--safe-bottom))
      calc(14px + var(--safe-left));
  }
  .card {
    padding: 22px 18px 20px;
    border-radius: 20px;
  }
  .card__title { font-size: 19px; }
  .card__subtitle { font-size: 12px; margin-bottom: 20px; }
  .field { margin-bottom: 14px; }
  .field__input {
    height: 48px;
    font-size: 16px; /* keep 16px — never below */
    padding-left: 44px;
  }
  .field__icon { left: 14px; width: 18px; height: 18px; }
  .field__toggle { width: 44px; height: 44px; right: 4px; }
  .btn { height: 50px; font-size: 15px; }
  .brand { gap: 10px; margin-bottom: 18px; }
  .brand__mark { width: 42px; height: 42px; border-radius: 12px; }
  .row { padding: 10px 12px; font-size: 12px; }
  .row__value { font-size: 11px; }
  .alert { font-size: 12px; padding: 10px 12px; }
  .trial-banner { font-size: 12px; padding: 10px; }
  .link-row { font-size: 12px; }
  .footer { font-size: 11px; margin-top: 16px; }
}

/* ---------- Standard phones (361px - 480px) ---------- */
@media (min-width: 361px) and (max-width: 480px) {
  .card { padding: 28px 22px 24px; border-radius: 20px; }
}

/* ---------- Landscape phones (height < 500px) — e.g. iPhone landscape ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .page {
    align-items: flex-start;
    padding-top: calc(16px + var(--safe-top));
  }
  .brand { margin-bottom: 14px; }
  .brand__mark { width: 38px; height: 38px; }
  .brand__name { font-size: 18px; }
  .brand__sub { display: none; }
  .card { padding: 20px 22px 18px; }
  .card__title { font-size: 19px; }
  .card__subtitle { margin-bottom: 14px; font-size: 13px; }
  .field { margin-bottom: 12px; }
  .field__input { height: 46px; }
  .btn { height: 46px; }
  .row { min-height: 38px; padding: 8px 12px; }
  .divider { margin: 14px 0 12px; }
  .footer { margin-top: 14px; padding-bottom: 0; }
}

/* ---------- Tablets (iPad portrait, 768px+) ---------- */
@media (min-width: 768px) {
  .page { padding: 32px; }
  .page__inner { max-width: 480px; }
  .brand { gap: 14px; margin-bottom: 26px; }
  .brand__mark { width: 52px; height: 52px; border-radius: 16px; }
  .brand__mark svg { width: 26px; height: 26px; }
  .brand__name { font-size: 24px; }
  .brand__sub { font-size: 12px; }
  .card {
    padding: 40px 36px 32px;
    border-radius: 28px;
  }
  .card__title { font-size: 26px; margin-bottom: 8px; }
  .card__subtitle { font-size: 15px; margin-bottom: 28px; }
  .field { margin-bottom: 18px; }
  .field__label { font-size: 13px; }
  .field__input {
    height: 56px;
    padding-left: 50px;
    border-radius: 18px;
    font-size: 16px;
  }
  .field__icon { left: 18px; width: 22px; height: 22px; }
  .field__toggle { right: 10px; width: 48px; height: 48px; }
  .btn { height: 56px; border-radius: 18px; font-size: 16px; }
  .row {
    padding: 14px 16px;
    font-size: 14px;
    min-height: 48px;
    border-radius: 12px;
  }
  .row__label { font-size: 12px; }
  .row__value { font-size: 13px; }
  .alert { font-size: 14px; padding: 14px 16px; }
  .divider { margin: 26px 0 18px; font-size: 12px; }
  .trial-banner { font-size: 14px; padding: 14px; }
  .footer { font-size: 13px; margin-top: 24px; }
}

/* ---------- Desktop (1024px+) ---------- */
@media (min-width: 1024px) {
  .page__inner { max-width: 500px; }
  .card {
    padding: 44px 40px 36px;
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.45),
      0 24px 80px rgba(109, 94, 252, 0.18);
  }
  .brand { margin-bottom: 28px; }
}

/* ---------- Large desktop (1440px+) ---------- */
@media (min-width: 1440px) {
  .page__inner { max-width: 520px; }
  .card { padding: 48px 44px 40px; }
}

/* ---------- iPad Pro / tablets landscape ---------- */
@media (min-width: 1024px) and (max-height: 768px) {
  .page { align-items: center; }
}

/* ---------- Hover-only on devices that support it ---------- */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices: simplify hover states, rely on :active */
  .btn--primary:hover,
  .btn--ghost:hover,
  .btn--danger:hover { transform: none; filter: none; }
  .field__input:hover { background: var(--glass-bg); }
  .field__toggle:hover { background: transparent; color: var(--text-muted); }
  .link-row a:hover { color: var(--text-secondary); }
  .footer a:hover { text-decoration: none; }
}

/* ---------- Dark mode explicit (in case user has light OS theme) ---------- */
@media (prefers-color-scheme: light) {
  /* Keep our dark theme — it's intentional */
  :root { color-scheme: dark; }
}

/* ---------- Print (rare, but keep clean) ---------- */
@media print {
  .bg-aurora, .bg-orb, .particles { display: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; backdrop-filter: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .particles { display: none; }
}

/* =========================================================
   AndroidTV / SmartTV Support (v3.0)
   ---------------------------------------------------------
   TV viewing distance is ~10ft (3m), so fonts and tap targets
   must be MUCH larger than desktop. TV remote uses D-pad
   navigation, so :focus-visible rings are essential.

   Detection strategy:
   - User-Agent contains TV/AndroidTV/SmartTV/GoogleTV/WebOS/Tizen/HBBTV
   - OR: width >= 1280 && height >= 720 && no touch
   - Body gets class "is-tv" via JS (script.js)

   Layout strategy for TV:
   - Single-column voucher-first layout
   - Hide password field by default (most TV users use voucher codes only)
   - Make voucher input MUCH larger
   - Big clear "CONNECT" button
   - Status link visible at bottom
   ========================================================= */

/* TV Mode container class — applied to <body> by JS when TV detected */
body.is-tv {
  font-size: 20px;
}

body.is-tv .page {
  padding: 40px;
  /* Center vertically for TV (avoid edges that may be cropped by TV overscan) */
  align-items: center;
}

body.is-tv .page__inner {
  max-width: 720px;
}

body.is-tv .brand {
  margin-bottom: 32px;
  gap: 20px;
}

body.is-tv .brand__mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
}

body.is-tv .brand__mark svg {
  width: 36px;
  height: 36px;
}

body.is-tv .brand__name {
  font-size: 36px;
}

body.is-tv .brand__sub {
  font-size: 16px;
  letter-spacing: 2px;
}

body.is-tv .card {
  padding: 48px 56px 44px;
  border-radius: 32px;
  /* Slightly stronger glass for TV contrast */
  background: rgba(255, 255, 255, 0.1);
  /* Heavier shadow for depth perception at distance */
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(109, 94, 252, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.is-tv .card__title {
  font-size: 36px;
  margin-bottom: 12px;
}

body.is-tv .card__subtitle {
  font-size: 20px;
  margin-bottom: 36px;
  color: var(--text-secondary);
}

body.is-tv .field { margin-bottom: 24px; }

body.is-tv .field__label {
  font-size: 16px;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

body.is-tv .field__input {
  height: 80px;
  padding-left: 70px;
  padding-right: 24px;
  font-size: 28px;
  border-radius: 22px;
  border-width: 2px;
}

body.is-tv .field__icon {
  left: 24px;
  width: 32px;
  height: 32px;
}

body.is-tv .field__toggle {
  right: 16px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

body.is-tv .field__toggle svg {
  width: 28px;
  height: 28px;
}

body.is-tv .btn {
  height: 80px;
  border-radius: 22px;
  font-size: 26px;
  letter-spacing: 1px;
  margin-top: 8px;
}

body.is-tv .btn svg {
  width: 28px;
  height: 28px;
}

body.is-tv .row {
  padding: 18px 24px;
  font-size: 18px;
  min-height: 64px;
  border-radius: 14px;
}

body.is-tv .row__label {
  font-size: 14px;
  letter-spacing: 0.6px;
}

body.is-tv .row__value {
  font-size: 18px;
}

body.is-tv .alert {
  padding: 18px 22px;
  font-size: 18px;
  border-radius: 18px;
  margin-bottom: 24px;
}

body.is-tv .alert svg {
  width: 24px;
  height: 24px;
}

body.is-tv .divider {
  font-size: 14px;
  letter-spacing: 1.4px;
  margin: 32px 0 20px;
}

body.is-tv .trial-banner {
  padding: 18px;
  font-size: 18px;
  border-radius: 18px;
}

body.is-tv .footer {
  font-size: 16px;
  margin-top: 32px;
}

body.is-tv .link-row {
  font-size: 18px;
  margin-top: 24px;
}

body.is-tv .link-row a {
  padding: 10px 0;
}

/* TV: Hide trial banner if voucher mode (TV users typically use vouchers only) */
body.is-tv.tv-voucher-mode .trial-banner {
  display: none;
}

/* TV: Hide info rows initially — show only if user requests */
body.is-tv .server-info-toggle {
  display: inline-flex !important;
}

body.is-tv .server-info {
  display: none;
}

body.is-tv .server-info.is-visible {
  display: block;
  animation: rise 0.5s var(--ease) both;
}

.server-info-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 16px 0 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.server-info-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

body.is-tv .server-info-toggle {
  padding: 18px;
  font-size: 18px;
  border-radius: 18px;
}

/* =========================================================
   D-pad Focus Styles (AndroidTV / SmartTV / Keyboard navigation)
   ---------------------------------------------------------
   TV remotes navigate via D-pad (up/down/left/right + OK).
   Focused elements need a HIGHLY visible ring so users can
   see what they're about to activate from across the room.
   ========================================================= */

/* Hide default outline, replace with custom focus ring */
.field__input:focus,
.btn:focus,
.field__toggle:focus,
.link-row a:focus,
.footer a:focus,
.trial-banner a:focus,
.server-info-toggle:focus,
.row:focus {
  outline: none;
}

/* Show focus ring ONLY when keyboard/TV navigation is active
   (not on mouse click) */
.field__input:focus-visible,
.btn:focus-visible,
.field__toggle:focus-visible,
.link-row a:focus-visible,
.footer a:focus-visible,
.trial-banner a:focus-visible,
.server-info-toggle:focus-visible,
.row:focus-visible {
  outline: 3px solid var(--c-accent-2);
  outline-offset: 4px;
  box-shadow:
    0 0 0 6px rgba(0, 212, 255, 0.25),
    0 0 24px rgba(0, 212, 255, 0.4);
  border-radius: var(--r-md);
  transition: box-shadow 0.2s var(--ease);
}

body.is-tv .field__input:focus-visible,
body.is-tv .btn:focus-visible,
body.is-tv .field__toggle:focus-visible,
body.is-tv .link-row a:focus-visible,
body.is-tv .footer a:focus-visible,
body.is-tv .server-info-toggle:focus-visible {
  outline-width: 4px;
  outline-offset: 6px;
  box-shadow:
    0 0 0 10px rgba(0, 212, 255, 0.3),
    0 0 36px rgba(0, 212, 255, 0.55);
}

/* TV: Focused button gets slight scale-up for visibility */
body.is-tv .btn:focus-visible {
  transform: scale(1.04);
}

body.is-tv .field__input:focus-visible {
  background: var(--glass-bg-strong);
  border-color: var(--c-accent-2);
}

/* Spatial navigation support (Tizen / WebOS) */
:focus {
  -webkit-spatial-navigation-contain: contain;
}

/* TV: hide elements irrelevant for TV (less clutter) */
body.is-tv .field__toggle {
  /* Keep password toggle, but make it more visible */
  background: rgba(255, 255, 255, 0.06);
}

/* =========================================================
   Mikhmon Status Widget (status.html)
   ========================================================= */

.mikhmon-widget {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: rise 0.6s var(--ease) both;
}

.mikhmon-widget__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.mikhmon-widget__title svg {
  width: 18px;
  height: 18px;
  color: var(--c-accent-2);
}

.mikhmon-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
  min-height: 44px;
}

.mikhmon-status__label {
  font-size: 13px;
  color: var(--text-muted);
}

.mikhmon-status__value {
  font-size: 13px;
  font-weight: 700;
  font-family: "SF Mono", "JetBrains Mono", "Consolas", monospace;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mikhmon-status__value.is-active {
  color: var(--c-accent-4);
}

.mikhmon-status__value.is-expired {
  color: var(--c-danger);
}

.mikhmon-status__value.is-loading {
  color: var(--text-muted);
}

.mikhmon-status__value.is-error {
  color: var(--c-danger);
}

.mikhmon-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.25); }
}

.mikhmon-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mikhmon-actions .btn--ghost {
  flex: 1;
  min-width: 140px;
  text-decoration: none;
}

body.is-tv .mikhmon-widget {
  padding: 28px;
  border-radius: 22px;
  margin-top: 28px;
}

body.is-tv .mikhmon-widget__title {
  font-size: 18px;
  margin-bottom: 20px;
}

body.is-tv .mikhmon-widget__title svg {
  width: 24px;
  height: 24px;
}

body.is-tv .mikhmon-status {
  padding: 18px 24px;
  font-size: 18px;
  min-height: 64px;
  border-radius: 14px;
}

body.is-tv .mikhmon-status__label,
body.is-tv .mikhmon-status__value {
  font-size: 18px;
}

body.is-tv .mikhmon-dot {
  width: 12px;
  height: 12px;
}

/* Expired badge for status page header */
.expired-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 77, 109, 0.15);
  border: 1px solid rgba(255, 77, 109, 0.5);
  color: #ffb3c1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.expired-badge svg {
  width: 14px;
  height: 14px;
}

body.is-tv .expired-badge {
  font-size: 16px;
  padding: 12px 22px;
  border-radius: 999px;
  margin-bottom: 24px;
}

body.is-tv .expired-badge svg {
  width: 20px;
  height: 20px;
}

/* Loading skeleton for Mikhmon status */
.skeleton {
  display: inline-block;
  width: 80px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.06) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================================================
   TV: 4K / Large SmartTV (>= 2560px width)
   ========================================================= */
@media (min-width: 2560px) and (min-height: 1080px) {
  body.is-tv .page__inner { max-width: 880px; }
  body.is-tv .brand__name { font-size: 44px; }
  body.is-tv .card { padding: 60px 72px 56px; border-radius: 40px; }
  body.is-tv .card__title { font-size: 44px; }
  body.is-tv .card__subtitle { font-size: 24px; }
  body.is-tv .field__input { height: 96px; font-size: 34px; border-radius: 28px; }
  body.is-tv .btn { height: 96px; font-size: 32px; border-radius: 28px; }
}

/* =========================================================
   TV: 720p baseline (older SmartTVs, set-top boxes)
   ========================================================= */
@media (min-width: 1280px) and (max-width: 1599px) and (min-height: 720px) {
  /* When TV detected via UA but screen is only 720p */
  body.is-tv .page__inner { max-width: 620px; }
  body.is-tv .brand__name { font-size: 30px; }
  body.is-tv .card { padding: 40px 48px 36px; }
  body.is-tv .card__title { font-size: 30px; }
  body.is-tv .card__subtitle { font-size: 17px; }
  body.is-tv .field__input { height: 72px; font-size: 24px; }
  body.is-tv .btn { height: 72px; font-size: 22px; }
}

/* =========================================================
   v4.0 — Top-left Hamburger Drawer Menu
   ---------------------------------------------------------
   Triggered by .topbar-hamburger button (top-left of page).
   Slides in from left, with full menu navigation.
   ========================================================= */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: var(--safe-top);
  background: var(--topbar-bg, rgba(11, 16, 38, 0.55));
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

.topbar__btn {
  width: 44px;
  height: 44px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.topbar__btn:hover { background: var(--glass-bg-strong); }
.topbar__btn:active { transform: scale(0.96); }
.topbar__btn svg { width: 22px; height: 22px; }

.topbar__btn:focus-visible {
  outline: 2px solid var(--c-accent-2);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(0, 212, 255, 0.2);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.topbar__brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topbar__brand-mark svg { width: 16px; height: 16px; }

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

/* Drawer (slide-in from left) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--drawer-bg, linear-gradient(180deg, var(--c-bg-2) 0%, var(--c-bg-1) 100%));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  padding: calc(20px + var(--safe-top)) 20px 20px;
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.drawer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer__brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(109, 94, 252, 0.5);
  flex-shrink: 0;
}
.drawer__brand-mark svg { width: 22px; height: 22px; }
.drawer__brand-name {
  font-size: 17px;
  font-weight: 700;
  background: var(--brand-name-gradient, linear-gradient(135deg, #fff 0%, #b8c4ff 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.drawer__brand-sub {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
}

.drawer__close {
  width: 36px; height: 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.drawer__close:hover { background: var(--glass-bg-strong); color: var(--text-primary); }
.drawer__close svg { width: 18px; height: 18px; }

.drawer__section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}
.drawer__nav { display: flex; flex-direction: column; gap: 4px; }
.drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  min-height: 44px;
}
.drawer__link:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
.drawer__link.is-active {
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.3), rgba(0, 212, 255, 0.15));
  color: var(--text-primary);
  border: 1px solid rgba(109, 94, 252, 0.4);
}
.drawer__link svg { width: 20px; height: 20px; flex-shrink: 0; }
.drawer__link .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.15);
  color: var(--c-accent-2);
  font-weight: 700;
  letter-spacing: 0.4px;
}

.drawer__footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}
.drawer__footer a { color: var(--c-accent-2); text-decoration: none; font-weight: 600; }

/* TV: hide top-left hamburger (use D-pad instead) */
body.is-tv .topbar { display: none; }

/* Page needs top padding to clear the topbar (only when topbar is shown) */
.page--with-topbar {
  padding-top: calc(72px + var(--safe-top));
}

/* =========================================================
   v4.0 — Bottom Navbar with Floating QR Button
   ---------------------------------------------------------
   Fixed bottom navbar with:
   - Left: Home, Status
   - Center: floating QR button (links to MYQR scanner)
   - Right: Voucher, Help
   
   QR button visually "pops" above the bar (overlapping top edge).
   ========================================================= */

.navbar-bawah {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px;
  padding-bottom: var(--safe-bottom);
  background: var(--navbar-bg, rgba(11, 16, 38, 0.7));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.navbar-bawah__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur) var(--ease);
  min-width: 56px;
  position: relative;
}
.navbar-bawah__item svg { width: 22px; height: 22px; }
.navbar-bawah__item:hover { color: var(--text-secondary); }
.navbar-bawah__item.is-active { color: var(--c-accent-2); }
.navbar-bawah__item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--c-accent-2);
  box-shadow: 0 0 12px var(--c-accent-2);
}

.navbar-bawah__item:focus-visible {
  outline: 2px solid var(--c-accent-2);
  outline-offset: -4px;
  border-radius: 8px;
}

/* Center QR button — floats above the navbar */
.navbar-bawah__qr {
  flex: 0 0 auto;
  position: relative;
  width: 60px;
  height: 60px;
  margin-top: -28px;
  background: linear-gradient(135deg, var(--c-accent-1) 0%, var(--c-accent-2) 100%);
  border: 4px solid var(--c-bg-1);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px rgba(109, 94, 252, 0.6),
    0 0 32px rgba(0, 212, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.navbar-bawah__qr:hover {
  transform: translateY(-4px) scale(1.05);
  filter: brightness(1.1);
}
.navbar-bawah__qr:active { transform: translateY(0) scale(0.98); }
.navbar-bawah__qr svg { width: 28px; height: 28px; }

.navbar-bawah__qr:focus-visible {
  outline: 3px solid var(--c-accent-2);
  outline-offset: 4px;
}

/* QR button label below */
.navbar-bawah__qr-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--c-accent-2);
  margin-top: 4px;
  display: block;
  text-align: center;
  width: 100%;
}

/* The center column wraps both the QR button and its label */
.navbar-bawah__qr-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  margin-top: -28px;
  height: 100%;
  justify-content: flex-end;
  padding-bottom: 4px;
}

/* Pulse ring around QR button (decorative) */
.navbar-bawah__qr::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--c-accent-2);
  opacity: 0;
  animation: qrPulse 2.4s var(--ease) infinite;
  pointer-events: none;
}
@keyframes qrPulse {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.4); }
}

/* TV: hide bottom navbar (use D-pad instead) */
body.is-tv .navbar-bawah { display: none; }

/* Page needs bottom padding to clear the bottom navbar */
.page--with-navbar-bawah {
  padding-bottom: calc(96px + var(--safe-bottom));
}

/* Desktop: shrink bottom navbar to centered pill */
@media (min-width: 768px) {
  .navbar-bawah {
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-width: 90vw;
    border-radius: 28px 28px 0 0;
    border: 1px solid var(--glass-border);
    border-bottom: none;
  }
  .navbar-bawah__qr {
    width: 64px; height: 64px;
    margin-top: -32px;
  }
  .navbar-bawah__qr svg { width: 30px; height: 30px; }
}

@media (min-width: 1024px) {
  .navbar-bawah { width: 520px; }
}

/* Very small phones */
@media (max-width: 360px) {
  .navbar-bawah { height: 58px; padding: 0 8px; }
  .navbar-bawah__item { font-size: 9px; min-width: 48px; }
  .navbar-bawah__item svg { width: 20px; height: 20px; }
  .navbar-bawah__qr { width: 54px; height: 54px; margin-top: -24px; }
  .navbar-bawah__qr svg { width: 24px; height: 24px; }
  .navbar-bawah__qr-wrap { width: 60px; margin-top: -24px; }
}

/* Landscape phone (short height) — keep navbar but make it shorter */
@media (max-height: 500px) and (orientation: landscape) {
  .navbar-bawah { height: 52px; }
  .navbar-bawah__item { font-size: 9px; }
  .navbar-bawah__item svg { width: 18px; height: 18px; }
  .navbar-bawah__qr { width: 48px; height: 48px; margin-top: -20px; }
  .navbar-bawah__qr svg { width: 22px; height: 22px; }
  .navbar-bawah__qr-wrap { margin-top: -20px; }
  .page--with-navbar-bawah { padding-bottom: calc(72px + var(--safe-bottom)); }
}

/* =========================================================
   v5.0 — Theme Toggle Button (Light/Dark)
   ========================================================= */

.theme-toggle {
  width: 44px;
  height: 44px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover { background: var(--glass-bg-strong); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.5s var(--ease);
}

/* In light theme: show moon icon (click → switch to dark) */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* In dark theme: show sun icon */
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.theme-toggle:focus-visible {
  outline: 2px solid var(--c-accent-2);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2);
}

/* Animate icon on toggle */
@keyframes themeToggleSpin {
  from { transform: rotate(0deg) scale(0.5); opacity: 0; }
  to { transform: rotate(360deg) scale(1); opacity: 1; }
}
.theme-toggle.is-toggling svg {
  animation: themeToggleSpin 0.5s var(--ease);
}

/* =========================================================
   v5.0 — Camera Switch Button (front ↔ back)
   ========================================================= */

.qr-popup__camera-switch {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.qr-popup__camera-switch:hover {
  background: rgba(0, 0, 0, 0.8);
}
.qr-popup__camera-switch:active {
  transform: scale(0.92);
}
.qr-popup__camera-switch svg {
  width: 22px;
  height: 22px;
  transition: transform 0.5s var(--ease);
}
.qr-popup__camera-switch.is-flipping svg {
  transform: rotateY(360deg);
}

.qr-popup__camera-switch:focus-visible {
  outline: 2px solid var(--c-accent-2);
  outline-offset: 2px;
}

.qr-popup__camera-switch--hidden {
  display: none;
}

/* TV: larger switch button */
body.is-tv .qr-popup__camera-switch {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  top: 12px;
  right: 12px;
}
body.is-tv .qr-popup__camera-switch svg { width: 28px; height: 28px; }

/* =========================================================
   v4.1 — Floating QR Scanner Popup Card
   ---------------------------------------------------------
   Glass card popup with embedded MYQR scanner iframe.
   Appears centered with backdrop blur.
   ========================================================= */
.qr-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.qr-popup-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.qr-popup {
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, var(--c-bg-2) 0%, var(--c-bg-3) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.qr-popup-backdrop.is-open .qr-popup {
  transform: scale(1);
  opacity: 1;
}

/* Subtle top highlight */
.qr-popup::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  pointer-events: none;
}

.qr-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.qr-popup__title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.qr-popup__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 4px 12px rgba(109, 94, 252, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.qr-popup__icon svg { width: 22px; height: 22px; color: #fff; }
.qr-popup__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.1px;
  line-height: 1.2;
}
.qr-popup__subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}
.qr-popup__close {
  width: 36px; height: 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.qr-popup__close:hover {
  background: var(--glass-bg-strong);
  color: var(--text-primary);
}
.qr-popup__close svg { width: 18px; height: 18px; }

.qr-popup__warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 77, 109, 0.1);
  border: 1px solid rgba(255, 77, 109, 0.35);
  border-radius: 10px;
  font-size: 11px;
  color: #ffd5dc;
  margin-bottom: 12px;
  line-height: 1.4;
}
.qr-popup__warning svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Scanner viewport — square aspect ratio, holds video + iframe + overlay */
.qr-popup__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto 14px;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Native camera video (preferred) */
.qr-popup__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  object-fit: cover;
  z-index: 1;
}

.qr-popup__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  z-index: 1;
}
.qr-popup__iframe--hidden {
  display: none;
}

/* Status indicator (top of viewport) */
.qr-popup__status {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qr-popup__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent-2);
  box-shadow: 0 0 8px var(--c-accent-2);
  animation: pulse-dot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.qr-popup__status--success { color: #d5ffe2; }
.qr-popup__status--success .qr-popup__status-dot {
  background: var(--c-accent-4);
  box-shadow: 0 0 8px var(--c-accent-4);
  animation: none;
}
.qr-popup__status--error { color: #ffd5dc; }
.qr-popup__status--error .qr-popup__status-dot {
  background: var(--c-danger);
  box-shadow: 0 0 8px var(--c-danger);
  animation: none;
}

/* Success overlay (centered, when QR detected) */
.qr-popup__success {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
  padding: 16px;
  text-align: center;
}
.qr-popup__success.is-visible {
  opacity: 1;
  visibility: visible;
}
.qr-popup__success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent-4), #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 8px 24px rgba(74, 222, 128, 0.5),
    0 0 0 6px rgba(74, 222, 128, 0.18);
  animation: pop-in 0.4s var(--ease-bounce, var(--ease));
}
@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.qr-popup__success-icon svg {
  width: 32px;
  height: 32px;
}
.qr-popup__success-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.qr-popup__success-code {
  font-family: var(--font-mono, "SF Mono", monospace);
  font-size: 13px;
  color: var(--c-accent-2);
  background: rgba(0, 212, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  letter-spacing: 0.5px;
  word-break: break-all;
  max-width: 90%;
}
.qr-popup__success-action {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.qr-popup__success-action::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--text-muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.qr-popup__viewport-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 4;
}
.qr-popup__scan-frame {
  width: 60%;
  height: 60%;
  border: 2px solid var(--c-accent-2);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.2),
    0 0 20px rgba(0, 212, 255, 0.3) inset;
  position: relative;
  animation: scanGlow 2s var(--ease) infinite;
}
.qr-popup__scan-frame::before,
.qr-popup__scan-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--c-accent-2);
}
.qr-popup__scan-frame::before {
  top: -3px; left: -3px;
  border-right: none;
  border-bottom: none;
  border-radius: 12px 0 0 0;
}
.qr-popup__scan-frame::after {
  bottom: -3px; right: -3px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 12px 0;
}
@keyframes scanGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.2), 0 0 20px rgba(0, 212, 255, 0.3) inset; }
  50% { box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.4), 0 0 36px rgba(0, 212, 255, 0.5) inset; }
}
.qr-popup__hint-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.qr-popup__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.qr-popup__actions .btn { flex: 1; }
.qr-popup__actions .btn svg { width: 14px; height: 14px; }

.qr-popup__note {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
  line-height: 1.5;
}
.qr-popup__note strong { color: var(--text-secondary); font-weight: 700; }
.qr-popup__note a { color: var(--c-accent-2); text-decoration: none; font-weight: 600; }
.qr-popup__note a:hover { text-decoration: underline; }

/* TV: larger popup */
body.is-tv .qr-popup {
  max-width: 720px;
  padding: 28px;
}
body.is-tv .qr-popup__icon { width: 64px; height: 64px; border-radius: 16px; }
body.is-tv .qr-popup__icon svg { width: 32px; height: 32px; }
body.is-tv .qr-popup__title { font-size: 26px; }
body.is-tv .qr-popup__subtitle { font-size: 16px; margin-top: 4px; }
body.is-tv .qr-popup__close { width: 56px; height: 56px; border-radius: 14px; }
body.is-tv .qr-popup__close svg { width: 26px; height: 26px; }
body.is-tv .qr-popup__viewport { max-width: 480px; border-radius: 20px; }
body.is-tv .qr-popup__hint-text { font-size: 16px; padding: 8px 18px; }

/* Small phones: tight layout */
@media (max-width: 360px) {
  .qr-popup { padding: 14px; }
  .qr-popup__icon { width: 38px; height: 38px; border-radius: 10px; }
  .qr-popup__icon svg { width: 18px; height: 18px; }
  .qr-popup__title { font-size: 15px; }
  .qr-popup__subtitle { font-size: 10px; }
  .qr-popup__close { width: 32px; height: 32px; border-radius: 8px; }
  .qr-popup__viewport { max-width: 100%; }
  .qr-popup__note { font-size: 10px; }
}

/* Landscape phone — popup scrolls if too tall */
@media (max-height: 500px) and (orientation: landscape) {
  .qr-popup-backdrop { align-items: flex-start; padding-top: 60px; }
  .qr-popup { max-height: 80vh; max-width: 600px; }
  .qr-popup__viewport { max-width: 200px; }
}

/* =========================================================
   Legacy: keep old qr-modal styles for backward compat
   (some HTML pages may still reference them)
   ========================================================= */
.qr-modal {
  background: linear-gradient(135deg, var(--c-bg-2) 0%, var(--c-bg-3) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 32px 24px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: rise 0.3s var(--ease);
}
.qr-modal__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px rgba(109, 94, 252, 0.5),
    0 0 0 8px rgba(109, 94, 252, 0.15);
}
.qr-modal__icon svg { width: 40px; height: 40px; }
.qr-modal__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.qr-modal__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.qr-modal__note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  line-height: 1.5;
}
.qr-modal__note strong { color: var(--text-secondary); }
.qr-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.qr-modal__actions .btn { flex: 1; }

/* =========================================================
   Info / Content Pages (voucher.html, paket.html, etc.)
   ========================================================= */

.info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.info-item:hover {
  background: var(--glass-bg-strong);
  transform: translateY(-1px);
}
.info-item__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(109, 94, 252, 0.4);
}
.info-item__icon svg { width: 20px; height: 20px; }
.info-item__body { flex: 1; min-width: 0; }
.info-item__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.info-item__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.info-item__arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  align-self: center;
}
.info-item__arrow svg { width: 18px; height: 18px; }

/* Package card (paket.html) */
.paket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.paket-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.paket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.paket-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--c-accent-1), var(--c-accent-2));
}
.paket-card__name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.paket-card__price {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-accent-2), var(--c-accent-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}
.paket-card__price .currency {
  font-size: 14px;
  vertical-align: top;
  margin-right: 2px;
  -webkit-text-fill-color: var(--text-secondary);
}
.paket-card__features {
  list-style: none;
  margin-bottom: 16px;
}
.paket-card__features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.paket-card__features li:last-child { border-bottom: none; }
.paket-card__features li svg {
  width: 14px; height: 14px;
  color: var(--c-accent-4);
  flex-shrink: 0;
}
.paket-card__btn {
  display: block;
  width: 100%;
  text-align: center;
}

/* FAQ (bantuan.html) */
.faq-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
  min-height: 44px;
}
.faq-item__summary::-webkit-details-marker { display: none; }
.faq-item__summary svg {
  width: 18px; height: 18px;
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
}
.faq-item[open] .faq-item__summary svg { transform: rotate(180deg); }
.faq-item__body {
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* TV styles for new components */
body.is-tv .paket-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
body.is-tv .paket-card { padding: 28px; }
body.is-tv .paket-card__name { font-size: 22px; }
body.is-tv .paket-card__price { font-size: 36px; }
body.is-tv .paket-card__price .currency { font-size: 20px; }
body.is-tv .paket-card__features li { font-size: 16px; padding: 10px 0; }
body.is-tv .paket-card__features li svg { width: 20px; height: 20px; }
body.is-tv .paket-card__btn { height: 60px; font-size: 18px; }

body.is-tv .info-item { padding: 18px 22px; }
body.is-tv .info-item__icon { width: 48px; height: 48px; border-radius: 14px; }
body.is-tv .info-item__icon svg { width: 26px; height: 26px; }
body.is-tv .info-item__title { font-size: 18px; }
body.is-tv .info-item__desc { font-size: 15px; }

body.is-tv .faq-item__summary { padding: 18px 22px; font-size: 18px; }
body.is-tv .faq-item__summary svg { width: 24px; height: 24px; }
body.is-tv .faq-item__body { padding: 0 22px 18px; font-size: 16px; }

/* =========================================================
   v6.0 — Online Purchase Card (voucher.html)
   ========================================================= */

.online-purchase-card {
  background: linear-gradient(135deg,
    rgba(109, 94, 252, 0.18) 0%,
    rgba(0, 168, 212, 0.12) 100%);
  border: 1px solid rgba(109, 94, 252, 0.4);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.online-purchase-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--c-accent-1), var(--c-accent-2));
}

.online-purchase-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.online-purchase-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(109, 94, 252, 0.45);
}

.online-purchase-card__icon svg {
  width: 22px;
  height: 22px;
}

.online-purchase-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.online-purchase-card__subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.online-purchase-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.online-purchase-card .btn {
  height: 44px;
}

/* TV: larger purchase card */
body.is-tv .online-purchase-card {
  padding: 24px;
  border-radius: 18px;
}
body.is-tv .online-purchase-card__icon {
  width: 56px; height: 56px; border-radius: 14px;
}
body.is-tv .online-purchase-card__icon svg { width: 28px; height: 28px; }
body.is-tv .online-purchase-card__title { font-size: 20px; }
body.is-tv .online-purchase-card__subtitle { font-size: 14px; }
body.is-tv .online-purchase-card__desc { font-size: 16px; }
body.is-tv .online-purchase-card .btn { height: 60px; font-size: 18px; }

/* =========================================================
   v6.2 — Enhanced Success Overlay (voucher code preview)
   ========================================================= */

.qr-popup__success-label {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 4px;
  letter-spacing: 0.3px;
  display: inline-block;
}
.qr-popup__success-label.is-valid {
  background: rgba(74, 222, 128, 0.2);
  color: #d5ffe2;
  border: 1px solid rgba(74, 222, 128, 0.5);
}
.qr-popup__success-label.is-warning {
  background: rgba(251, 191, 36, 0.18);
  color: #fef3c7;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.qr-popup__success-format {
  font-size: 10px;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-top: 4px;
  font-style: italic;
}

/* Larger success code for better visibility */
.qr-popup__success-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 8px 14px;
  margin-top: 6px;
}

/* Hint text below input voucher — example voucher format */
.voucher-format-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 4px;
}
.voucher-format-hint svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.voucher-format-hint code {
  font-family: var(--font-mono, "SF Mono", monospace);
  background: var(--glass-bg-strong, rgba(255,255,255,0.14));
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--c-accent-2, #00a8d4);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* TV: larger hint */
body.is-tv .voucher-format-hint { font-size: 14px; }
body.is-tv .voucher-format-hint code { padding: 4px 10px; font-size: 14px; }

/* =========================================================
   v6.3 — Auto-Capture Hint (Foto Voucher mode)
   ========================================================= */

.qr-popup__auto-capture-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--c-accent-2, #00d4ff);
  letter-spacing: 0.3px;
  max-width: 90%;
  text-align: center;
}
.qr-popup__auto-capture-hint svg {
  color: var(--c-accent-2, #00d4ff);
  animation: cameraPulse 2s ease-in-out infinite;
}
@keyframes cameraPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* TV: larger auto-capture hint */
body.is-tv .qr-popup__auto-capture-hint {
  font-size: 14px;
  padding: 8px 18px;
  bottom: 12px;
}
body.is-tv .qr-popup__auto-capture-hint svg { width: 20px; height: 20px; }

/* =========================================================
   v6.5 — Jepret Kamera Button (Manual Capture)
   ========================================================= */

.qr-popup__capture-btn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 4px solid var(--c-accent-2, #00d4ff);
  color: #1a1f3a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(0, 212, 255, 0.5);
  -webkit-tap-highlight-color: transparent;
  animation: capturePulse 2.5s ease-in-out infinite;
}
@keyframes capturePulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 212, 255, 0.5); }
  50% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 36px rgba(0, 212, 255, 0.7); }
}
.qr-popup__capture-btn:hover {
  transform: translateX(-50%) scale(1.06);
}
.qr-popup__capture-btn:active {
  transform: translateX(-50%) scale(0.92);
}
.qr-popup__capture-btn:focus-visible {
  outline: 3px solid var(--c-accent-2, #00d4ff);
  outline-offset: 4px;
}

/* Flash animation when capturing */
.qr-popup__capture-btn.is-capturing {
  animation: captureFlash 0.4s ease-out;
}
@keyframes captureFlash {
  0%   { background: rgba(255, 255, 255, 0.95); transform: translateX(-50%) scale(1); }
  20%  { background: #fff; transform: translateX(-50%) scale(1.15); box-shadow: 0 0 60px rgba(255,255,255,0.9); }
  100% { background: rgba(255, 255, 255, 0.95); transform: translateX(-50%) scale(1); }
}

/* TV: larger capture button */
body.is-tv .qr-popup__capture-btn {
  width: 80px;
  height: 80px;
  bottom: 50px;
}
body.is-tv .qr-popup__capture-btn svg { width: 36px; height: 36px; }

/* Small phones: slightly smaller */
@media (max-width: 360px) {
  .qr-popup__capture-btn { width: 56px; height: 56px; bottom: 36px; }
  .qr-popup__capture-btn svg { width: 24px; height: 24px; }
}

/* =========================================================
   v6.6 — Scan Label + Detection Box + Gallery Button
   ========================================================= */

/* "Kode Voucher" label inside scan frame */
.qr-popup__scan-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--c-accent-2, #00d4ff);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(0, 212, 255, 0.3);
}

/* Detection box — appears when voucher code detected in frame */
.qr-popup__detection-box {
  position: absolute;
  border: 3px solid var(--c-accent-4, #4ade80);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.3),
    0 0 20px rgba(74, 222, 128, 0.5);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  z-index: 6;
}
.qr-popup__detection-box.is-visible {
  opacity: 1;
  visibility: visible;
  animation: detectionPulse 1s ease-in-out 2;
}
@keyframes detectionPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.3), 0 0 20px rgba(74, 222, 128, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.5), 0 0 30px rgba(74, 222, 128, 0.7); }
}

/* TV: larger scan label */
body.is-tv .qr-popup__scan-label {
  font-size: 14px;
  padding: 4px 12px;
  top: -30px;
}

/* =========================================================
   v7.0 — Reseller Cards (toko.html)
   ========================================================= */

.resellers-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reseller-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.reseller-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--c-accent-1), var(--c-accent-2));
}

.reseller-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.reseller-card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-accent-1), var(--c-accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 94, 252, 0.4);
}
.reseller-card__icon svg { width: 22px; height: 22px; }
.reseller-card__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.reseller-card__hours {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.reseller-card__address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.reseller-card__address svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--c-accent-2);
}

.reseller-card__vouchers {
  margin-bottom: 12px;
}
.reseller-card__vouchers-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.reseller-card__voucher-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  margin: 2px 4px 2px 0;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 999px;
  font-size: 11px;
  color: #d5ffe2;
  font-weight: 600;
}
.reseller-card__voucher-badge svg { color: var(--c-accent-4); }

.reseller-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.reseller-card__actions .btn { min-width: auto; }

/* TV: larger reseller cards */
body.is-tv .reseller-card { padding: 24px; border-radius: 18px; }
body.is-tv .reseller-card__icon { width: 56px; height: 56px; border-radius: 14px; }
body.is-tv .reseller-card__icon svg { width: 28px; height: 28px; }
body.is-tv .reseller-card__name { font-size: 20px; }
body.is-tv .reseller-card__hours { font-size: 14px; }
body.is-tv .reseller-card__address { font-size: 16px; }
body.is-tv .reseller-card__voucher-badge { font-size: 14px; padding: 5px 12px; }

/* Expired badge (used on both status.html and expired.html) */
.expired-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ffb3c1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* =========================================================
   v7.1 — Scan Mode Selector Popup
   ========================================================= */

.scan-selector-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top, 0px));
  padding-bottom: calc(20px + var(--safe-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.scan-selector-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.scan-selector {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(135deg, var(--c-bg-2, #1b1147) 0%, var(--c-bg-3, #2a1a5e) 100%);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
  border-radius: var(--r-lg, 24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  padding: 24px 20px 18px;
  position: relative;
  overflow: hidden;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.scan-selector-backdrop.is-open .scan-selector {
  transform: scale(1);
  opacity: 1;
}
.scan-selector::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}

.scan-selector__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.scan-selector__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.1px;
}
.scan-selector__close {
  width: 32px; height: 32px;
  background: var(--glass-bg, rgba(255,255,255,0.08));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
  color: var(--text-secondary, rgba(245,247,255,0.72));
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.scan-selector__close:hover {
  background: var(--glass-bg-strong, rgba(255,255,255,0.14));
  color: var(--text-primary, #f5f7ff);
}
.scan-selector__close svg { width: 16px; height: 16px; }

.scan-selector__subtitle {
  font-size: 13px;
  color: var(--text-secondary, rgba(245,247,255,0.72));
  margin-bottom: 18px;
  line-height: 1.4;
}

.scan-selector__option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--glass-bg, rgba(255,255,255,0.08));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
  border-radius: var(--r-md, 16px);
  color: var(--text-primary, #f5f7ff);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.scan-selector__option:hover {
  background: var(--glass-bg-strong, rgba(255,255,255,0.14));
  border-color: rgba(0, 212, 255, 0.4);
  transform: translateY(-1px);
}
.scan-selector__option:active {
  transform: scale(0.98);
}
.scan-selector__option:focus-visible {
  outline: 2px solid var(--c-accent-2, #00d4ff);
  outline-offset: 2px;
}

.scan-selector__option-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.scan-selector__option-icon--qr {
  background: linear-gradient(135deg, var(--c-accent-1, #6d5efc), var(--c-accent-2, #00a8d4));
  box-shadow: 0 4px 12px rgba(109, 94, 252, 0.4);
}
.scan-selector__option-icon--photo {
  background: linear-gradient(135deg, #ff5fa2, #f59e0b);
  box-shadow: 0 4px 12px rgba(255, 95, 162, 0.4);
}
.scan-selector__option-icon--gallery {
  background: linear-gradient(135deg, #4ade80, #00a8d4);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

.scan-selector__option-body {
  flex: 1;
  min-width: 0;
}
.scan-selector__option-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 3px;
}
.scan-selector__option-desc {
  font-size: 12px;
  color: var(--text-muted, rgba(245,247,255,0.5));
  line-height: 1.3;
}
.scan-selector__option-arrow {
  flex-shrink: 0;
  color: var(--text-muted, rgba(245,247,255,0.5));
}

.scan-selector__note {
  font-size: 10px;
  color: var(--text-muted, rgba(245,247,255,0.5));
  text-align: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border, rgba(255,255,255,0.18));
  line-height: 1.4;
}

/* TV: larger selector */
body.is-tv .scan-selector { max-width: 600px; padding: 32px 28px; }
body.is-tv .scan-selector__title { font-size: 26px; }
body.is-tv .scan-selector__subtitle { font-size: 16px; }
body.is-tv .scan-selector__option { padding: 18px 22px; margin-bottom: 14px; }
body.is-tv .scan-selector__option-icon { width: 64px; height: 64px; border-radius: 16px; }
body.is-tv .scan-selector__option-icon svg { width: 32px; height: 32px; }
body.is-tv .scan-selector__option-title { font-size: 20px; }
body.is-tv .scan-selector__option-desc { font-size: 15px; }

/* =========================================================
   v8.3 — Guide Line for Foto Kode Voucher
   Horizontal line in center of scan frame to help user
   position the voucher code text.
   ========================================================= */

.qr-popup__guide-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  z-index: 5;
}
.qr-popup__guide-line-bar {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--c-accent-2, #00d4ff) 15%,
    var(--c-accent-2, #00d4ff) 85%,
    transparent 100%);
  box-shadow: 0 0 8px var(--c-accent-2, #00d4ff);
  animation: guideLineScan 2.5s linear infinite;
}
@keyframes guideLineScan {
  0%   { transform: translateY(-30px); opacity: 0.3; }
  10%  { opacity: 1; }
  50%  { transform: translateY(0px); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(30px); opacity: 0.3; }
}

/* Guide line label (below the line) */
.qr-popup__guide-line-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  color: var(--c-accent-2, #00d4ff);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

/* Corner indicators on guide line (left + right edges) */
.qr-popup__guide-line::before,
.qr-popup__guide-line::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--c-accent-2, #00d4ff);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--c-accent-2, #00d4ff);
}
.qr-popup__guide-line::before { left: 0; }
.qr-popup__guide-line::after { right: 0; }

/* TV: larger guide line */
body.is-tv .qr-popup__guide-line-label {
  font-size: 14px;
  padding: 4px 12px;
  top: 12px;
}
body.is-tv .qr-popup__guide-line::before,
body.is-tv .qr-popup__guide-line::after {
  height: 28px;
  width: 6px;
}

/* =========================================================
   v9.0 — Voucher Display (pembelian-sukses.html)
   ========================================================= */

.voucher-display {
  text-align: center;
  padding: 20px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--r-md, 16px);
  margin-bottom: 16px;
}

.voucher-display__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-accent-4, #4ade80);
  margin-bottom: 8px;
}

.voucher-display__code {
  font-family: var(--font-mono, "SF Mono", monospace);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary, #f5f7ff);
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
  word-break: break-all;
  display: inline-block;
}

/* TV: larger voucher display */
body.is-tv .voucher-display__code {
  font-size: 40px;
  padding: 18px 30px;
}

/* =========================================================
   v9.1 — Beli Voucher Online (elegant mobile purchase page)
   ========================================================= */

/* Package cards grid */
.purchase-packages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 8px;
}

@media (min-width: 768px) {
  .purchase-packages {
    grid-template-columns: repeat(2, 1fr);
  }
}

.purchase-package-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg, 24px);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.purchase-package-card:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 94, 252, 0.4);
}

/* Featured card (POPULAR badge) */
.purchase-package-card--featured {
  border: 2px solid var(--c-accent-1, #6d5efc);
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.12), rgba(0, 168, 212, 0.06));
  box-shadow: 0 8px 32px rgba(109, 94, 252, 0.2);
}

.purchase-package-card__top {
  margin-bottom: 16px;
}
.purchase-package-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-accent-1, #6d5efc), var(--c-accent-2, #00a8d4));
  color: #fff;
  text-transform: uppercase;
}
.purchase-package-card__name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.purchase-package-card__price {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-accent-1, #6d5efc), var(--c-accent-2, #00a8d4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -1px;
}
.purchase-package-card__currency {
  font-size: 14px;
  vertical-align: top;
  margin-right: 2px;
  -webkit-text-fill-color: var(--c-accent-1, #6d5efc);
}

.purchase-package-card__features {
  margin-bottom: 16px;
}
.purchase-package-card__feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary, rgba(245, 247, 255, 0.72));
}
.purchase-package-card__feature svg {
  width: 14px;
  height: 14px;
  color: var(--c-accent-4, #4ade80);
  flex-shrink: 0;
}

.purchase-package-card__btn {
  width: 100%;
}

/* Purchase summary */
.purchase-summary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md, 16px);
  padding: 16px;
  margin-bottom: 16px;
}
.purchase-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.purchase-summary__row:last-child {
  border-bottom: none;
}
.purchase-summary__row--total {
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--glass-border);
  font-size: 16px;
  color: var(--text-primary);
}

/* QRIS payment steps */
.purchase-qris-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.purchase-qris-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.purchase-qris-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-accent-1, #6d5efc);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Security badges */
.purchase-security {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.purchase-security__item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}
.purchase-security__item svg {
  color: var(--c-accent-4, #4ade80);
}

/* TV: 2-column packages */
body.is-tv .purchase-packages {
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
body.is-tv .purchase-package-card { padding: 28px; }
body.is-tv .purchase-package-card__name { font-size: 26px; }
body.is-tv .purchase-package-card__price { font-size: 44px; }

/* =========================================================
   v9.3 — App Loading Screen + Settings Dropdown
   ========================================================= */

/* ---- Loading Screen ---- */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
#app-loader.app-loader--hidden {
  opacity: 0;
  visibility: hidden;
}
.app-loader__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--c-bg-1, #0b1026) 0%, var(--c-bg-2, #1b1147) 50%, var(--c-bg-3, #2a1a5e) 100%);
}
.app-loader__content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.app-loader__logo {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}
.app-loader__logo-mark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--c-accent-1, #6d5efc), var(--c-accent-2, #00d4ff));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(109, 94, 252, 0.5);
  z-index: 2;
}
.app-loader__logo-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 100px; height: 100px;
  margin: -50px 0 0 -50px;
  border: 2px solid transparent;
  border-top-color: var(--c-accent-2, #00d4ff);
  border-right-color: var(--c-accent-1, #6d5efc);
  border-radius: 50%;
  animation: loaderSpin 1.2s linear infinite;
}
.app-loader__logo-ring--2 {
  width: 120px; height: 120px;
  margin: -60px 0 0 -60px;
  border-top-color: var(--c-accent-3, #ff5fa2);
  border-left-color: var(--c-accent-2, #00d4ff);
  animation-duration: 1.8s;
  animation-direction: reverse;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}
.app-loader__brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 0%, #b8c4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}
.app-loader__sub {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 32px;
}
.app-loader__progress {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 10px;
}
.app-loader__progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent-1, #6d5efc), var(--c-accent-2, #00d4ff));
  border-radius: 999px;
  transition: width 0.3s var(--ease);
  box-shadow: 0 0 8px var(--c-accent-2, #00d4ff);
}
.app-loader__status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
}

/* ---- Settings Dropdown (top-right) ---- */
.app-settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: 90vw;
  background: linear-gradient(135deg, var(--c-bg-2, #1b1147), var(--c-bg-3, #2a1a5e));
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
  border-radius: var(--r-lg, 24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  padding: 20px;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s var(--ease);
}
.app-settings-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.app-settings-dropdown__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border, rgba(255,255,255,0.18));
}
.app-settings-dropdown__title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.app-settings-dropdown__section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-bottom: 8px;
}
.app-settings-dropdown .field__input {
  height: 42px;
  font-size: 14px;
}
.app-settings-dropdown .btn {
  height: 42px;
}

/* =========================================================
   v1.1.0 — Embed Mode (iframe embedding)
   ========================================================= */
body.is-embed {
  padding: 0 !important;
}
body.is-embed .page {
  padding: 12px !important;
  min-height: auto !important;
}
body.is-embed .brand {
  margin-bottom: 12px;
}
body.is-embed .footer {
  display: none;
}
body.is-embed .page--with-topbar {
  padding-top: 12px !important;
}
body.is-embed .page--with-navbar-bawah {
  padding-bottom: 12px !important;
}
