/* ==========================================================================
   FAVOR TOP UP — TOPUPGAMEZ-AUDITED LAYERED PALETTE + REFINED FAVOR GOLD
   Live colors audited via REA & Chrome DOM/Computed CSS on topupgamez.id/id:
     Main Canvas (--bg-primary)      : #13161C (deep midnight slate-charcoal)
     Secondary / Nav / Catalog Card  : #1A222C (--bg-secondary)
     Third / Strip / Footer Accent   : #1D2026 (--third)
     Card Secondary / Inactive Tabs  : #313C4C (--card-secondary)
     Card Primary / Flash Sale Card  : #393E47 (--card-primary)
     Borders (--border-primary/sec)  : rgba(49, 60, 76, 0.48) (#313c4c6b)
     Text Primary / Secondary        : #F8FAFC / #CBD5E1 / #94A3B8
     FAVOR Gold (replaces #E017D0)   : #E5B038 (hover #F0C14B, active #C9921D)

   Scoped strictly to Top Up layouts (app, bare, dashboard).
   Marketing pages (/, /insights, /contact) and Admin panel are untouched.
   ========================================================================== */

:root {
  /* Audited TopupGamez Layered Dark Surfaces */
  --fv-bg: #13161C;
  --fv-third: #1D2026;
  --fv-surface: #1A222C;
  --fv-surface-glass: rgba(26, 34, 44, 0.88);
  --fv-footer: #1A222C;
  --fv-card: #1A222C;
  --fv-card-primary: #393E47;
  --fv-card-secondary: #313C4C;
  --fv-elevated: #242E3C;
  --fv-hover: #3B4759;

  /* Audited TopupGamez Subtle Borders */
  --fv-border: rgba(49, 60, 76, 0.52);
  --fv-border-strong: rgba(148, 163, 184, 0.22);
  --fv-border-gold: rgba(229, 176, 56, 0.52);
  --fv-border-gold-strong: #E5B038;

  /* Refined FAVOR Gold Accent (Replaces TopupGamez #E017D0 Pink/Magenta) */
  --fv-gold: #E5B038;
  --fv-gold-bright: #F0C14B;
  --fv-gold-deep: #C9921D;
  --fv-gold-ink: #13161C;
  --fv-gold-soft: rgba(229, 176, 56, 0.14);
  --fv-gold-soft-hover: rgba(229, 176, 56, 0.22);
  --fv-gold-track: rgba(229, 176, 56, 0.20);
  --fv-gold-glow: 0 6px 20px rgba(229, 176, 56, 0.20);
  --fv-gold-ring: 0 0 0 3px rgba(229, 176, 56, 0.24);

  /* Comfortable Text Contrast Hierarchy */
  --fv-text: #F8FAFC;
  --fv-text-soft: #CBD5E1;
  --fv-muted: #94A3B8;
  --fv-subtle: #64748B;

  /* Map legacy storefront tokens cleanly */
  --tgz-bg: var(--fv-bg);
  --tgz-header: var(--fv-surface);
  --tgz-header-sub: var(--fv-surface);
  --tgz-card: var(--fv-card);
  --tgz-card-2: var(--fv-card-secondary);
  --tgz-primary: var(--fv-gold);
  --tgz-primary-hover: var(--fv-gold-bright);
  --tgz-primary-ink: var(--fv-gold-ink);
  --tgz-border: var(--fv-border);
  --tgz-text: var(--fv-text);
  --tgz-muted: var(--fv-muted);

  --ag-bg: var(--fv-bg);
  --ag-bg-soft: var(--fv-surface);
  --ag-panel: var(--fv-card);
  --ag-panel-2: var(--fv-elevated);
  --ag-text: var(--fv-text);
  --ag-muted: var(--fv-muted);
  --ag-line: var(--fv-border);
  --ag-line-strong: var(--fv-border-strong);
  --ag-card-border: var(--fv-border);
  --ag-card-border-hover: var(--fv-border-gold);
  --ag-lime: var(--fv-gold);
  --ag-lime-ink: var(--fv-gold-ink);
  --ag-link: var(--fv-gold);

  /* Monochrome + Gold Status Tokens */
  --st-success: 229, 176, 56;
  --st-warning: 240, 193, 75;
  --st-info: 203, 213, 225;
  --st-danger: 148, 163, 184;
  --st-neutral: 148, 163, 184;
}

/* --- Base Canvas & Focus/Selection States -------------------------------- */

body.ag-body,
body.ag-scope,
body.tgz-page,
.tgz-page main.ag-main,
.tgz-home {
  background-color: var(--fv-bg) !important;
  color: var(--fv-text);
  color-scheme: dark;
}

.ag-scope :focus-visible {
  outline: 2px solid var(--fv-gold);
  outline-offset: 2px;
}

.ag-scope .tgz-nav-search__input:focus,
.ag-scope .tgz-nav-search__input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.ag-scope ::selection {
  background: var(--fv-gold);
  color: var(--fv-gold-ink);
}

.ag-scope button:disabled,
.ag-scope input:disabled,
.ag-scope select:disabled,
.ag-scope [aria-disabled="true"] {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

/* --- Navbar (TopupGamez Frosted #1A222C + FAVOR Gold Active Accent) ------ */

.tgz-navbar {
  background-color: var(--fv-surface-glass) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fv-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.tgz-navbar__top,
.tgz-navbar__sub {
  background-color: transparent !important;
  border-color: var(--fv-border) !important;
}

.tgz-navbar__brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.tgz-nav-iconbtn {
  background: transparent !important;
  border: 1px solid var(--fv-border) !important;
  color: var(--fv-gold) !important;
  border-radius: 10px !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease !important;
}

.tgz-nav-iconbtn:hover {
  background: rgba(229, 176, 56, 0.08) !important;
  border-color: var(--fv-border-gold) !important;
  box-shadow: 0 0 0 1px rgba(229, 176, 56, 0.35) !important;
  color: var(--fv-gold-bright) !important;
}

.tgz-nav-link {
  color: var(--fv-text) !important;
  border-bottom: 2px solid transparent !important;
  transition: color 0.18s ease, border-color 0.18s ease !important;
}

.tgz-nav-link:hover {
  color: var(--fv-gold-bright) !important;
  border-bottom-color: var(--fv-border-gold) !important;
}

.tgz-nav-link.is-active {
  color: var(--fv-gold) !important;
  border-bottom-color: var(--fv-gold) !important;
}

/* --- Hero & Content Section Containers ----------------------------------- */

.tgz-home > .tgz-shell:first-child {
  padding-top: 20px;
  padding-bottom: 24px;
}

.tgz-hero__dot {
  background: var(--fv-card-primary) !important;
}

.tgz-hero__dot.is-active {
  background: var(--fv-gold) !important;
}

.tgz-reseller-card,
.tgz-side-card,
.tgz-trx-card,
.tgz-lb-card,
.tgz-calc-card,
.tgz-legal-card,
.ag-scope .ag-card,
.ag-scope .ag-table-wrap,
.ag-scope .ag-article__widget {
  background: var(--fv-surface) !important;
  border: 1px solid var(--fv-border) !important;
}

.ag-scope .ag-news__card {
  background: var(--fv-surface) !important;
  border: 1px solid var(--fv-border) !important;
  border-radius: 12px !important;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ag-scope .ag-news__card:hover {
  border-color: var(--fv-gold) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.ag-scope .ag-article__widget {
  background: var(--fv-surface) !important;
  border: 1px solid var(--fv-border) !important;
  border-radius: 14px !important;
}

.ag-scope .ag-article__latest a,
.ag-scope .ag-article__topup a {
  background: var(--fv-elevated) !important;
  border: 1px solid var(--fv-border) !important;
  border-radius: 10px !important;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.ag-scope .ag-article__latest a:hover,
.ag-scope .ag-article__topup a:hover {
  background: var(--fv-card-primary) !important;
  border-color: var(--fv-border-gold) !important;
}

.ag-scope .ag-article__cat {
  background: var(--fv-gold-soft) !important;
  color: var(--fv-gold-bright) !important;
  border: 1px solid rgba(229, 176, 56, 0.36) !important;
}

.tgz-trx-hero {
  background: linear-gradient(135deg, #1A222C 0%, #242E3C 100%) !important;
  border: 1px solid var(--fv-border) !important;
}

/* Search Pill & Modals (TopupGamez bg-custom-bg-secondary #1A222C) */
.tgz-search-pill,
.tgz-dmenu-dialog,
.tgz-dropdown__menu {
  background: var(--fv-surface) !important;
  border: 1px solid var(--fv-border) !important;
  color: var(--fv-text) !important;
}

.tgz-search-pill:focus-within {
  border-color: var(--fv-gold) !important;
  box-shadow: var(--fv-gold-ring) !important;
}

/* Category Tabs (TopupGamez bg-custom-card-secondary #313C4C -> Active Gold) */
.tgz-tab {
  background: var(--fv-card-secondary) !important;
  border: 1px solid transparent !important;
  color: var(--fv-text) !important;
  border-radius: 10px !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease !important;
}

.tgz-tab:hover {
  background: var(--fv-hover) !important;
  border-color: var(--fv-border-gold) !important;
  color: #FFFFFF !important;
}

.tgz-tab.is-active {
  background: var(--fv-gold) !important;
  color: var(--fv-gold-ink) !important;
  border-color: transparent !important;
  font-weight: 700 !important;
}

.tgz-tab.is-active:hover {
  background: var(--fv-gold-bright) !important;
  color: var(--fv-gold-ink) !important;
}

/* --- Flash Sale Countdown Boxes (Core layout lives in topupgamez-home.css) */

.tgz-timer__box {
  background: var(--fv-card-secondary) !important;
  border: 1px solid var(--fv-border) !important;
  color: var(--fv-text) !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.tgz-timer__sep {
  color: var(--fv-muted) !important;
}

/* --- Selective Primary CTAs (Dark Ink #13161C on Refined Gold #E5B038) --- */

.tgz-btn-login,
.tgz-reseller-card__btn,
.tgz-trx-search-btn,
.tgz-help-btn,
.tgz-calc-btn,
.ag-scope .ag-btn--primary,
.ag-scope .ag-btn-primary,
.tgz-product .pp-cta-btn,
.tgz-product .pp-submit-btn,
.tgz-product .pp-submit,
.tgz-product .pp-pay-btn,
.tgz-product button[type="submit"],
.tgz-product [data-role="checkout-btn"],
.tgz-product [data-role="order-btn"] {
  background: var(--fv-gold) !important;
  color: var(--fv-gold-ink) !important;
  border-color: transparent !important;
  font-weight: 700;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.tgz-btn-login:hover,
.tgz-reseller-card__btn:hover,
.tgz-trx-search-btn:hover,
.tgz-help-btn:hover,
.tgz-calc-btn:hover,
.ag-scope .ag-btn--primary:hover,
.ag-scope .ag-btn-primary:hover,
.tgz-product .pp-cta-btn:hover,
.tgz-product .pp-submit-btn:hover,
.tgz-product .pp-submit:hover,
.tgz-product .pp-pay-btn:hover,
.tgz-product button[type="submit"]:hover {
  background: var(--fv-gold-bright) !important;
  color: var(--fv-gold-ink) !important;
  box-shadow: var(--fv-gold-glow);
}

.tgz-btn-login:active,
.tgz-reseller-card__btn:active,
.tgz-trx-search-btn:active,
.tgz-help-btn:active,
.tgz-calc-btn:active,
.ag-scope .ag-btn--primary:active,
.ag-scope .ag-btn-primary:active {
  background: var(--fv-gold-deep) !important;
  color: var(--fv-gold-ink) !important;
  transform: translateY(1px);
}

.tgz-product .pp-step-num,
.tgz-product .pp-step__num,
.tgz-product .pp-step-badge,
.tgz-product .pp-badge-num,
.tgz-product .pp-num {
  background: var(--fv-gold) !important;
  color: var(--fv-gold-ink) !important;
}

.tgz-mnav__fab,
.tgz-mnav__fab svg {
  background: var(--fv-gold) !important;
  color: var(--fv-gold-ink) !important;
  border-color: var(--fv-bg) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(229, 176, 56, 0.28) !important;
}

.tgz-mnav {
  background: rgba(26, 34, 44, 0.96) !important;
  border-top: 1px solid var(--fv-border) !important;
}

/* Secondary / Outline Buttons & Form Inputs */
.ag-scope .ag-btn--ghost,
.ag-scope .ag-btn--outline {
  background: var(--fv-card-secondary);
  border: 1px solid var(--fv-border-strong);
  color: var(--fv-text);
}

.ag-scope .ag-btn--ghost:hover,
.ag-scope .ag-btn--outline:hover {
  background: var(--fv-hover);
  border-color: var(--fv-border-gold);
  color: #FFFFFF;
}

.ag-scope .ag-input,
.ag-scope .ag-select,
.ag-scope textarea.ag-input {
  background: var(--fv-elevated);
  border-color: var(--fv-border-strong);
  color: var(--fv-text);
}

.ag-scope .ag-input:focus,
.ag-scope .ag-select:focus,
.ag-scope textarea.ag-input:focus {
  border-color: var(--fv-gold);
  box-shadow: var(--fv-gold-ring);
}

/* Monochrome + Refined Gold Badges */
.ag-scope .ag-badge--success,
.ag-scope .ag-badge--warning {
  background: var(--fv-gold-soft);
  color: var(--fv-gold-bright);
  border: 1px solid rgba(229, 176, 56, 0.36);
}

.ag-scope .ag-badge--info,
.ag-scope .ag-badge--danger,
.ag-scope .ag-badge--neutral {
  background: var(--fv-card-secondary);
  color: var(--fv-text-soft);
  border: 1px solid var(--fv-border-strong);
}

.ag-scope .ag-form-error,
.ag-scope .ag-notice-alert,
.ag-scope .ag-form-success {
  background: var(--fv-gold-soft);
  border-color: var(--fv-border-gold);
  color: var(--fv-gold-bright);
}

.ag-scope .ag-news__cat,
.ag-scope .ag-article__latest-cat {
  background: var(--fv-gold);
  color: var(--fv-gold-ink);
}

/* Floating WhatsApp Button is styled globally in public/css/floating-whatsapp.css */

/* ==========================================================================
   ORGANIC ASYMMETRIC FOOTER WAVE
   Seamless transition from #13161C canvas into #1A222C footer via currentColor.
   ========================================================================== */

.tgz-footer-wave {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  background: var(--fv-bg) !important;
  color: var(--fv-footer) !important;
  margin-top: 0 !important;
  padding-top: 24px;
  margin-bottom: -2px !important;
  pointer-events: none;
}

.tgz-footer-wave svg {
  display: block;
  width: 100%;
  height: 104px;
}

@media (max-width: 1024px) {
  .tgz-footer-wave svg {
    height: 76px;
  }
}

@media (max-width: 640px) {
  .tgz-footer-wave {
    padding-top: 12px;
  }

  .tgz-footer-wave svg {
    height: 52px;
  }
}

.tgz-footer {
  background: var(--fv-footer) !important;
  border-top: 0 !important;
  margin-top: 0 !important;
}

.tgz-footer__bottom {
  border-top-color: var(--fv-border) !important;
}

.tgz-footer__logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

/* ==========================================================================
   TOPUPGAMEZ-CALIBRATED CARD SYSTEM (COLORS + GEOMETRY)
     - Catalog & Popular Cards : #1A222C (--bg-secondary), border #313C4C80,
                                 hover border #E5B038, 3/4/5/6 cols, 4/5 -> 3/4
     - Flash Sale Cards        : #393E47 (--card-primary), 2px border #313C4C80,
                                 hover border #E5B038, gold promo price,
                                 gold-tinted progress bar, #1D2026 saving strip
   ========================================================================== */

/* --- 1. Product Catalog Grid (Games, Pulsa, Paket Data, Baru Dirilis) ---- */

.tgz-pgrid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

@media (min-width: 768px) {
  .tgz-pgrid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (min-width: 1024px) {
  .tgz-pgrid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (min-width: 1280px) {
  .tgz-pgrid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

/* --- 2. Popular / Trending Carousel Cards -------------------------------- */

.tgz-pop-track {
  gap: 12px !important;
}

.tgz-pop-track .tgz-pcard {
  flex: 0 0 calc((100% - 24px) / 3) !important;
  min-width: 112px !important;
  max-width: 210px !important;
}

@media (min-width: 768px) {
  .tgz-pop-track {
    gap: 16px !important;
  }

  .tgz-pop-track .tgz-pcard {
    flex: 0 0 180px !important;
  }
}

@media (min-width: 1024px) {
  .tgz-pop-track .tgz-pcard {
    flex: 0 0 192px !important;
  }
}

@media (min-width: 1280px) {
  .tgz-pop-track .tgz-pcard {
    flex: 0 0 200px !important;
  }
}

/* --- 3. Unified Product Card (.tgz-pcard — Exact TopupGamez #1A222C) ----- */

.tgz-pcard {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0 !important;
  height: 100% !important;
  padding: 0 !important;
  border-radius: 10px !important;
  background: var(--fv-surface) !important;
  border: 1px solid var(--fv-border) !important;
  overflow: hidden !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24) !important;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease !important;
}

.tgz-pcard:hover {
  border-color: var(--fv-gold) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(229, 176, 56, 0.22) !important;
}

.tgz-pcard__media {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 4 / 5 !important;
  overflow: hidden !important;
  border-radius: 9px 9px 0 0 !important;
  background: var(--fv-third) !important;
}

@media (min-width: 768px) {
  .tgz-pcard__media {
    aspect-ratio: 3 / 4 !important;
  }
}

.tgz-pcard__poster {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 0.3s ease !important;
}

.tgz-pcard:hover .tgz-pcard__poster {
  transform: scale(1.05) !important;
}

.tgz-pcard__hover {
  background: linear-gradient(to top, rgba(229, 176, 56, 0.68) 0%, rgba(19, 22, 28, 0.16) 60%, transparent 100%) !important;
}

.tgz-pcard__logo {
  max-height: 44px !important;
  width: auto !important;
  object-fit: contain !important;
}

.tgz-pcard__footer {
  width: 100% !important;
  height: 44px !important;
  padding: 6px 8px !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  flex-shrink: 0 !important;
  background: var(--fv-surface) !important;
}

.tgz-pcard__title {
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--fv-text) !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
}

@media (min-width: 768px) {
  .tgz-pcard__footer {
    height: 46px !important;
    padding: 6px 10px !important;
  }

  .tgz-pcard__title {
    font-size: 13.5px !important;
  }
}

/* Flash Sale cards are styled canonically in public/css/topupgamez-home.css
   (restored TopupGamez ribbon, ornament pattern, corner badge, full gold footer strip,
   and 3-piece angled polygon bar without stacked overrides). */
