/* ==========================================================================
   STORY MAKER - CUSTOM STYLESHEET
   Aesthetic: Warm, Humanist, Editorial
   ========================================================================== */

/* Design Tokens & Custom Properties */
:root {
  /* Editorial Color Scheme (Modern Dark Mode) */
  --color-bg: #050505;
  --color-surface: #121212;
  --color-text: #FFFFFF;
  --color-text-muted: #B0B0B8;
  --color-border: #222225;
  
  /* Primary and Highlight Accents */
  --color-accent: #FFD400;      /* Zynova Yellow */
  --color-sage: #00D4FF;        /* AI Blue */
  --color-gold: #FFD400;        /* Zynova Yellow */
  
  /* Tiers Accent Colors */
  --color-tier-0: #00D4FF;      /* Free - AI Blue */
  --color-tier-1: #FFD400;      /* Core - Zynova Yellow */
  --color-tier-2: #FF8C00;      /* Story Pack 2 - Orange */
  --color-tier-3: #AE00FF;      /* Pro - Violet */
  --color-tier-4: #00FF87;      /* Ultimate - Neon Green */

  /* Fonts */
  --font-headings: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;

  /* Layout Constants */
  --header-height: 70px;
  --sidebar-width: 280px;

  /* Borders & Shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(42, 42, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(42, 42, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(42, 42, 42, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

input, select, textarea {
  color: var(--color-text);
}

input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}

h1 {
  font-size: 2.5rem;
  letter-spacing: 0;
}

h2 {
  font-size: 1.85rem;
  margin-bottom: var(--space-sm);
  letter-spacing: 0;
}

h3 {
  font-size: 1.35rem;
  letter-spacing: 0;
}

p {
  font-size: 1rem;
  color: var(--color-text-muted);
}

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

a:hover {
  color: var(--color-sage);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.45);
  outline-offset: 3px;
}

body.modal-open,
body.nav-open {
  overflow: hidden;
}

/* Button & Controls Design System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-full-width {
  display: flex;
  width: 100%;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #050505;
}

.btn-primary:hover {
  background-color: #E6BE00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 212, 0, 0.25);
  color: #050505;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.btn-text {
  background-color: transparent;
  color: var(--color-text-muted);
}

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

.btn-accent {
  background-color: var(--color-gold);
  color: #050505;
}

.btn-accent:hover {
  background-color: #E6BE00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 212, 0, 0.25);
  color: #050505;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

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

/* Simulated Auth Visibility Engine */
body:not(.logged-in) .auth-in {
  display: none !important;
}

body.logged-in .auth-out {
  display: none !important;
}

/* Sticky Top Bar Chrome */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Hamburger button */
.hamburger-btn {
  display: none; /* Desktop hidden */
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 14px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* Brand Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text);
  font-family: var(--font-headings);
  font-size: 1.35rem;
  font-weight: 800;
}

.logo-mark {
  font-size: 1.6rem;
  transform: translateY(-1px);
}

.logo-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background-color: rgba(0, 212, 255, 0.15);
  color: #00D4FF;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 800;
  vertical-align: middle;
}

/* Header Search */
.top-bar-search {
  margin-left: var(--space-md);
  width: 320px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 8px 14px 8px 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.25);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(0, 212, 255, 0.12);
  color: var(--color-sage);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.badge-btn:hover {
  background-color: rgba(0, 212, 255, 0.22);
}

/* User Avatar Initial */
.profile-menu-wrapper {
  position: relative;
}

.avatar {
  width: 36px;
  height: 36px;
  background-color: var(--color-accent);
  color: var(--color-surface);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.avatar:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.profile-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 300px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 1200;
}

.profile-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 14px;
  width: 14px;
  height: 14px;
  background-color: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.profile-menu-wrapper:hover .profile-popover,
.profile-menu-wrapper:focus-within .profile-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-popover-head {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.profile-mini-avatar,
.profile-large-avatar {
  background-color: var(--color-accent);
  color: var(--color-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-mini-avatar {
  width: 36px;
  height: 36px;
}

.profile-popover-head strong,
.profile-popover-head span {
  display: block;
}

.profile-popover-head span {
  max-width: 210px;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-popover-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.profile-popover-stats span {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.profile-popover-stats b {
  display: block;
  color: var(--color-text);
  font-family: var(--font-headings);
  font-size: 1.1rem;
  line-height: 1;
}

.profile-popover p {
  margin-bottom: var(--space-xs);
  font-size: 0.78rem;
}

/* App Shell Layout */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
  width: 100%;
  position: relative;
}

/* Left Sidebar (Gated, Fixed) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) var(--space-md);
  min-height: 100%;
  gap: var(--space-lg);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
}

.sidebar-title {
  font-size: 0.75rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  padding-left: var(--space-xs);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--color-text-muted);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  color: var(--color-accent);
  background-color: rgba(255, 212, 0, 0.15);
  font-weight: 600;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sidebar Bottom Element Box */
.sidebar-bottom {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.btn-upgrade-sidebar {
  background: linear-gradient(135deg, #FFD400, #FF8C00);
  color: #050505;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(255, 212, 0, 0.15);
}

.btn-upgrade-sidebar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(255, 212, 0, 0.25);
  color: #050505;
}

.btn-logout {
  color: var(--color-text-muted);
}

.sidebar-footer-text {
  font-size: 0.7rem;
  color: #B2B2B2;
  text-align: center;
  margin-top: var(--space-xs);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex box blowouts */
}

.views-container {
  flex-grow: 1;
  padding: var(--space-xl) var(--space-lg);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  min-height: 500px;
}

/* View Sections Toggle Animation */
.view-section {
  display: none;
  opacity: 0;
}

.view-section.active-view {
  display: block;
  animation: viewTransition 0.45s var(--ease-smooth) forwards;
}

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

/* ==============================================
   VIEW: LANDING (Logged Out Hero + Cuboid)
   ============================================== */
.landing-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: center;
  padding-bottom: var(--space-xxl);
  border-bottom: 1px solid var(--color-border);
}

.landing-hero-content h1 {
  font-size: 3.25rem;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.badge-pill {
  display: inline-block;
  background-color: rgba(255, 212, 0, 0.15);
  color: var(--color-accent);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.hero-subtext {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.login-card-inline {
  width: min(100%, 640px);
  margin-bottom: var(--space-xl);
}

.login-field-row {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.login-field-row input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.login-field-row input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.15);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: 0;
}

/* Trust Stats */
.trust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-top: 1px dashed var(--color-border);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-headings);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* 3D Tilted Cuboid Visual */
.landing-hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 350px;
}

.scene-3d-wrapper {
  width: 250px;
  height: 250px;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cuboid {
  width: 140px;
  height: 140px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateCuboid 18s linear infinite;
}

.face {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headings);
  font-size: 15px;
  font-weight: 700;
  color: white;
  text-align: center;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.15);
}

/* Faces colors */
.face.front { background: linear-gradient(135deg, rgba(255, 212, 0, 0.85), rgba(0, 212, 255, 0.85)); transform: translateZ(70px); }
.face.back { background: linear-gradient(135deg, rgba(174, 0, 255, 0.85), rgba(0, 212, 255, 0.85)); transform: rotateY(180deg) translateZ(70px); }
.face.right { background: linear-gradient(135deg, rgba(0, 255, 135, 0.85), rgba(255, 212, 0, 0.85)); transform: rotateY(90deg) translateZ(70px); }
.face.left { background: linear-gradient(135deg, rgba(174, 0, 255, 0.85), rgba(0, 255, 135, 0.85)); transform: rotateY(-90deg) translateZ(70px); }
.face.top { background: linear-gradient(135deg, rgba(255, 212, 0, 0.85), rgba(0, 255, 135, 0.85)); transform: rotateX(90deg) translateZ(70px); }
.face.bottom { background: linear-gradient(135deg, rgba(255, 212, 0, 0.85), rgba(255, 140, 0, 0.85)); transform: rotateX(-90deg) translateZ(70px); }

@keyframes rotateCuboid {
  0% {
    transform: rotateX(-22deg) rotateY(145deg) rotateZ(0deg);
  }
  100% {
    transform: rotateX(-22deg) rotateY(505deg) rotateZ(360deg);
  }
}

/* Landing Info Section */
.landing-info-section {
  padding: var(--space-xxl) 0;
}

.section-title {
  font-size: 2.15rem;
  margin-bottom: var(--space-xl);
}

.text-center {
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.info-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.info-icon {
  font-size: 2.2rem;
  margin-bottom: var(--space-sm);
}

.info-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

/* ==============================================
   VIEW: DASHBOARD / OVERVIEW
   ============================================== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.welcome-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  font-weight: 700;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xxl);
}

.stat-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-card-icon.stories-available {
  background-color: rgba(255, 212, 0, 0.1);
  color: var(--color-accent);
}
.stat-card-icon.stories-unlocked {
  background-color: rgba(0, 255, 135, 0.1);
  color: var(--color-tier-4);
}
.stat-card-icon.free-samples {
  background-color: rgba(0, 212, 255, 0.1);
  color: var(--color-sage);
}
.stat-card-icon.packs-owned {
  background-color: rgba(174, 0, 255, 0.1);
  color: var(--color-tier-3);
}

.stat-card-info h3 {
  font-size: 1.5rem;
  line-height: 1.1;
}

.stat-card-info p {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Featured Row Horizontal Scroller */
.featured-row-wrapper {
  margin-bottom: var(--space-xxl);
}

.section-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-md);
}

.hint-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-sage);
}

.featured-scroller {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding: 4px 4px 16px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.featured-scroller::-webkit-scrollbar {
  height: 6px;
}

.featured-scroller::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: var(--radius-full);
}

/* Prompt Card base layout */
.prompt-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
}

.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.prompt-card:focus-within {
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: var(--shadow-md);
}

.featured-scroller .prompt-card {
  flex: 0 0 280px; /* Fixed width in horizontal layout */
  scroll-snap-align: start;
}

.prompt-card-cover-link {
  display: block;
  color: inherit;
}

.prompt-card-cover-link:hover {
  color: inherit;
}

/* Cover Image Placeholder Generator (SVG based) */
.card-cover {
  width: 100%;
  height: 170px;
  background-color: var(--color-bg);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.card-cover svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-cover svg image {
  transition: transform 0.45s var(--ease-smooth);
  transform-origin: center;
}

.prompt-card:hover .card-cover svg image {
  transform: scale(1.08);
}

.card-body {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.card-genre {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-sage);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-tier-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.card-tier-badge.tier-0 { background-color: rgba(0, 212, 255, 0.15); color: var(--color-tier-0); }
.card-tier-badge.tier-1 { background-color: rgba(255, 212, 0, 0.15); color: var(--color-tier-1); }
.card-tier-badge.tier-2 { background-color: rgba(255, 140, 0, 0.15); color: var(--color-tier-2); }
.card-tier-badge.tier-3 { background-color: rgba(174, 0, 255, 0.15); color: var(--color-tier-3); }
.card-tier-badge.tier-4 { background-color: rgba(0, 255, 135, 0.15); color: var(--color-tier-4); }

.prompt-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.5em; /* Constant height for grid align */
}

.prompt-card h3 a {
  color: inherit;
}

.prompt-card h3 a:hover {
  color: var(--color-accent);
}

.card-desc {
  font-size: 0.8rem;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer-action {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xs);
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-price-text {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text);
}

.card-price-text.free {
  color: var(--color-sage);
}

/* Browse All Section */
.browse-all-container {
  margin-bottom: var(--space-xxl);
}

.result-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Filters Bar Layout */
.filters-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.filter-search-group input {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.filter-search-group input:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
}

.filter-dropdowns {
  display: flex;
  gap: var(--space-xs);
}

.filter-dropdowns select {
  padding: 10px var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-dropdowns select:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
}

/* Prompts Grid System */
.prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.load-more-wrapper {
  display: flex;
  justify-content: center;
}

.empty-state {
  grid-column: 1 / -1;
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-xxs);
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto var(--space-md);
}

/* Categories Grid Section */
.categories-section {
  padding: var(--space-xxl) 0;
  border-top: 1px solid var(--color-border);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.category-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--color-text);
  font-family: var(--font-body);
  transition: all var(--transition-normal);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.category-card-emoji {
  font-size: 2.2rem;
  margin-bottom: var(--space-xs);
}

.category-card h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.category-card-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* FAQ Accordion Styling */
.faq-section {
  padding-top: var(--space-xxl);
  border-top: 1px solid var(--color-border);
}

.accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.accordion-item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-headings);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  transition: background-color var(--transition-fast);
}

.accordion-header:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.accordion-arrow {
  font-size: 1.35rem;
  color: var(--color-accent);
  line-height: 1;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) cubic-bezier(0, 1, 0, 1);
  padding: 0 var(--space-md);
}

.accordion-content p {
  padding-bottom: var(--space-md);
  font-size: 0.95rem;
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
  transition: max-height var(--transition-normal) cubic-bezier(1, 0, 1, 0);
}

.accordion-item.active .accordion-arrow {
  transform: rotate(45deg);
}

/* ==============================================
   VIEW: PRODUCT DETAIL
   ============================================== */
.product-breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
  font-weight: 500;
}

.back-link {
  color: var(--color-text-muted);
}

.back-link:hover {
  color: var(--color-accent);
}

.breadcrumb-sep {
  color: var(--color-border);
}

#product-bread-title {
  color: var(--color-text);
  font-weight: 600;
}

.product-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* Left Side Product Card */
.product-hero-panel {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-height) + var(--space-md));
}

.product-cover-wrapper {
  width: 100%;
  height: 320px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.product-cover-wrapper svg {
  width: 100%;
  height: 100%;
  display: block;
}

.product-cover-wrapper svg image {
  transition: transform 0.45s var(--ease-smooth);
  transform-origin: center;
}

.product-hero-panel:hover .product-cover-wrapper svg image {
  transform: scale(1.08);
}

.product-meta-card {
  padding: var(--space-md);
}

.pack-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.pack-badge.tier-0 { background-color: rgba(0, 212, 255, 0.15); color: var(--color-tier-0); }
.pack-badge.tier-1 { background-color: rgba(255, 212, 0, 0.15); color: var(--color-tier-1); }
.pack-badge.tier-2 { background-color: rgba(255, 140, 0, 0.15); color: var(--color-tier-2); }
.pack-badge.tier-3 { background-color: rgba(174, 0, 255, 0.15); color: var(--color-tier-3); }
.pack-badge.tier-4 { background-color: rgba(0, 255, 135, 0.15); color: var(--color-tier-4); }

.product-meta-card h1 {
  font-size: 1.85rem;
  margin-bottom: var(--space-xs);
}

.genre-tag-line {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-sage);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
}

.product-price {
  font-family: var(--font-headings);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.product-desc {
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.product-action-box {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

/* Right Side Locked Prompts Container */
.product-content-panel h2 {
  font-size: 1.6rem;
  margin-bottom: var(--space-sm);
}

.features-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.features-checklist li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.95rem;
}

/* Locked Content Box & Blur Filter */
.prompt-container-box {
  position: relative;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  min-height: 400px;
}

/* Blur state classes */
.prompt-container-box.locked .prompt-body-content {
  filter: blur(10px);
  opacity: 0.4;
  user-select: none;
  pointer-events: none;
}

.prompt-container-box.locked .gated-lock-overlay {
  display: flex;
}

.gated-lock-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 5, 5, 0.65);
  backdrop-filter: blur(2px);
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.lock-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modalTransition 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lock-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.lock-card h3 {
  font-size: 1.35rem;
  margin-bottom: var(--space-xs);
}

.lock-card p {
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
}

/* Prompt Content formatting */
.prompt-section {
  border-bottom: 1px dashed var(--color-border);
  padding: var(--space-md) 0;
}

.prompt-section:first-of-type {
  padding-top: 0;
}

.prompt-section:last-of-type {
  border-bottom: none;
}

.prompt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.prompt-section-header .btn {
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .prompt-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .prompt-section-header .btn {
    width: 100%;
  }
}

.prompt-section h4 {
  font-size: 1.15rem;
  color: var(--color-text);
}

.prompt-section-description {
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.prompt-template-display {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text);
  overflow-x: auto;
  white-space: pre-wrap;
  user-select: text;
}

/* Coloring pages list */
.image-prompts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.image-prompt-item {
  background-color: var(--color-bg);
  border-left: 3px solid var(--color-sage);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.image-prompt-item strong {
  color: var(--color-text);
}

.image-prompt-duo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-prompt-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 2px;
}

.image-prompt-item-header .btn {
  flex: 0 0 auto;
}

.image-prompt-duo span {
  display: block;
}

@media (max-width: 560px) {
  .image-prompt-item-header {
    align-items: stretch;
    flex-direction: column;
  }

  .image-prompt-item-header .btn {
    width: 100%;
  }
}

.example-uses-list {
  list-style: square;
  padding-left: var(--space-md);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.example-uses-list li {
  margin-bottom: 4px;
}

.prompt-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px dashed var(--color-border);
}

.sub-info-block h5 {
  font-size: 0.9rem;
  margin-bottom: var(--space-xxs);
}

.sub-info-block p {
  font-size: 0.8rem;
}

.guarantee-footer-note {
  font-size: 0.75rem;
  color: #B2B2B2;
  text-align: center;
  padding-top: var(--space-sm);
}

/* ==============================================
   VIEW: MY PURCHASES
   ============================================== */
.purchases-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.owned-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.owned-pack-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.owned-pack-icon-frame {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.owned-pack-info h4 {
  font-size: 1.15rem;
  line-height: 1.2;
}

.owned-pack-info p {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-sage);
}

/* ==============================================
   VIEW: PROSE VIEWS (About, Contact, etc.)
   ============================================== */
.prose-container {
  max-width: 750px;
  margin: 0 auto;
}

.lead-text {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.prose-view h2 {
  font-size: 1.65rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.prose-view p {
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.prose-view ul {
  padding-left: var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.prose-view li {
  margin-bottom: 6px;
}

.prose-cta {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.prose-cta h3 {
  font-size: 1.45rem;
  margin-bottom: var(--space-xxs);
}

.prose-cta p {
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

/* Warning Alerts */
.alert-box-warning {
  background-color: rgba(255, 212, 0, 0.08);
  border-left: 4px solid var(--color-gold);
  color: var(--color-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-md) 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Contact View Grid */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.contact-info-block h3 {
  font-size: 1.15rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xxs);
}

.contact-info-block p {
  font-size: 0.85rem;
}

.contact-info-block .hint-text {
  margin-top: var(--space-md);
  font-style: italic;
  font-size: 0.8rem;
}

/* Form Styles */
.standard-form {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  background-color: var(--color-bg);
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
}

/* Form Success box */
.form-success-box {
  display: none;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.4s var(--ease-smooth);
}

.success-icon {
  font-size: 3rem;
  margin-bottom: var(--space-xs);
}

.form-success-box h3 {
  font-size: 1.45rem;
  margin-bottom: var(--space-xs);
}

.form-success-box p {
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

/* Consistent Footer Chrome */
.marketing-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  padding: var(--space-xxl) var(--space-lg) var(--space-md) var(--space-lg);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(2, 0.8fr) 1.2fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.brand-col p {
  font-size: 0.85rem;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.footer-brand-title {
  font-family: var(--font-headings);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-text);
}

.social-icons {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.45);
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all var(--transition-fast);
}

.social-icons a:hover {
  color: var(--color-accent);
  background-color: rgba(255, 212, 0, 0.1);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

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

.newsletter-col p {
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.newsletter-form-inline {
  display: flex;
  gap: var(--space-xxs);
}

.newsletter-form-inline input {
  flex-grow: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.8rem;
  outline: none;
  background-color: var(--color-bg);
}

.newsletter-form-inline input:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
}

.newsletter-success {
  display: none;
  font-size: 0.8rem;
  color: var(--color-tier-3);
  font-weight: 600;
  margin-top: 8px;
}

.footer-copyright-bar {
  max-width: 1200px;
  margin: var(--space-md) auto 0 auto;
  text-align: center;
  font-size: 0.75rem;
  color: #B2B2B2;
}

/* ==============================================
   MODALS: HOW TO USE & UPGRADE
   ============================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-bg);
}

.modal-header h3 {
  font-size: 1.35rem;
}

.modal-close-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  max-height: 60vh;
}

.modal-subtitle {
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  text-align: center;
}

/* How to Use specific styles */
.step-chips {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.step-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.step-chip.active {
  background-color: var(--color-accent);
  color: var(--color-surface);
  box-shadow: 0 2px 6px rgba(217, 106, 74, 0.25);
}

.modal-slides-container {
  position: relative;
}

.modal-slide {
  display: none;
  text-align: center;
  animation: fadeIn 0.4s var(--ease-smooth);
}

.modal-slide.active-slide {
  display: block;
}

.slide-icon-large {
  font-size: 3.5rem;
  margin-bottom: var(--space-xs);
}

.modal-slide h4 {
  font-size: 1.35rem;
  margin-bottom: var(--space-sm);
}

.modal-slide p {
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.slide-tip {
  background-color: var(--color-bg);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-sm);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  text-align: left;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-bg);
}

.step-indicator-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Upgrade Modal Tabs & Cards */
.upgrade-dialog {
  max-width: 650px;
}

.upgrade-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.tab-btn {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-xs);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--transition-normal);
}

.tab-btn:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.tab-btn.active {
  background-color: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.tab-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text);
}

.tab-price {
  font-family: var(--font-headings);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text);
  margin-top: 4px;
}

/* Upgrade Panel Styling */
.tab-panel-content {
  animation: fadeIn 0.4s var(--ease-smooth);
}

.panel-hero {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background-color: var(--color-bg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
}

.panel-pack-icon {
  font-size: 2.2rem;
}

.panel-hero h4 {
  font-size: 1.25rem;
}

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

.panel-price-badge {
  margin-left: auto;
  font-family: var(--font-headings);
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--color-accent);
}

.panel-features-block {
  margin-bottom: var(--space-lg);
}

.panel-features-block h5 {
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.panel-features-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
}

.panel-features-list li {
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.checkout-action-box {
  margin-bottom: var(--space-lg);
}

.checkout-hint {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Key Activation Block */
.activation-box {
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-md);
}

.activation-box label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.activation-input-row {
  display: flex;
  gap: var(--space-xs);
}

.activation-input-row input {
  flex-grow: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}

.activation-input-row input:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
}

/* Profile Modal */
.profile-dialog {
  max-width: 640px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.profile-large-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.45rem;
}

.profile-hero h4 {
  font-size: 1.35rem;
  margin-bottom: 2px;
}

.profile-hero p {
  font-size: 0.86rem;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.avatar.has-photo,
.profile-mini-avatar.has-photo,
.profile-large-avatar.has-photo {
  background-position: center;
  background-size: cover;
  color: transparent;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.profile-stats-grid div {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  box-shadow: var(--shadow-sm);
}

.profile-stats-grid span {
  display: block;
  color: var(--color-accent);
  font-family: var(--font-headings);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.profile-stats-grid p {
  font-size: 0.75rem;
}

.profile-plan-section h4 {
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
}

.profile-plan-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.profile-plan-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-sm);
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  background-color: var(--color-surface);
}

.profile-plan-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
  font-size: 1.2rem;
}

.profile-plan-item h5 {
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.profile-plan-item p {
  font-size: 0.76rem;
}

.profile-plan-status {
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.profile-plan-status.owned {
  background-color: rgba(0, 255, 135, 0.15);
  color: var(--color-tier-4);
}

.profile-plan-status.locked {
  background-color: rgba(255, 212, 0, 0.15);
  color: var(--color-accent);
}

.profile-footer {
  gap: var(--space-xs);
}

.profile-password-section {
  border-top: 1px dashed var(--color-border);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
}

.profile-password-section h4 {
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
}

.profile-password-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.profile-password-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.profile-password-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-password-grid span {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-password-grid input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  padding: 10px 12px;
}

.profile-password-grid input:focus {
  border-color: var(--color-accent);
  background-color: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.15);
}

.profile-form-note {
  margin: -6px 0 0;
  font-size: 0.75rem;
}

/* ==============================================
   TOAST SYSTEM
   ============================================== */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-sm));
  right: var(--space-md);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  pointer-events: none;
}

.toast {
  background-color: var(--color-text);
  color: var(--color-surface);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  min-width: 250px;
  max-width: 380px;
  width: min(380px, calc(100vw - 32px));
  border-left: 4px solid var(--color-gold);
  animation: toastIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success { border-left-color: var(--color-tier-3); }
.toast.error { border-left-color: var(--color-accent); }
.toast.info { border-left-color: var(--color-gold); }

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

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to {
    transform: translateY(-20px) scale(0.92);
    opacity: 0;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */

/* Large Tablets & Small Desktops */
@media (max-width: 1024px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }
  
  .landing-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .hero-actions {
    justify-content: center;
  }

  .trust-stats {
    width: 100%;
  }

  .product-layout {
    grid-template-columns: 1fr;
  }
  
  .product-hero-panel {
    position: static;
  }
  
  .product-cover-wrapper {
    height: 250px;
  }
}

/* Tablets (Slide-in Sidebar Menu Setup) */
@media (max-width: 992px) {
  .hamburger-btn {
    display: flex;
  }

  .top-bar-search {
    display: none; /* Hide topbar search on tablet/mobile */
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: calc(100vh - var(--header-height));
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

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

  .footer-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-lg);
  }
  
  .newsletter-col {
    grid-column: span 2;
  }
}

/* Phones */
@media (max-width: 576px) {
  :root {
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
  }

  h1 {
    font-size: 1.95rem;
  }

  .landing-hero-content h1 {
    font-size: 2.15rem;
  }

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

  .trust-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .section-header-inline {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-xs);
  }

  .filters-bar {
    grid-template-columns: 1fr;
  }
  
  .filter-dropdowns {
    flex-direction: column;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .newsletter-col {
    grid-column: span 1;
  }
  
  .panel-features-list {
    grid-template-columns: 1fr;
  }
  
  .upgrade-tabs {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
  }

  .login-field-row {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    border-radius: var(--radius-md);
  }
  
  .modal-body {
    padding: var(--space-md);
  }
  
  .modal-header, .modal-footer {
    padding: var(--space-sm) var(--space-md);
  }
  
  .prompt-section-grid {
    grid-template-columns: 1fr;
  }

  .profile-popover {
    right: -8px;
    width: min(300px, calc(100vw - 24px));
  }

  .profile-stats-grid {
    grid-template-columns: 1fr;
  }

  .profile-password-grid {
    grid-template-columns: 1fr;
  }

  .profile-plan-item {
    grid-template-columns: auto 1fr;
  }

  .profile-plan-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .toast-container {
    top: calc(var(--header-height) + var(--space-xs));
    left: var(--space-sm);
    right: var(--space-sm);
  }
}

/* App is Loading Initial State Protection */
.loading-state .top-bar-search,
.loading-state .header-actions,
.loading-state .sidebar {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   FUNNEL PAGES (Sales, OTO, JV)
   ========================================================================== */

.funnel-page {
  background:
    linear-gradient(135deg, rgba(255, 212, 0, 0.07), transparent 32%),
    linear-gradient(225deg, rgba(0, 212, 255, 0.08), transparent 34%),
    var(--color-bg);
}

.funnel-page main {
  position: relative;
  z-index: 1;
  flex: 1;
}

.storypaws-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.app-page .top-bar,
.app-page .app-layout {
  position: relative;
  z-index: 1;
}

.storypaws-ambient span {
  position: absolute;
  display: block;
  opacity: 0.18;
  filter: blur(0.1px);
  animation-name: ambientDrift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.ambient-page {
  width: 46px;
  height: 58px;
  border: 1px solid rgba(255, 212, 0, 0.4);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 212, 0, 0.3) 49%, transparent 51%),
    linear-gradient(180deg, rgba(255, 212, 0, 0.14), rgba(0, 212, 255, 0.08));
  box-shadow: 0 12px 32px rgba(255, 212, 0, 0.08);
}

.ambient-book {
  width: 62px;
  height: 40px;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 8px 8px 4px 4px;
  background:
    linear-gradient(90deg, rgba(0, 212, 255, 0.12) 0 48%, rgba(255, 212, 0, 0.22) 49% 51%, rgba(0, 255, 135, 0.1) 52% 100%);
  transform-origin: center;
}

.ambient-spark {
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  clip-path: polygon(50% 0, 62% 34%, 100% 50%, 62% 66%, 50% 100%, 38% 66%, 0 50%, 38% 34%);
  box-shadow: 0 0 28px rgba(255, 212, 0, 0.3);
}

@keyframes ambientDrift {
  from {
    transform: translate3d(-8px, 10px, 0) rotate(-7deg) scale(0.94);
  }
  to {
    transform: translate3d(12px, -18px, 0) rotate(9deg) scale(1.04);
  }
}

.funnel-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.funnel-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 12px max(16px, calc((100vw - 1160px) / 2));
  background: rgba(5, 5, 5, 0.9);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(16px);
}

.funnel-header.compact {
  min-height: 64px;
}

.funnel-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 800;
  white-space: nowrap;
}

.funnel-brand:hover {
  color: var(--color-text);
}

.funnel-brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #050505;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.funnel-brand b {
  color: var(--color-accent);
}

.funnel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex: 1;
}

.funnel-nav a {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.funnel-nav a:hover {
  color: var(--color-accent);
}

.funnel-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.96fr);
  gap: var(--space-xl);
  align-items: center;
  min-height: min(720px, calc(100vh - 110px));
  padding: var(--space-xl) 0;
}

.funnel-hero-copy h1 {
  max-width: 780px;
  margin-bottom: var(--space-sm);
  font-size: 3.55rem;
  line-height: 1.05;
}

.funnel-page .hero-subtext {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.78);
}

.funnel-trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}

.funnel-trust-strip span,
.funnel-mini-metrics span {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 18, 0.78);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.funnel-trust-strip strong,
.funnel-mini-metrics strong {
  color: var(--color-accent);
  font-family: var(--font-headings);
  font-size: 1.45rem;
  line-height: 1;
}

.funnel-hero-media {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.funnel-device {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(5, 5, 5, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.44);
}

.funnel-device-bar {
  display: flex;
  gap: 6px;
  padding: 6px 2px 14px;
}

.funnel-device-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-border);
}

.funnel-device-bar span:first-child {
  background: var(--color-accent);
}

.funnel-device-grid {
  display: grid;
  gap: var(--space-sm);
}

.funnel-device-grid article {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.funnel-device-grid b {
  display: block;
  color: var(--color-text);
  margin-bottom: 4px;
}

.funnel-device-grid p {
  margin: 0;
  font-size: 0.88rem;
}

.funnel-cover-fan {
  position: absolute;
  inset: auto 0 -8px auto;
  display: flex;
  align-items: end;
  pointer-events: none;
}

.funnel-cover-fan img {
  width: 112px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.funnel-cover-fan img:nth-child(1) {
  transform: rotate(-10deg) translateX(22px);
}

.funnel-cover-fan img:nth-child(2) {
  transform: translateY(-18px);
  z-index: 1;
}

.funnel-cover-fan img:nth-child(3) {
  transform: rotate(10deg) translateX(-22px);
}

.funnel-band {
  padding: var(--space-xxl) 0;
  background: rgba(18, 18, 18, 0.72);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.funnel-section-heading {
  max-width: 760px;
  margin: 0 auto var(--space-xl);
  text-align: center;
}

.funnel-section-heading.align-left {
  margin-left: 0;
  text-align: left;
}

.funnel-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-xs);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-section-heading h2,
.funnel-guarantee h2,
.funnel-final-cta h2,
.funnel-contest h2 {
  font-size: 2.45rem;
}

.funnel-section-heading p,
.funnel-guarantee p,
.funnel-final-cta p {
  color: rgba(255, 255, 255, 0.76);
}

.funnel-demo-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.funnel-demo-step,
.funnel-compare-panel,
.funnel-example-card,
.funnel-price-card,
.funnel-promo-grid article,
.funnel-jv-card,
.funnel-terms-grid p,
.oto-price-box,
.oto-feature-grid article {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 18, 0.82);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
}

.funnel-demo-step {
  padding: var(--space-lg);
}

.funnel-demo-step span {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-sm);
  background: rgba(255, 212, 0, 0.14);
  color: var(--color-accent);
  font-weight: 800;
}

.funnel-demo-step h3,
.funnel-compare-panel h3,
.funnel-example-card h3,
.funnel-price-card h3,
.funnel-promo-grid h3,
.oto-feature-grid h2 {
  margin-bottom: var(--space-xs);
}

.funnel-split-section {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xxl) 0;
}

.funnel-genre-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
}

.funnel-genre-grid span,
.funnel-cost-list span {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.funnel-compare-grid,
.funnel-example-grid,
.funnel-promo-grid,
.funnel-terms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

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

.funnel-compare-panel,
.funnel-promo-grid article,
.funnel-terms-grid p {
  padding: var(--space-lg);
}

.funnel-compare-panel ul,
.funnel-price-card ul,
.oto-feature-grid ul,
.funnel-popup ul {
  list-style: none;
  display: grid;
  gap: 9px;
  margin: var(--space-md) 0 0;
  padding: 0;
}

.funnel-compare-panel li,
.funnel-price-card li,
.oto-feature-grid li,
.funnel-popup li {
  position: relative;
  padding-left: 22px;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.funnel-compare-panel li::before,
.funnel-price-card li::before,
.oto-feature-grid li::before,
.funnel-popup li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.funnel-example-card {
  overflow: hidden;
}

.funnel-example-card img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  background: var(--color-surface);
}

.funnel-example-card div {
  padding: var(--space-md);
}

.funnel-example-card span {
  color: var(--color-accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.funnel-problem-grid,
.funnel-contest {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-xl);
  align-items: center;
}

.funnel-cost-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
}

.funnel-price-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.funnel-price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 440px;
  padding: var(--space-lg);
}

.funnel-price-card.featured {
  border-color: rgba(255, 212, 0, 0.76);
  box-shadow: 0 20px 50px rgba(255, 212, 0, 0.1);
}

.funnel-price-card.tier-2 {
  border-top: 3px solid var(--color-tier-2);
}

.funnel-price-card.tier-3 {
  border-top: 3px solid var(--color-tier-3);
}

.funnel-price-card.tier-4 {
  border-top: 3px solid var(--color-tier-4);
}

.funnel-ribbon {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #050505;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.funnel-tier-label {
  color: var(--color-sage);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.funnel-price {
  margin: var(--space-xs) 0 var(--space-sm);
  color: var(--color-accent);
  font-family: var(--font-headings);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.funnel-price-card ul {
  flex: 1;
}

.funnel-guarantee {
  max-width: 840px;
  text-align: center;
}

.funnel-faq {
  padding: var(--space-xxl) 0;
}

.funnel-faq details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 18, 0.78);
  margin-bottom: var(--space-xs);
  overflow: hidden;
}

.funnel-faq summary {
  cursor: pointer;
  padding: var(--space-md);
  color: var(--color-text);
  font-weight: 800;
}

.funnel-faq details p {
  margin: 0;
  padding: 0 var(--space-md) var(--space-md);
}

.funnel-final-cta {
  padding: var(--space-xxl) 0;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(255, 212, 0, 0.12), rgba(0, 212, 255, 0.09)),
    var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.funnel-final-cta p {
  max-width: 680px;
  margin: 0 auto var(--space-lg);
}

.funnel-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  background: #050505;
}

.funnel-footer .funnel-shell {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.funnel-footer.compact .funnel-shell {
  min-height: 58px;
}

.funnel-footer span {
  color: var(--color-text);
  font-weight: 800;
}

.funnel-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.funnel-footer a {
  color: var(--color-text-muted);
  font-weight: 700;
}

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

.oto-page {
  min-height: 100vh;
}

.oto-main {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 122px);
  padding: var(--space-lg) 0;
}

.oto-wrap {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  text-align: center;
}

.oto-alert {
  display: inline-flex;
  margin-bottom: var(--space-md);
  padding: 8px 14px;
  border: 1px solid rgba(255, 212, 0, 0.42);
  border-radius: var(--radius-full);
  background: rgba(255, 212, 0, 0.1);
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.oto-wrap h1 {
  max-width: 790px;
  margin: 0 auto var(--space-sm);
  font-size: 3.15rem;
  line-height: 1.06;
}

.oto-wrap .lead-text {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.oto-price-box {
  width: min(420px, 100%);
  margin: var(--space-lg) auto;
  padding: var(--space-lg);
}

.oto-price-box p {
  margin: 0;
}

.oto-feature-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  text-align: left;
}

.oto-feature-grid article {
  padding: var(--space-lg);
}

.oto-actions {
  display: grid;
  gap: var(--space-sm);
  justify-items: center;
  margin-top: var(--space-xl);
}

.oto-no-link {
  color: var(--color-text-muted);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.oto-no-link:hover {
  color: var(--color-accent);
}

.oto-wrap.pro .funnel-price {
  color: var(--color-tier-3);
}

.oto-wrap.ultimate .funnel-price {
  color: var(--color-tier-4);
}

.jv-page .funnel-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
}

.funnel-jv-card {
  padding: var(--space-xl);
}

.funnel-jv-card h2 {
  margin-bottom: var(--space-sm);
}

.funnel-mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}

.funnel-table {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 18, 0.82);
}

.funnel-table-row {
  display: grid;
  grid-template-columns: 1.2fr 0.45fr 1.45fr 0.52fr;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.funnel-table-row:last-child {
  border-bottom: 0;
}

.funnel-table-row.header {
  background: rgba(255, 212, 0, 0.1);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.funnel-table-row span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.funnel-table-row span:first-child,
.funnel-table-row span:nth-child(2),
.funnel-table-row span:nth-child(4) {
  color: var(--color-text);
  font-weight: 800;
}

.funnel-prize-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

.funnel-prize-grid span {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-accent);
  font-family: var(--font-headings);
  font-size: 1.6rem;
  font-weight: 800;
}

.funnel-prize-grid b {
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-popup {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.funnel-popup[hidden] {
  display: none;
}

.funnel-popup.open {
  opacity: 1;
}

.funnel-popup-box {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: var(--space-xl);
  border: 1px solid rgba(255, 212, 0, 0.45);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 212, 0, 0.08), rgba(0, 212, 255, 0.05)),
    #0b0b0b;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.22s ease;
}

.funnel-popup.open .funnel-popup-box {
  transform: translateY(0) scale(1);
}

.funnel-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.funnel-popup-close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.funnel-popup-kicker {
  display: inline-flex;
  margin-bottom: var(--space-xs);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.funnel-popup h2 {
  max-width: 520px;
  margin-bottom: var(--space-sm);
  font-size: 2.1rem;
}

.funnel-popup p {
  color: rgba(255, 255, 255, 0.8);
}

.funnel-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

@media (max-width: 1080px) {
  .funnel-hero,
  .jv-page .funnel-hero,
  .funnel-split-section,
  .funnel-problem-grid,
  .funnel-contest {
    grid-template-columns: 1fr;
  }

  .funnel-hero-copy h1,
  .oto-wrap h1 {
    font-size: 2.75rem;
  }

  .funnel-demo-board,
  .funnel-price-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .funnel-hero-media {
    min-height: 380px;
  }
}

@media (max-width: 760px) {
  .funnel-header {
    position: static;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .funnel-header > .btn {
    width: 100%;
  }

  .funnel-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .funnel-hero {
    min-height: auto;
    padding: var(--space-lg) 0;
  }

  .funnel-hero-copy h1,
  .oto-wrap h1 {
    font-size: 2.2rem;
  }

  .funnel-section-heading h2,
  .funnel-guarantee h2,
  .funnel-final-cta h2,
  .funnel-contest h2,
  .funnel-popup h2 {
    font-size: 1.85rem;
  }

  .funnel-trust-strip,
  .funnel-genre-grid,
  .funnel-demo-board,
  .funnel-price-grid,
  .funnel-compare-grid,
  .funnel-example-grid,
  .funnel-promo-grid,
  .funnel-terms-grid,
  .funnel-cost-list,
  .oto-feature-grid,
  .funnel-prize-grid {
    grid-template-columns: 1fr;
  }

  .funnel-hero-media {
    min-height: 330px;
  }

  .funnel-cover-fan img {
    width: 88px;
  }

  .funnel-price-card {
    min-height: auto;
  }

  .funnel-table {
    overflow-x: auto;
  }

  .funnel-table-row {
    min-width: 680px;
  }

  .funnel-footer .funnel-shell {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-sm) 0;
  }

  .funnel-popup-actions,
  .funnel-popup-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   AUTH PAGES
   ========================================================================== */

.auth-page {
  background:
    linear-gradient(135deg, rgba(255, 212, 0, 0.08), transparent 32%),
    linear-gradient(225deg, rgba(0, 212, 255, 0.08), transparent 36%),
    var(--color-bg);
}

.auth-page .funnel-header,
.auth-page main {
  position: relative;
  z-index: 1;
}

.auth-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(320px, 1fr);
  gap: var(--space-xl);
  align-items: center;
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

.auth-card,
.auth-side-panel,
.auth-plan-card,
.auth-delivery-note {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(18, 18, 18, 0.88);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.auth-card {
  padding: var(--space-xl);
}

.auth-brand {
  margin-bottom: var(--space-lg);
}

.auth-card h1,
.auth-signup-hero h1 {
  margin-bottom: var(--space-sm);
  font-size: 2.55rem;
  line-height: 1.08;
}

.auth-subtitle {
  margin-bottom: var(--space-lg);
  color: rgba(255, 255, 255, 0.76);
}

.auth-form {
  display: grid;
  gap: var(--space-sm);
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.14);
}

.auth-alert {
  margin-bottom: var(--space-md);
  padding: 12px 14px;
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 255, 0.08);
  color: var(--color-text);
  font-size: 0.9rem;
}

.auth-alert.error {
  border-color: rgba(255, 140, 0, 0.42);
  background: rgba(255, 140, 0, 0.1);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.auth-links a {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

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

.auth-side-panel {
  padding: var(--space-xl);
}

.auth-side-panel h2,
.auth-delivery-note h2 {
  margin-bottom: var(--space-sm);
  font-size: 2.1rem;
}

.auth-access-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
  margin: var(--space-lg) 0;
}

.auth-access-grid span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 82px;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--color-text-muted);
  font-weight: 800;
}

.auth-access-grid b {
  color: var(--color-accent);
  font-family: var(--font-headings);
  font-size: 1.6rem;
  line-height: 1;
}

.auth-signup-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-xxl) 0;
}

.auth-signup-hero {
  max-width: 760px;
  margin-bottom: var(--space-xl);
}

.auth-signup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.auth-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: var(--space-lg);
}

.auth-plan-card.featured {
  border-color: rgba(255, 212, 0, 0.72);
}

.auth-plan-card h2 {
  min-height: 64px;
  margin: var(--space-xs) 0;
  font-size: 1.55rem;
}

.auth-plan-card p {
  flex: 1;
}

.auth-delivery-note {
  max-width: 760px;
  margin: var(--space-xl) auto 0;
  padding: var(--space-xl);
  text-align: center;
}

.auth-delivery-note p {
  margin-bottom: var(--space-lg);
}

@media (max-width: 980px) {
  .auth-shell,
  .auth-signup-grid {
    grid-template-columns: 1fr 1fr;
  }

  .auth-side-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .auth-shell,
  .auth-signup-grid,
  .auth-access-grid {
    grid-template-columns: 1fr;
  }

  .auth-card,
  .auth-side-panel,
  .auth-delivery-note {
    padding: var(--space-lg);
  }

  .auth-card h1,
  .auth-signup-hero h1 {
    font-size: 2rem;
  }

  .auth-links {
    flex-direction: column;
  }
}
