/* ============================================================================
   CodeBoost — Liquid Glass UI System
   One source of truth for the premium public-facing design language.
   Loaded after Tailwind CDN so component classes win over inline duplicates.
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  /* Brand spectrum (shared by both themes) */
  --brand: #2f6bff;
  --brand-hover: #1e54e6;
  --brand-2: #22d3ee;   /* cyan   — liquid highlight */
  --brand-3: #7c5cff;   /* violet — liquid depth */
  --accent: #f5a623;    /* amber  — warm accent */

  --radius-sm: 0.7rem;
  --radius: 1rem;
  --radius-lg: 1.4rem;
  --radius-xl: 1.9rem;

  /* Aliases some pages reference (bundles/giftcards/referrals) — resolve to the
     active theme's tokens so those surfaces stop silently falling back. */
  --surface: var(--bg-elevated);
  --app-bg: var(--bg);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-tap: cubic-bezier(0.34, 1.4, 0.64, 1);  /* slight overshoot on press release */
  --dur-fast: 0.16s;   /* taps, colour/bg swaps, icon nudges */
  --dur-base: 0.26s;   /* hover lift, border, shadow, focus */
  --dur-slow: 0.42s;   /* sheets, accordions, reveals */

  /* Soft, blended header gradient (replaces the hard 2-stop blue→violet band) */
  --grad-header: linear-gradient(155deg, color-mix(in srgb, var(--brand) 92%, #fff) 0%, var(--brand) 34%, color-mix(in srgb, var(--brand) 55%, var(--brand-3)) 72%, var(--brand-3) 100%);
  /* Richer balance-card gradient (deep navy instead of crushed pure-black) */
  --grad-wallet: linear-gradient(140deg, color-mix(in srgb, var(--brand) 82%, #0a1024) 0%, color-mix(in srgb, var(--brand) 60%, var(--brand-3)) 52%, color-mix(in srgb, var(--brand-3) 70%, #0a1024) 100%);
}

/* ---- Dark theme (default, premium) --------------------------------------- */
[data-theme="dark"] {
  --bg: #05070f;
  --bg-2: #080c18;
  --bg-elevated: #0c1322;
  --text: #f3f6fc;
  --text-muted: #9fb0c9;
  --text-faint: #8493ad;
  --border: rgba(150, 170, 210, 0.16);

  /* Glass */
  --card: rgba(255, 255, 255, 0.055);
  --card-bg: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.085);
  --card-border: rgba(255, 255, 255, 0.11);
  --card-hl: rgba(255, 255, 255, 0.16);            /* top inner highlight */
  --elev-1: 0 2px 6px -3px rgba(0,0,0,0.55), 0 10px 24px -16px rgba(0,0,0,0.7);
  --elev-2: 0 6px 16px -8px rgba(0,0,0,0.6), 0 20px 44px -24px rgba(0,0,0,0.8);
  --elev-3: 0 12px 28px -10px rgba(0,0,0,0.62), 0 34px 70px -30px rgba(0,0,0,0.85);
  --glass-shadow: var(--elev-2);                   /* alias — existing markup unchanged */

  /* Nav */
  --nav-bg: rgba(8, 12, 22, 0.62);

  /* Inputs */
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.13);
  --placeholder: rgba(180, 195, 220, 0.42);
  --muted: var(--text-muted);

  /* Background liquid blobs */
  --blob-1: rgba(47, 107, 255, 0.40);
  --blob-2: rgba(34, 211, 238, 0.24);
  --blob-3: rgba(124, 92, 255, 0.30);
  --grid-line: rgba(255, 255, 255, 0.028);

  /* Legacy glow aliases (kept for existing markup) */
  --hero-glow-1: rgba(47, 107, 255, 0.22);
  --hero-glow-2: rgba(34, 211, 238, 0.12);
  --glow: rgba(47, 107, 255, 0.22);
  --glow2: rgba(124, 92, 255, 0.14);

  /* Flash */
  --flash-ok-bg: rgba(16, 185, 129, 0.12);
  --flash-ok-border: rgba(16, 185, 129, 0.34);
  --flash-ok-text: #6ee7b7;
  --flash-err-bg: rgba(244, 63, 94, 0.12);
  --flash-err-border: rgba(244, 63, 94, 0.34);
  --flash-err-text: #fda4af;

  color-scheme: dark;
}

/* ---- Light theme (soft, airy glass) -------------------------------------- */
[data-theme="light"] {
  --bg: #eef2fb;
  --bg-2: #e7edfa;
  --bg-elevated: #ffffff;
  --text: #0d1526;
  --text-muted: #46556e;
  --text-faint: #66748f;
  --border: rgba(15, 30, 60, 0.10);

  --card: rgba(255, 255, 255, 0.72);
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-2: rgba(255, 255, 255, 0.88);
  --card-border: rgba(15, 30, 60, 0.09);
  --card-hl: rgba(255, 255, 255, 0.55);
  --elev-1: 0 1px 3px -1px rgba(30,50,100,0.10), 0 8px 20px -14px rgba(30,50,100,0.18);
  --elev-2: 0 4px 12px -6px rgba(30,50,100,0.14), 0 18px 40px -22px rgba(30,50,100,0.22);
  --elev-3: 0 10px 24px -8px rgba(30,50,100,0.16), 0 30px 64px -28px rgba(30,50,100,0.28);
  --glass-shadow: var(--elev-2);

  --nav-bg: rgba(255, 255, 255, 0.6);

  --input-bg: rgba(255, 255, 255, 0.85);
  --input-border: rgba(15, 30, 60, 0.14);
  --placeholder: rgba(80, 96, 122, 0.55);
  --muted: var(--text-muted);

  --blob-1: rgba(47, 107, 255, 0.20);
  --blob-2: rgba(34, 211, 238, 0.16);
  --blob-3: rgba(124, 92, 255, 0.16);
  --grid-line: rgba(20, 40, 80, 0.035);

  --hero-glow-1: rgba(47, 107, 255, 0.12);
  --hero-glow-2: rgba(34, 211, 238, 0.08);
  --glow: rgba(47, 107, 255, 0.12);
  --glow2: rgba(124, 92, 255, 0.08);

  --flash-ok-bg: rgba(16, 185, 129, 0.10);
  --flash-ok-border: rgba(16, 185, 129, 0.30);
  --flash-ok-text: #047857;
  --flash-err-bg: rgba(244, 63, 94, 0.08);
  --flash-err-border: rgba(244, 63, 94, 0.28);
  --flash-err-text: #be123c;

  color-scheme: light;
}

/* ---- Base ----------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -0.018em; }
.tabular-nums, [class*="tabular-nums"] { font-variant-numeric: tabular-nums slashed-zero; letter-spacing: 0; }

::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--text); }

/* Refined scrollbar */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 18%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text) 30%, transparent); background-clip: padding-box; }

/* ============================================================================
   Liquid background
   Add <div class="cb-bg" aria-hidden="true"></div> as the first child of body.
   ========================================================================== */
.cb-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg) 60%);
  pointer-events: none;
}
.cb-bg::before {
  /* faint engineering grid for depth */
  content: "";
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(110% 90% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(110% 90% at 50% 0%, #000 0%, transparent 78%);
}
.cb-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.9;
  will-change: transform;
}
.cb-blob-1 { width: 46vw; height: 46vw; left: -8vw; top: -8vw; background: var(--blob-1); animation: cb-float-1 26s var(--ease) infinite alternate; }
.cb-blob-2 { width: 40vw; height: 40vw; right: -10vw; top: 6vh; background: var(--blob-2); animation: cb-float-2 32s var(--ease) infinite alternate; }
.cb-blob-3 { width: 50vw; height: 50vw; left: 18vw; bottom: -22vw; background: var(--blob-3); animation: cb-float-3 30s var(--ease) infinite alternate; }

@keyframes cb-float-1 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(8vw,6vh,0) scale(1.15); } }
@keyframes cb-float-2 { from { transform: translate3d(0,0,0) scale(1.05); } to { transform: translate3d(-7vw,8vh,0) scale(0.92); } }
@keyframes cb-float-3 { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-6vw,-7vh,0) scale(1.12); } }

/* ============================================================================
   Premium app background — richer ambient depth behind the customer dashboard.
   Scoped to body.cb-app so public / auth / storefront keep their existing look.
   ========================================================================== */
.cb-app .cb-bg {
  background:
    radial-gradient(120% 70% at 50% -6%, color-mix(in srgb, var(--brand) 22%, var(--bg-2)) 0%, var(--bg-2) 34%, var(--bg) 72%),
    radial-gradient(66% 48% at 88% 10%, color-mix(in srgb, var(--brand-3) 26%, transparent), transparent 56%),
    radial-gradient(62% 46% at 6% 24%,  color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 54%),
    radial-gradient(80% 55% at 82% 58%, color-mix(in srgb, var(--brand-3) 16%, transparent), transparent 58%),
    radial-gradient(78% 52% at 10% 76%, color-mix(in srgb, var(--brand)   17%, transparent), transparent 58%),
    radial-gradient(90% 55% at 50% 104%, color-mix(in srgb, var(--brand-2) 13%, transparent), transparent 60%),
    var(--bg);
}
/* fine film grain → premium matte finish (kept very subtle) */
.cb-app .cb-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
/* Upgraded liquid orbs (dashboard only) — premium radial light with a bright core
   and clean falloff, instead of flat-colour blurred discs. */
.cb-app .cb-blob { filter: blur(54px); }
.cb-app .cb-blob-1 {
  background: radial-gradient(circle at 50% 44%,
    color-mix(in srgb, var(--brand) 72%, transparent) 0%,
    color-mix(in srgb, var(--brand) 28%, transparent) 38%,
    transparent 68%);
}
.cb-app .cb-blob-2 {
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--brand-2) 56%, transparent) 0%,
    color-mix(in srgb, var(--brand-2) 20%, transparent) 40%,
    transparent 68%);
}
.cb-app .cb-blob-3 {
  background: radial-gradient(circle at 50% 56%,
    color-mix(in srgb, var(--brand-3) 64%, transparent) 0%,
    color-mix(in srgb, var(--brand-3) 24%, transparent) 40%,
    transparent 68%);
}
/* Richer, more saturated header aurora oval */
.cb-app .cb-aurora {
  background:
    conic-gradient(from 130deg,
      color-mix(in srgb, var(--brand) 75%, transparent),
      color-mix(in srgb, var(--brand-2) 66%, transparent),
      color-mix(in srgb, var(--brand-3) 74%, transparent),
      color-mix(in srgb, var(--brand) 75%, transparent));
  filter: blur(58px) saturate(1.15);
  opacity: 0.62;
}
/* Centered popup entrance — used by modal / dialog cards */
@keyframes cb-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.cb-pop { animation: cb-pop-in var(--dur-base) var(--ease); }
@media (prefers-reduced-motion: reduce) { .cb-pop { animation: none !important; } }
/* Premium content sheet — shared by app-shell sub-pages, wallet & orders (mobile).
   A brand glow rising from the top + a crisp lifted top edge, instead of flat fill.
   Desktop keeps the layout's lg:bg-transparent, so scope to < lg only. */
@media (max-width: 1023px) {
  .cb-tray {
    position: relative;
    background:
      radial-gradient(150% 70% at 50% 0%, color-mix(in srgb, var(--brand) 24%, var(--bg-elevated)) 0%, var(--bg-elevated) 48%),
      radial-gradient(70% 40% at 82% 2%, color-mix(in srgb, var(--brand-3) 20%, transparent), transparent 60%),
      linear-gradient(180deg, color-mix(in srgb, #fff 5%, var(--bg-elevated)), var(--bg-elevated) 22%);
    box-shadow:
      inset 0 1px 0 var(--card-hl),
      0 -18px 46px -24px color-mix(in srgb, var(--brand) 60%, transparent);
  }
  /* crisp lifted top edge — a thin cyan-white rim that fades at the corners */
  .cb-tray::before {
    content: "";
    position: absolute;
    left: 7%; right: 7%; top: 0;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand-2) 85%, #fff) 50%, transparent);
    opacity: 0.8;
    filter: blur(0.2px);
    pointer-events: none;
  }
}

/* Hero/auth gradient wash helpers (kept for existing markup) */
.hero-bg, .auth-bg { background: transparent; }
.auth-bg { min-height: 100dvh; }

/* ============================================================================
   Glass surfaces
   ========================================================================== */
.glass,
.glass-card {
  position: relative;
  background:
    linear-gradient(150deg, var(--card-2) 0%, var(--card-bg) 46%, var(--card-bg) 100%);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--card-hl);
  border-radius: var(--radius-lg);
}
/* Liquid edge sheen on cards */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--card-hl) 90%, transparent), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

/* Generic interactive lift */
.cb-lift { transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease); }
.cb-lift:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--card-border));
  box-shadow: var(--elev-2), inset 0 1px 0 var(--card-hl), 0 24px 46px -26px color-mix(in srgb, var(--brand) 40%, transparent);
}
.cb-lift:active {
  transform: translateY(-1px) scale(0.992);
  box-shadow: var(--elev-1), inset 0 1px 0 var(--card-hl);
  transition-duration: var(--dur-fast);
}

/* ---- Service / feature cards (existing class, upgraded) ------------------- */
.service-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(150deg, var(--card-2) 0%, var(--card-bg) 55%);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--card-hl);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--brand) 48%, transparent);
  box-shadow:
    inset 0 1px 0 var(--card-hl),
    0 36px 70px -30px color-mix(in srgb, var(--brand) 58%, transparent);
}

/* ============================================================================
   Navigation
   ========================================================================== */
.nav-shell {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
/* Floating pill nav variant */
.nav-floating {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 40px -26px rgba(0,0,0,0.6), inset 0 1px 0 var(--card-hl);
  border-radius: 99px;
}
.nav-link { position: relative; transition: color 0.2s var(--ease); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }

/* ============================================================================
   Buttons
   ========================================================================== */
.btn-hero,
.btn-primary {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, #ffffff) 0%, var(--brand) 45%, var(--brand-hover) 100%);
  border: 1px solid color-mix(in srgb, #ffffff 22%, var(--brand));
  box-shadow:
    0 10px 26px -10px color-mix(in srgb, var(--brand) 75%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.18s var(--ease), box-shadow 0.28s var(--ease), filter 0.2s var(--ease);
}
.btn-hero::after,
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
  pointer-events: none;
}
.btn-hero:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  filter: saturate(115%);
  box-shadow:
    0 16px 34px -10px color-mix(in srgb, var(--brand) 85%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-hero:hover::after,
.btn-primary:hover::after { left: 130%; }
.btn-hero:active,
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* Glass / outline secondary */
.btn-outline,
.btn-glass {
  position: relative;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--card-hl);
  transition: transform 0.18s var(--ease), border-color 0.24s var(--ease), background 0.24s var(--ease);
}
.btn-outline:hover,
.btn-glass:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--card-border));
  background: var(--card-2);
}
.btn-outline:active,
.btn-glass:active { transform: translateY(0) scale(0.985); }

/* ============================================================================
   Inputs
   ========================================================================== */
.input-field {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.input-field::placeholder { color: var(--placeholder); }
.input-field:focus {
  outline: none;
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--input-bg));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 26%, transparent);
}

/* ============================================================================
   Decorative helpers
   ========================================================================== */
.icon-round {
  width: 2.85rem; height: 2.85rem;
  border-radius: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand) 55%, var(--brand-3) 130%);
  box-shadow:
    0 10px 22px -10px color-mix(in srgb, var(--brand) 70%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.4);
}
.icon-round svg { width: 1.4rem; height: 1.4rem; }

/* Glassy icon (neutral surface, brand-tinted glyph) */
.icon-glass {
  width: 2.85rem; height: 2.85rem;
  border-radius: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--card-bg));
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--card-border));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.icon-glass svg { width: 1.4rem; height: 1.4rem; }

.section-alt { background: color-mix(in srgb, var(--text) 3%, transparent); }

.badge-glass {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--card-hl);
}

.divider-glow {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--border) 18%, var(--border) 82%, transparent);
}

/* Gradient text */
.text-gradient {
  background-image: linear-gradient(105deg, var(--text) 0%, color-mix(in srgb, var(--brand) 70%, var(--text)) 55%, var(--text) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-hero-gradient {
  background-image: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .home-hero-gradient {
  background-image: linear-gradient(100deg, #6ea8ff 0%, #5eead4 50%, #b69bff 100%);
}

/* ============================================================================
   Animations
   ========================================================================== */
/* Entrance: animate TRANSFORM only — content stays opacity:1 so it is visible on
   the very first paint (no blank-then-fade "blink"). `both` keeps the start
   offset during any delay so staggered items never jump. */
@keyframes cb-rise { from { transform: translateY(0.7rem); } to { transform: translateY(0); } }
.cb-rise { animation: cb-rise 0.5s var(--ease) both; animation-delay: var(--d, 0s); }

@keyframes cb-grad-flow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
.home-hero-gradient-anim { background-size: 220% auto !important; animation: cb-grad-flow 9s ease-in-out infinite alternate; }

@keyframes cb-pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Scroll reveal (paired with the IntersectionObserver already in the pages) */
.home-reveal { opacity: 0; transform: translateY(1.3rem); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--home-reveal-d, 0s); }
.home-reveal.home-show { opacity: 1; transform: translateY(0); }
.cb-reveal { opacity: 0; transform: translateY(1.3rem); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }
.cb-reveal.cb-show { opacity: 1; transform: translateY(0); }

/* ============================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cb-blob { animation: none !important; }
  .cb-rise, .home-reveal, .cb-reveal, .home-hero-gradient-anim { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .service-card::after, .btn-hero::after, .btn-primary::after { display: none; }
}

/* ============================================================================
   Small screens — keep the glass cheap & legible
   ========================================================================== */
@media (max-width: 640px) {
  .cb-blob { filter: blur(54px); }
  .glass, .glass-card, .service-card { -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); }
}

/* ============================================================================
   v2 — premium material & motion upgrades
   ========================================================================== */

@property --cb-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---- Fine grain noise over the liquid background ------------------------- */
.cb-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---- Scroll-aware floating nav ------------------------------------------ */
.nav-floating { transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease); }
[data-nav].is-scrolled .nav-floating {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  box-shadow: 0 24px 50px -30px rgba(0,0,0,0.75), inset 0 1px 0 var(--card-hl);
}

/* ---- Cursor spotlight (place <span class="cb-spot"></span> in the card) -- */
[data-spotlight] { isolation: isolate; }
.cb-spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
[data-spotlight]:hover .cb-spot,
[data-spotlight]:focus-within .cb-spot { opacity: 1; }

/* ---- Animated conic gradient border ------------------------------------- */
.ring-conic { position: relative; isolation: isolate; }
.ring-conic::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--cb-a), var(--brand), var(--brand-2), var(--brand-3), var(--brand));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: cb-ring-spin 6s linear infinite;
}
@keyframes cb-ring-spin { to { --cb-a: 360deg; } }

/* ---- Aurora glow (behind hero headline) --------------------------------- */
.cb-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  background:
    conic-gradient(from 120deg,
      color-mix(in srgb, var(--brand) 60%, transparent),
      color-mix(in srgb, var(--brand-2) 55%, transparent),
      color-mix(in srgb, var(--brand-3) 60%, transparent),
      color-mix(in srgb, var(--brand) 60%, transparent));
  animation: cb-aurora-spin 18s linear infinite;
}
@keyframes cb-aurora-spin { to { transform: rotate(360deg); } }

/* ---- Floating accent cards (gentle bob) --------------------------------- */
.cb-float { animation: cb-bob var(--bob, 6s) ease-in-out infinite; animation-delay: var(--bob-d, 0s); }
@keyframes cb-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---- Logo / trust marquee ----------------------------------------------- */
.cb-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.cb-marquee-track {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  width: max-content;
  animation: cb-marquee 30s linear infinite;
}
.cb-marquee:hover .cb-marquee-track { animation-play-state: paused; }
@keyframes cb-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- FAQ accordion ------------------------------------------------------- */
.cb-acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.38s var(--ease); }
[data-acc-item].is-open .cb-acc-body { grid-template-rows: 1fr; }
.cb-acc-body > div { overflow: hidden; }
.cb-acc-chevron { transition: transform 0.32s var(--ease); }
[data-acc-item].is-open .cb-acc-chevron { transform: rotate(180deg); }
[data-acc-item] { transition: border-color 0.3s var(--ease), background 0.3s var(--ease); }
[data-acc-item].is-open { border-color: color-mix(in srgb, var(--brand) 38%, var(--card-border)); }

/* ---- Blur-in reveal variant --------------------------------------------- */
.cb-reveal { filter: blur(6px); }
.cb-reveal.cb-show { filter: blur(0); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease); }

/* ---- Section heading kicker --------------------------------------------- */
.cb-kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brand);
}
.cb-kicker::before { content: ""; width: 1.4rem; height: 1px; background: currentColor; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .ring-conic::before, .cb-aurora, .cb-float, .cb-marquee-track { animation: none !important; }
}

@media (max-width: 640px) {
  .cb-aurora { filter: blur(48px); }
}


/* ============================================================================
   Native mobile-app foundation (2026-06-30) — iOS zoom fix, instant page
   transitions, tap/scroll polish. Applies across the whole user app.
   ========================================================================== */

/* iOS must NOT zoom when a field is focused → all text controls are >=16px on
   mobile (the magic threshold). !important beats utility/inline font sizes. */
@media (max-width: 1023px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select, textarea, .input, .input-field {
    font-size: 16px !important;
  }
}

/* NOTE: cross-document View Transitions were intentionally removed. The
   per-navigation crossfade (root fading opacity 0→1) caused a visible
   flash/blink before each page appeared. Prefetch already makes navigation
   feel instant, so the transition was pure downside on this app. */

/* Tap / selection polish — instant tap response, no text-selection on chrome. */
button, a, .btn, .nav-item, .bottom-nav-item, [role="button"], summary { touch-action: manipulation; }
.btn, .bottom-nav-item, .nav-item, .cb-fab, [data-noselect] { -webkit-user-select: none; user-select: none; }

/* Top navigation progress bar (native "app loading" feel). */
#cb-nprogress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0; z-index: 99999;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand) 55%, transparent);
  opacity: 0; pointer-events: none; border-radius: 0 3px 3px 0;
}

/* ============================================================================
   Native gestures & feel — install banner + pull-to-refresh (2026-06-30)
   ========================================================================== */
#cb-install {
  position: fixed; left: 0.75rem; right: 0.75rem; bottom: calc(5.6rem + env(safe-area-inset-bottom));
  z-index: 9998; max-width: 30rem; margin: 0 auto;
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.65rem;
  background: var(--card-2); border: 1px solid var(--card-border); border-radius: 1rem;
  box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transform: translateY(160%); opacity: 0; transition: transform .32s var(--ease), opacity .32s var(--ease);
}
#cb-install.show { transform: translateY(0); opacity: 1; }
#cb-install .cbi-ico { width: 2.5rem; height: 2.5rem; border-radius: 0.65rem; flex-shrink: 0; object-fit: cover; }
#cb-install .cbi-tx { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
#cb-install .cbi-tx strong { font-size: 0.82rem; color: var(--text); }
#cb-install .cbi-tx span { font-size: 0.68rem; color: var(--text-muted); }
#cb-install .cbi-go { flex-shrink: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand)); color: #fff; font-size: 0.78rem; font-weight: 700; padding: 0.45rem 0.85rem; border-radius: 0.65rem; border: 0; cursor: pointer; }
#cb-install .cbi-go:active { transform: scale(0.96); }
#cb-install .cbi-x { flex-shrink: 0; background: transparent; border: 0; color: var(--text-muted); font-size: 1.25rem; line-height: 1; padding: 0.1rem 0.35rem; cursor: pointer; }
@media (min-width: 1024px) { #cb-install { left: auto; right: 1.5rem; bottom: 1.5rem; max-width: 22rem; } }

/* Pull-to-refresh — a tactile progress ring that emerges from BENEATH the header
   (never over it). PWA only. JS sets --ptr-top to the header's bottom edge and
   toggles .is-spinning. 94.25 = 2πr for r=15. */
#cb-ptr {
  position: fixed; left: 50%; top: var(--ptr-top, 3.6rem); z-index: 28;
  height: 2.5rem; width: 2.5rem; margin-left: -1.25rem;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--card-border);
  box-shadow: var(--elev-2);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  opacity: 0; transform: translateY(-130%) scale(0.6);
  pointer-events: none; will-change: transform, opacity;
}
#cb-ptr svg { width: 1.45rem; height: 1.45rem; display: block; }
#cb-ptr .ptr-ring { transform: rotate(-90deg); transform-origin: 50% 50%; }
#cb-ptr .ptr-track { fill: none; stroke: color-mix(in srgb, var(--text) 13%, transparent); stroke-width: 3; }
#cb-ptr .ptr-prog { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; }
#cb-ptr.is-spinning .ptr-ring { animation: cb-ptr-spin 0.66s linear infinite; }
#cb-ptr.is-spinning .ptr-prog { stroke-dashoffset: 64; transition: stroke-dashoffset 0.2s var(--ease); }
@keyframes cb-ptr-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
/* keep the header above the tucked-away indicator so it slides out from under it */
.cb-ft-top { position: relative; z-index: 30; }

/* iOS standalone (installed PWA): the fixed mobile home header grows by the top
   safe-area inset so its content clears the status bar; the page's top padding
   must grow to match so content isn't hidden under the taller header. */
@media (max-width: 1023px) {
  .cb-safe-top { padding-top: calc(3.65rem + env(safe-area-inset-top, 0)) !important; }
}

/* ============================================================================
   iOS-stable app chrome (2026-06-30)
   The fixed header + bottom nav must never drift while scrolling, and the
   Wallet/Orders pages keep a fixed top with only their list scrolling.
   Mobile only — desktop keeps normal body scroll + the sidebar.
   ========================================================================== */
@media (max-width: 1023px) {
  /* Kill the iOS rubber-band so position:fixed header + bottom nav stay put */
  html, body { overscroll-behavior-y: none; }

  /* Inner pages (appShell + Wallet/Orders): lock to the viewport as a FLEX COLUMN.
     Height = --app-height (JS = window.innerHeight, the REAL visible height — set
     in the head). 100dvh/100vh lie in an iOS installed PWA (come up short → dark
     band + hanging nav), but window.innerHeight is the true webview height there.
     Fallback to 100dvh for no-JS. The glass nav is position:absolute; bottom:0
     against this correctly-sized body, so bottom:0 = the real screen edge. */
  body.cb-locked { height: var(--app-height, 100dvh); overflow: hidden; display: flex; flex-direction: column; position: relative; }
  body.cb-locked .cb-main     { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  body.cb-locked .cb-content  { min-height: 0; overflow: hidden; }
  /* The glass nav OVERLAYS the scroller so the list scrolls UNDER the frosted
     capsule (like WhatsApp): position:absolute; bottom:0 against the locked body. */
  body.cb-locked .cb-navwrap  { position: absolute; left: 0; right: 0; bottom: 0; z-index: 45; }
  body.cb-locked .cb-ft-top   { flex: 0 0 auto; }
  body.cb-locked .cb-ft-scroll {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); /* clear the overlaid glass capsule */
  }

  /* The flat WhatsApp-style bottom bar is a STATIC flex footer on inner pages
     (body.cb-locked .cb-navwrap), so it's structurally pinned to the bottom and
     no longer floats on iOS PWA — it stays visible everywhere, like WhatsApp. */
}

/* ============================================================================
   Soft status pills (2026-07-02)
   status_badge() emits solid light-mode Tailwind chips (bg-yellow-100 etc.)
   that sit harsh and opaque on dark glass cards. Soften them to translucent
   tints ONLY where customer rows render them (.wtx wallet rows, orders rows,
   dashboard activity rows) — the shared helper + admin tables are untouched.
   The 72% text mix auto-adapts to light/dark themes.
   ========================================================================== */
.wtx .bg-yellow-100, [data-order-status] .bg-yellow-100, .cb-act-row .bg-yellow-100,
.wtx .bg-orange-100, [data-order-status] .bg-orange-100, .cb-act-row .bg-orange-100 {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: color-mix(in srgb, #f59e0b 72%, var(--text)); font-weight: 600;
}
.wtx .bg-blue-100, [data-order-status] .bg-blue-100, .cb-act-row .bg-blue-100 {
  background: color-mix(in srgb, #3b82f6 15%, transparent);
  color: color-mix(in srgb, #3b82f6 72%, var(--text)); font-weight: 600;
}
.wtx .bg-green-100, [data-order-status] .bg-green-100, .cb-act-row .bg-green-100 {
  background: color-mix(in srgb, #10b981 16%, transparent);
  color: color-mix(in srgb, #10b981 72%, var(--text)); font-weight: 600;
}
.wtx .bg-red-100, [data-order-status] .bg-red-100, .cb-act-row .bg-red-100 {
  background: color-mix(in srgb, #f43f5e 15%, transparent);
  color: color-mix(in srgb, #f43f5e 72%, var(--text)); font-weight: 600;
}
.wtx .bg-purple-100, [data-order-status] .bg-purple-100, .cb-act-row .bg-purple-100 {
  background: color-mix(in srgb, #a855f7 15%, transparent);
  color: color-mix(in srgb, #a855f7 72%, var(--text)); font-weight: 600;
}
.wtx .bg-gray-100, [data-order-status] .bg-gray-100, .cb-act-row .bg-gray-100,
.wtx .bg-slate-200, [data-order-status] .bg-slate-200, .cb-act-row .bg-slate-200,
.wtx .bg-zinc-300, [data-order-status] .bg-zinc-300, .cb-act-row .bg-zinc-300 {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-muted); font-weight: 600;
}
