/* ============================================================================
   apex-theme.css — Flowpeat Unified Theme & Stripe-Class Hybrid Design System
   Pristine breathing room, ambient glassmorphism, micro-borders, and 
   high-contrast platform modules.
   ============================================================================ */

:root {
  /* Flowpeat Hybrid Palette */
  --apex-bg-dark: #090d16;
  --apex-bg-dark-surface: #0f172a;
  --apex-bg-glass: rgba(15, 23, 42, 0.75);
  --apex-bg-glass-card: rgba(17, 24, 39, 0.70);
  --apex-bg-card-hover: rgba(30, 41, 59, 0.85);

  --apex-cyan: #0ea5e9;
  --apex-cyan-glow: rgba(14, 165, 233, 0.25);
  --apex-indigo: #6366f1;
  --apex-violet: #8b5cf6;
  --apex-amber: #f59e0b;
  --apex-emerald: #10b981;

  --apex-text-primary: #f8fafc;
  --apex-text-muted: #94a3b8;
  --apex-text-dim: #64748b;

  --apex-border-subtle: rgba(255, 255, 255, 0.08);
  --apex-border-highlight: rgba(255, 255, 255, 0.16);
  --apex-border-cyan: rgba(14, 165, 233, 0.35);

  --apex-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --apex-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --apex-radius-sm: 8px;
  --apex-radius-md: 12px;
  --apex-radius-lg: 20px;
  --apex-radius-full: 9999px;

  --apex-shadow-glass: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --apex-shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--apex-bg-dark);
  color: var(--apex-text-primary);
  font-family: var(--apex-font);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Canvas Ambient Background Mesh */
#apex-mesh-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 720px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  filter: blur(40px);
}

/* Base Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--apex-cyan);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--apex-radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* ============================================================================
   CANONICAL FLOWPEAT HEADER (Unified across all storefront pages)
   Two-Tier Architectural Navigation:
   Tier 1: Brand Lockup (Left) + Affixed Tap-a-Call & Login (Right)
   Tier 2: Centered Page Navigation one line below the Subheadline
   ============================================================================ */
.apex-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--apex-border-subtle);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.apex-header-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2.25rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.apex-header-nav-row {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.4rem 2rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Brand Lockup (Left) */
.apex-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.apex-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--apex-cyan) 0%, var(--apex-indigo) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.apex-brand-text {
  display: flex;
  flex-direction: column;
}

.apex-brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--apex-text-primary);
  line-height: 1.15;
}

.apex-brand-tagline {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--apex-text-muted);
  letter-spacing: -0.01em;
}

/* Navigation Links (Centered below subheadline) */
.apex-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.apex-nav-link {
  color: var(--apex-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.42rem 1rem;
  border-radius: var(--apex-radius-full);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.apex-nav-link:hover {
  color: var(--apex-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.apex-nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 0 1px var(--apex-border-highlight);
}

/* Header Actions (Right - Affixed Top Right) */
.apex-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.apex-call-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(14, 165, 233, 0.10);
  border: 1px solid var(--apex-border-cyan);
  color: #38bdf8;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.48rem 0.95rem;
  border-radius: var(--apex-radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.apex-call-pill:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.3);
}

.apex-btn-login {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--apex-border-highlight);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.48rem 1.05rem;
  border-radius: var(--apex-radius-full);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.apex-btn-login:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   HERO & BREATHE-FIRST SHOWCASE
   ============================================================================ */
.apex-hero {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 3.5rem;
  text-align: center;
}

.apex-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--apex-border-highlight);
  border-radius: var(--apex-radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(8px);
}

.apex-hero-headline {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

.apex-gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.apex-hero-subheadline {
  max-width: 680px;
  margin: 0 auto 2.25rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--apex-text-muted);
  font-weight: 400;
}

.apex-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.apex-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  color: #090d16;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--apex-radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.15);
}

.apex-btn-primary:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.22);
}

.apex-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--apex-border-highlight);
  color: var(--apex-text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--apex-radius-sm);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.apex-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ============================================================================
   HIGH-CONTRAST WORKFLOW MODULES & BENTO GRID
   ============================================================================ */
.apex-modules-section {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.apex-section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.apex-section-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.apex-section-subtitle {
  font-size: 1rem;
  color: var(--apex-text-muted);
  line-height: 1.6;
}

/* Bento Container */
.apex-bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

/* Glassmorphism Card with Micro-Borders */
.apex-glass-card {
  background: var(--apex-bg-glass-card);
  border: 1px solid var(--apex-border-subtle);
  border-radius: var(--apex-radius-md);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--apex-shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.apex-glass-card:hover {
  border-color: var(--apex-border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--apex-shadow-glass);
}

.apex-span-7 { grid-column: span 7; }
.apex-span-5 { grid-column: span 5; }
.apex-span-4 { grid-column: span 4; }
.apex-span-6 { grid-column: span 6; }
.apex-span-12 { grid-column: span 12; }

/* Micro-Badges & Headlines Inside Cards */
.apex-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--apex-radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
  margin-bottom: 1.25rem;
}

.apex-card-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.65rem;
}

.apex-card-copy {
  font-size: 0.9375rem;
  color: var(--apex-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ============================================================================
   PAGE CONTAINERS FOR CHILD PAGES (Auth, Onboarding, Portal, Portfolio)
   ============================================================================ */
.apex-page-container {
  max-width: 680px;
  margin: 3.5rem auto 5rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.apex-page-wide {
  max-width: 1200px;
  margin: 3.5rem auto 5rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.apex-form-card {
  background: var(--apex-bg-glass-card);
  border: 1px solid var(--apex-border-subtle);
  border-radius: var(--apex-radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--apex-shadow-glass);
}

.apex-form-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.apex-form-subtitle {
  font-size: 0.925rem;
  color: var(--apex-text-muted);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.apex-form-group {
  margin-bottom: 1.35rem;
  display: flex;
  flex-direction: column;
}

.apex-form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
}

.apex-input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--apex-border-subtle);
  border-radius: var(--apex-radius-sm);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.18s ease;
  width: 100%;
}

.apex-input:focus {
  outline: none;
  border-color: var(--apex-cyan);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.apex-input::placeholder {
  color: var(--apex-text-dim);
}

.apex-btn-submit {
  width: 100%;
  background: var(--apex-cyan);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--apex-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.apex-btn-submit:hover {
  background: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

/* Footer */
.apex-footer {
  border-top: 1px solid var(--apex-border-subtle);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--apex-text-dim);
  font-size: 0.85rem;
  background: rgba(9, 13, 22, 0.95);
}

.apex-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.apex-footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.apex-footer-link {
  color: var(--apex-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color 0.15s;
}

.apex-footer-link:hover {
  color: var(--apex-text-primary);
}

/* ============================================================================
   RESPONSIVE MEDIA QUERIES
   ============================================================================ */
@media (max-width: 900px) {
  .apex-bento-grid {
    grid-template-columns: 1fr;
  }
  .apex-span-7, .apex-span-5, .apex-span-4, .apex-span-6, .apex-span-12 {
    grid-column: span 1;
  }
  .apex-header-top {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .apex-header-nav-row {
    padding: 0.4rem 1rem 0.6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .apex-hero {
    padding: 3.5rem 1rem 2.5rem;
  }
  .apex-hero-headline {
    font-size: 2.25rem;
  }
  .apex-form-card {
    padding: 1.5rem;
  }
  .apex-call-pill .apex-call-label {
    display: none;
  }
  .apex-call-pill::after {
    content: "Call";
  }
}
