/* ============================================
   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;
}

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 {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: heroSubIn 1s ease-out 1.2s both;
}

.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);
}

/* ============================================
   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: 40px 28px 36px;
  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.5rem;
  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: 28px;
}

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

.pricing-card .plan-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 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;
}

/* On a featured card the "Best Seller" pill already lives in the top-right;
   shift the sale badge below it so they don't collide. */
.pricing-card.featured .plan-sale-badge {
  top: 56px;
}

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

/* --- Coupon bar ------------------------------------------------------ */
.coupon-bar {
  max-width: 520px;
  margin: 0 auto 48px;
  padding: 18px 22px 16px;
  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.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.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: 10px;
  min-height: 1.1em;
  font-size: 0.82rem;
  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: 460px;
  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: 40px 36px;
  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: 32px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  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: 18px;
}

.auth-form.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: 14px 16px;
  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: 8px;
  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;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin: 0 auto;
  }

  /* 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: 50px;
  }

  /* 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;
  }

  /* 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); }
}
