/* ============================================
   CIPHER PRO — Design System & Styles
   Neo-Futuristic Dark Mode + Glassmorphism
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Backgrounds */
  --bg-primary: #06060e;
  --bg-secondary: #0c0c18;
  --bg-tertiary: #111122;

  /* Accent Colors */
  --accent-blue: #00d4ff;
  --accent-blue-dim: #0088aa;
  --accent-blue-glow: rgba(0, 212, 255, 0.4);
  --accent-silver: #b8c0d0;
  --accent-purple: #7b5ea7;
  --accent-cyan: #00e5ff;

  /* Text */
  --text-primary: #eaf0ff;
  --text-secondary: rgba(234, 240, 255, 0.6);
  --text-muted: rgba(234, 240, 255, 0.35);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(0, 212, 255, 0.25);
  --glass-blur: 24px;
  --glass-radius: 20px;

  /* Spacing */
  --section-padding: 100px 60px;
  --card-padding: 36px 32px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.7s cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts */
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: auto; /* We handle smooth scroll manually via JS lerp */
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  /* Account for the fixed navbar so anchor scrolls don't tuck content under it. */
  scroll-padding-top: 80px;
  /* Reserve a permanent gutter for the vertical scrollbar.
     Without this, .navbar (position:fixed) spans the full viewport _including_
     the scrollbar, but body / .section content sits inside the scrollbar -- so
     anything centered on the section (.scroll-indicator, headings, hero CTAs)
     drifts ~8 px left of the navbar's visual centre on Windows. The gutter
     pulls the fixed-positioning containing block in by the scrollbar's width
     so navbar and content share the exact same horizontal centre. */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  /* Eliminate the dark grey iOS/Android tap flash on links and buttons. */
  -webkit-tap-highlight-color: transparent;
}

/* Buttons and links must hit the WCAG 44x44 px touch target on touch screens. */
@media (pointer: coarse) {
  button, .btn, a.btn, .auth-tab, .nav-hamburger, .nav-links a {
    min-height: 44px;
  }
}

/* Respect users who set the OS-level reduce-motion preference. */
@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;
  }
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-cyan);
}

/* ---------- Custom Cursor ---------- */
@media (pointer: fine) {
  *, *::before, *::after {
    cursor: none !important;
  }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue-glow), 0 0 24px var(--accent-blue-glow);
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, opacity 0.2s ease;
  will-change: transform;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 212, 255, 0.35);
  pointer-events: none;
  z-index: 99998;
  opacity: 0;
  transition: width 0.3s cubic-bezier(0.16,1,0.3,1), height 0.3s cubic-bezier(0.16,1,0.3,1),
              border-color 0.3s ease, opacity 0.2s ease, background 0.3s ease;
  will-change: transform;
}

/* Hover state — ring grows, dot shrinks */
.cursor-ring.hovering {
  width: 52px;
  height: 52px;
  border-color: rgba(0, 212, 255, 0.55);
  background: rgba(0, 212, 255, 0.06);
}

.cursor-dot.hovering {
  width: 4px;
  height: 4px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255,255,255,0.5);
}

/* Press state — ring shrinks */
.cursor-ring.pressing {
  width: 28px;
  height: 28px;
  border-color: rgba(0, 212, 255, 0.7);
}

.cursor-dot.pressing {
  width: 8px;
  height: 8px;
}

/* Hide on touch devices */
@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ---------- Three.js Canvas ---------- */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
}

/* On data-saver / metered connections, drop the GPU canvas to save
   battery + bandwidth. The page still works -- it just gets a flat
   gradient background instead of the live 3D scene. */
@media (prefers-reduced-data: reduce) {
  #three-canvas { display: none; }
  body {
    background:
      radial-gradient(ellipse at top, rgba(0, 212, 255, 0.08), transparent 60%),
      var(--bg-primary);
  }
}

/* ---------- Page Content Overlay ---------- */
.page-content {
  position: relative;
  z-index: 1;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* env(safe-area-inset-*) keeps the bar clear of the iPhone notch. */
  padding: 18px 40px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-left: max(40px, env(safe-area-inset-left));
  padding-right: max(40px, env(safe-area-inset-right));
  background: rgba(6, 6, 14, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition-medium), 
              box-shadow var(--transition-medium),
              border-color var(--transition-medium);
}

.navbar.scrolled {
  background: rgba(6, 6, 14, 0.55);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 12px var(--accent-blue-glow), 0 0 30px var(--accent-blue-glow);
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 12px var(--accent-blue-glow), 0 0 30px var(--accent-blue-glow); }
  50% { box-shadow: 0 0 20px var(--accent-blue-glow), 0 0 50px var(--accent-blue-glow); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue-glow);
  transition: width var(--transition-medium);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  background: none;
  border: none;
  /* The button itself becomes the touch target -- 44x44 minimum. */
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-fast),
              opacity var(--transition-fast);
  transform-origin: center;
}

/* Animate the three bars into an X when the menu is open. The class is
   toggled in app.js whenever .nav-links.open flips. */
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Sections Base ---------- */
.section {
  /* Fall back to 100vh on browsers that don't know dvh, then use the
     dynamic viewport unit so the section doesn't jump when the mobile
     URL bar slides in/out. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-padding);
  position: relative;
}

.section-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 550px;
  margin: 0 auto 60px;
  line-height: 1.7;
}

/* ---------- Section Reveal Animation ---------- */
.reveal-element {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-element:nth-child(2) { transition-delay: 0.1s; }
.reveal-element:nth-child(3) { transition-delay: 0.2s; }
.reveal-element:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   SECTION 1 — HERO
   ============================================ */
.hero {
  text-align: center;
  padding-top: 80px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 100px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 32px;
  animation: badgeFadeIn 1s ease-out 0.2s both;
}

.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes badgeFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: heroTitleIn 1s ease-out 0.4s both;
}

.hero-title .title-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-blue) 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes heroTitleIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 2vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
  animation: heroSubIn 1s ease-out 0.6s both;
}

@keyframes heroSubIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 300;
  margin-bottom: 48px;
  animation: heroSubIn 1s ease-out 0.8s both;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: heroSubIn 1s ease-out 1s both;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-medium);
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0099cc 100%);
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

/* ---------- Scroll Indicator ---------- */
.scroll-indicator {
  /* Manual nudge in case the visual centre still feels off. Increase the
     value (e.g. 12px, 16px) to push further left, or set to 0 to disable. */
  --scroll-indicator-nudge: -12px;

  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(calc(-50% - var(--scroll-indicator-nudge)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  /* Use a dedicated keyframe so the entrance animation preserves our
     horizontal translate. The shared `heroSubIn` only animates translateY,
     which would otherwise overwrite the X-axis centring (and the manual
     nudge) once the animation reaches its `to` keyframe. */
  animation: scrollIndicatorIn 1s ease-out 1.2s both;
}

@keyframes scrollIndicatorIn {
  from {
    opacity: 0;
    transform: translateX(calc(-50% - var(--scroll-indicator-nudge))) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(calc(-50% - var(--scroll-indicator-nudge))) translateY(0);
  }
}

.scroll-indicator .mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 14px;
  position: relative;
}

.scroll-indicator .mouse .wheel {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-blue);
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(14px); }
}

.scroll-indicator .scroll-text {
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  /* `letter-spacing` adds 3px _after_ the last letter too, which shifts the
     visible glyphs 3px to the right relative to the mouse icon above. The
     left-padding cancels that trailing space so the word lines up dead centre. */
  padding-left: 3px;
}

/* ============================================
   SECTION 2 — FEATURES
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  padding: var(--card-padding);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.feature-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 40px rgba(0, 212, 255, 0.05);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: all var(--transition-medium);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent-blue);
  fill: none;
  stroke-width: 1.5;
  transition: filter var(--transition-medium);
}

.feature-card:hover .feature-icon {
  background: rgba(0, 212, 255, 0.14);
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.feature-card:hover .feature-icon svg {
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ============================================
   SECTION 3 — PRICING
   ============================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: stretch;
}

.pricing-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  padding: 30px 24px 26px;
  text-align: center;
  transition: all var(--transition-medium);
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4),
              0 0 50px rgba(0, 212, 255, 0.06);
}

.pricing-card.featured {
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.04);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.08);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 18px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent-blue), #0099cc);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pricing-card .plan-name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pricing-card .plan-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pricing-card .plan-price {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-card .plan-price .currency {
  font-size: 1.2rem;
  vertical-align: super;
  margin-right: 2px;
  color: var(--accent-blue);
}

.pricing-card .plan-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pricing-card .plan-features {
  list-style: none;
  margin-bottom: 22px;
  flex-grow: 1;
}

.pricing-card .plan-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pricing-card .plan-features li .check-icon {
  color: var(--accent-blue);
  font-size: 0.9rem;
}

.pricing-card .btn {
  width: 100%;
  justify-content: center;
}

/* Shopify reports the variant as out-of-stock -- desaturate the card
   and the price so the user can see at a glance the plan exists but
   isn't currently buyable. The CTA itself is rewritten to "Sold Out"
   in shopify-pricing.js. */
.pricing-card.sold-out {
  opacity: 0.55;
  filter: saturate(0.4);
}
.pricing-card.sold-out:hover {
  transform: none;
  border-color: var(--glass-border);
}

/* --- Sale presentation (compareAtPrice from Shopify) ---
   When the admin sets a sale price the card grows a strikethrough old
   price above the live price plus a small "-20%" badge in the corner.
   Both are populated and shown by shopify-pricing.js. */
.pricing-card .plan-old-price {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 90, 120, 0.7);
  text-decoration-thickness: 2px;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.pricing-card .plan-sale-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: linear-gradient(135deg, #ff5a78, #ff8a3d);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(255, 90, 120, 0.35);
  z-index: 2;
}

/* The "Best Seller" pill on a featured card sits centered above the
   top edge (top: -12px, left: 50%), so it doesn't share corner space
   with the sale badge. Keep the sale badge anchored in the same
   top-right corner as on the non-featured cards for a consistent
   visual rhythm across the row. */
.pricing-card.featured .plan-sale-badge {
  top: 18px;
}

.pricing-card.on-sale .plan-price {
  background: linear-gradient(135deg, #ff5a78, #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Site-wide sale banner ------------------------------------------ */
/* Shown above the pricing grid only when /v1/sale/active reports an
   active sale. The shimmer animation pulls attention without being
   obnoxious; the (optional) countdown adds urgency for time-boxed
   sales. The banner shares the same width as .coupon-bar so the two
   stack cleanly when both are visible. */
.sale-banner {
  max-width: 720px;
  margin: 0 auto 22px;
  padding: 0;
  border-radius: 16px;
  /* Layered: subtle gradient base + a high-contrast linear-gradient
     animated overlay for the shimmer. The overlay sits on a
     pseudo-element so the inner content stays crisp. */
  background:
    linear-gradient(135deg,
      rgba(255, 75, 110, 0.18) 0%,
      rgba(0, 212, 255, 0.18) 50%,
      rgba(123, 94, 167, 0.18) 100%);
  border: 1px solid rgba(255, 90, 120, 0.35);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 6px 24px rgba(255, 75, 110, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: saleBannerIn 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.sale-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 70%);
  background-size: 250% 100%;
  animation: saleShimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}

.sale-banner-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.sale-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5a78 0%, #ff8c42 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(255, 90, 120, 0.55);
  animation: salePulse 1.8s ease-in-out infinite;
}

@keyframes salePulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 14px rgba(255, 90, 120, 0.45); }
  50%      { transform: scale(1.1); box-shadow: 0 0 22px rgba(255, 90, 120, 0.75); }
}

.sale-banner-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 200px;
}

.sale-banner-text strong {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ff8aa3;
  text-shadow: 0 0 10px rgba(255, 90, 120, 0.4);
}

.sale-banner-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.sale-banner-sub #sale-percent {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff5a78 0%, #ffa85a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 2px;
}

.sale-banner-timer {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sale-banner-timer-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sale-banner-timer-value {
  font-family: var(--font-mono, ui-monospace, 'Courier New', monospace);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ff8aa3;
  font-variant-numeric: tabular-nums;
  /* Tabular nums keep the timer width fixed so it doesn't shift the
     surrounding layout every second when digits change. */
}

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

@keyframes saleBannerIn {
  0%   { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0);    }
}

@media (max-width: 540px) {
  .sale-banner-inner {
    gap: 10px;
    padding: 12px 16px;
  }
  .sale-banner-text strong { font-size: 0.7rem; }
  .sale-banner-sub         { font-size: 0.9rem; }
  .sale-banner-timer       { padding: 5px 10px; }
}

/* --- Coupon bar ------------------------------------------------------ */
.coupon-bar {
  max-width: 460px;
  margin: 0 auto 28px;
  padding: 12px 18px 12px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.coupon-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.coupon-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.coupon-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.coupon-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(0, 212, 255, 0.06);
}

.coupon-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.coupon-apply {
  flex: 0 0 auto;
  padding: 0 22px;
  font-size: 0.85rem;
}

.coupon-clear {
  flex: 0 0 auto;
  width: 40px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.coupon-clear:hover {
  color: #ff5a78;
  border-color: rgba(255, 90, 120, 0.5);
}

.coupon-status {
  margin-top: 7px;
  min-height: 1.05em;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.coupon-status--ok  { color: #4ade80; }
.coupon-status--err { color: #ff5a78; }

/* ============================================
   SECTION 4 — AUTH & FOOTER
   ============================================ */
.auth-section {
  padding-bottom: 40px;
}

.auth-container {
  max-width: 440px;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-blue);
  box-shadow: 0 2px 10px rgba(0, 212, 255, 0.1);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden {
  display: none;
}

/* Phone field is rendered hidden by default; the .auth-switch-link below
   each form unhides it on click. Without this rule both inputs would stack. */
.input-group.hidden {
  display: none;
}

.input-group {
  position: relative;
}

.input-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

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

.input-group input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1),
              0 0 20px rgba(0, 212, 255, 0.08);
}

.auth-form .btn {
  margin-top: 4px;
  justify-content: center;
  width: 100%;
}

.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--glass-border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ---------- Footer ---------- */
.footer {
  padding: 40px 60px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 80px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-blue);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px 32px;
    --card-padding: 28px 24px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 720px;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer {
    padding: 32px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --section-padding: 72px 20px;
    --card-padding: 24px 20px;
  }

  .navbar {
    padding: 14px 20px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(6, 6, 14, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px max(16px, env(safe-area-inset-bottom));
    gap: 4px;
    border-bottom: 1px solid var(--glass-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 8px;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero {
    padding-top: 90px;
  }

  .hero-title {
    letter-spacing: 3px;
  }

  .hero-tagline {
    margin-bottom: 36px;
  }

  .hero-cta-group {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  /* === Mobile: turn the 4-column grid into a swipe carousel ===
     Stacking four cards vertically eats too much vertical real-estate
     on a phone, so we lay them out as a horizontal flex strip with
     scroll-snap so each swipe lands the next card dead-centre. The
     `peek` (calc(100% - 56px)) leaves a visible sliver of the next card
     on the right, telling users at a glance that there's more to scroll. */
  .pricing-grid {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    gap: 16px;
    max-width: none;
    margin: 0 -20px;                     /* bleed past .section padding */
    padding: 8px 20px 24px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;               /* Firefox -- hide the bar */
    overscroll-behavior-x: contain;      /* don't scroll the page horizontally */
  }
  .pricing-grid::-webkit-scrollbar {
    display: none;                        /* Chrome / Safari -- hide the bar */
  }

  .pricing-card {
    flex: 0 0 calc(100% - 56px);         /* one card per "page" + peek */
    max-width: 360px;
    min-width: 0;
    scroll-snap-align: start;
  }

  /* The desktop scale-up hover lifts the featured card past the
     viewport edge on phones; flatten it for touch screens. */
  .pricing-card:hover {
    transform: none;
  }

  .pricing-card .plan-price {
    font-size: 2.25rem;
  }

  .pricing-card .plan-old-price {
    font-size: 0.9rem;
  }

  .pricing-card .plan-sale-badge {
    top: 14px;
    right: 14px;
    font-size: 0.65rem;
    padding: 5px 10px;
  }

  .pricing-card.featured .plan-sale-badge {
    top: 14px;
  }

  /* Coupon bar -- shrink the gap to the cards and stack the input full-width. */
  .coupon-bar {
    margin: 0 auto 32px;
    padding: 14px 16px 12px;
    max-width: 380px;
  }

  .auth-container {
    padding: 28px 20px;
  }

  .input-group input {
    /* 16px font keeps iOS Safari from auto-zooming the page on focus. */
    font-size: 16px;
    padding: 14px 14px;
  }

  .footer {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 30px 20px max(30px, env(safe-area-inset-bottom));
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 20px;
  }

  .scroll-indicator {
    bottom: 24px;
  }
}

/* Small Mobile (iPhone SE-class, 360-400 px wide) */
@media (max-width: 400px) {
  :root {
    --section-padding: 64px 16px;
  }

  .hero-title {
    letter-spacing: 2px;
  }

  .hero-tagline {
    letter-spacing: 3px;
    font-size: 0.8rem;
  }

  .hero-badge {
    font-size: 0.65rem;
    padding: 7px 16px;
  }

  .pricing-card {
    padding: 32px 22px 28px;
  }

  /* Tiny screens: the section padding shrinks to 16px, so the carousel's
     negative margin / inner padding need to follow suit -- otherwise the
     edge-bleed shifts 4 px past the viewport and slightly clips the cards. */
  .pricing-grid {
    margin: 0 -16px;
    padding: 8px 16px 24px;
    scroll-padding-left: 16px;
  }

  /* On the tiniest phones drop the Apply button onto its own row so the
     input keeps a comfortable tap target. */
  .coupon-row {
    flex-wrap: wrap;
  }
  .coupon-input {
    flex: 1 1 100%;
  }
  .coupon-apply {
    flex: 1 1 auto;
  }

  .auth-tab {
    font-size: 0.75rem;
    padding: 12px 12px;
    letter-spacing: 0.5px;
  }
}

/* Very small phones (Galaxy Fold closed, ancient devices). Tightens
   typography so the title doesn't wrap to 4 lines. */
@media (max-width: 360px) {
  .hero-title {
    letter-spacing: 1px;
    word-spacing: -0.05em;
  }

  .hero-cta-group {
    max-width: 280px;
  }
}

/* ---------- Utility: Loading Screen ---------- */
.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-orb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-blue);
  animation: loaderSpin 0.8s linear infinite;
}

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


/* ============================================
   AUTH SECTION -- ID TOGGLE, OTP MODAL, ERRORS
   Added when we wired the form to /v1/auth/*.
   ============================================ */

/* Pill toggle for Email vs Phone */
.auth-id-toggle {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  background: rgba(8, 12, 24, 0.6);
  border: 1px solid rgba(120, 160, 255, 0.18);
  border-radius: 12px;
}

.auth-id-btn {
  flex: 1;
  padding: 9px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: rgba(180, 196, 230, 0.7);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-id-btn:hover { color: #f3f6ff; }

.auth-id-btn.is-active {
  color: #f3f6ff;
  background: linear-gradient(135deg, rgba(99, 132, 255, 0.30), rgba(180, 99, 255, 0.22));
  box-shadow: 0 4px 14px rgba(99, 132, 255, 0.18);
}

/* In-form error -- red, gentle */
.auth-error {
  margin: 4px 0 6px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #ffd6d6;
  background: rgba(80, 18, 28, 0.45);
  border: 1px solid rgba(255, 99, 122, 0.45);
  border-radius: 10px;
}

.auth-error[hidden] { display: none; }

/* Foot links: forgot password, identifier-switch link, terms blurb */
.auth-tab-foot {
  margin: 12px 0 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(180, 196, 230, 0.7);
  text-align: center;
}

.auth-tab-foot a {
  color: #8db2ff;
  text-decoration: none;
  font-weight: 500;
}

.auth-tab-foot a:hover {
  color: #b3c8ff;
  text-decoration: underline;
}

.auth-tab-foot a.disabled {
  pointer-events: none;
  color: rgba(141, 178, 255, 0.4);
}

/* Visual dot between the two foot links so they don't look mashed together. */
.auth-foot-sep {
  display: inline-block;
  margin: 0 8px;
  color: rgba(180, 196, 230, 0.4);
  user-select: none;
}

/* The id-mode toggle link ("Sign in with phone instead"). It lives in
   .auth-tab-foot so it inherits the colour, but we make it slightly more
   prominent with an underline-on-hover and a subtle arrow-like dotted line. */
.auth-switch-link {
  display: inline-block;
  cursor: pointer;
}

/* Inline hints below inputs */
.auth-hint {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(180, 196, 230, 0.55);
  line-height: 1.5;
}

.auth-optional {
  font-weight: 400;
  font-size: 11px;
  color: rgba(180, 196, 230, 0.5);
  margin-left: 6px;
}

/* Block button used in modals */
.btn-block {
  display: block;
  width: 100%;
}

/* Disabled (busy) state for any submit */
.btn:disabled,
.btn-primary:disabled {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
}

/* ============================================
   OTP / FORGOT MODAL
   ============================================ */

.otp-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.otp-modal[hidden] { display: none; }

.otp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.otp-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 24px;
  background: linear-gradient(160deg, rgba(15, 19, 38, 0.96), rgba(11, 14, 30, 0.96));
  border: 1px solid rgba(120, 160, 255, 0.22);
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: center;
  animation: otpPop 0.22s ease;
}

@keyframes otpPop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.otp-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 30px;
  color: rgba(180, 196, 230, 0.6);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.otp-close:hover {
  color: #f3f6ff;
  background: rgba(255, 255, 255, 0.06);
}

.otp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  color: #8db2ff;
  background: linear-gradient(135deg, rgba(99, 132, 255, 0.20), rgba(180, 99, 255, 0.15));
  border: 1px solid rgba(120, 160, 255, 0.30);
  border-radius: 16px;
}

.otp-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: #f3f6ff;
  letter-spacing: 0.01em;
}

.otp-sub {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(180, 196, 230, 0.75);
}

.otp-sub strong {
  color: #f3f6ff;
  font-weight: 600;
}

.otp-input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-family: 'Courier New', monospace, system-ui;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-align: center;
  color: #f3f6ff;
  background: rgba(8, 12, 24, 0.65);
  border: 1px solid rgba(120, 160, 255, 0.25);
  border-radius: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.otp-input:focus {
  outline: none;
  border-color: rgba(141, 178, 255, 0.65);
  background: rgba(12, 16, 32, 0.85);
}

/* Prevent page scroll while a modal is open */
body.otp-open {
  overflow: hidden;
}

/* Mobile: stay readable on tiny screens */
@media (max-width: 480px) {
  .otp-card {
    padding: 24px 18px 18px;
    max-width: 92vw;
  }
  .otp-input {
    font-size: 18px;
    letter-spacing: 0.34em;
  }
  .auth-id-btn {
    font-size: 12.5px;
    padding: 8px 6px;
  }
}
