/* J3 Funnels SaaS pages — same design language as the builder app. */

:root {
  --navy: #0A0F1E;
  --navy2: #111827;
  --panel: #1E2640;
  --panel2: #252d47;
  --indigo: #4F46E5;
  --indigo-light: #6366F1;
  --indigo-glow: rgba(79,70,229,0.3);
  --emerald: #10B981;
  --amber: #F59E0B;
  --rose: #F43F5E;
  --white: #F8F7FF;
  --muted: #8B93B0;
  --border: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--indigo-light); text-decoration: none; }
a:hover { color: var(--white); }

/* ── Animated backdrop (matches the builder landing) ── */
.ff-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.ff-bg .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(79,70,229,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,70,229,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: ffGridShift 20s linear infinite;
}
@keyframes ffGridShift { from { transform: translateY(0); } to { transform: translateY(40px); } }
.ff-bg .orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.25; animation: ffPulse 6s ease-in-out infinite; }
.ff-bg .orb1 { width: 500px; height: 500px; background: var(--indigo); top: -100px; left: -100px; }
.ff-bg .orb2 { width: 400px; height: 400px; background: var(--emerald); bottom: -80px; right: -80px; animation-delay: -3s; }
@keyframes ffPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  .ff-bg .grid, .ff-bg .orb, .ff-node, .ff-flow-dash { animation: none !important; }
}

.ff-wrap { position: relative; z-index: 1; }

/* ── Nav ── */
.ff-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: rgba(10,15,30,0.75);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.ff-logo {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.15rem;
  letter-spacing: -0.02em; color: var(--white); display: flex; align-items: center; gap: 0.5rem;
}
.ff-logo .bolt { color: var(--indigo-light); }
.ff-nav-links { display: flex; align-items: center; gap: 1.25rem; }
.ff-nav-links a { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.ff-nav-links a:hover { color: var(--white); }
.ff-nav-links a.current { color: var(--white); }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  background: var(--indigo); color: #fff !important; border: none; border-radius: 12px;
  padding: 0.9rem 2rem; font-size: 1rem; font-weight: 600; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all 0.2s; box-shadow: 0 0 30px var(--indigo-glow);
}
.btn-primary:hover { background: var(--indigo-light); transform: translateY(-2px); box-shadow: 0 8px 40px var(--indigo-glow); }
.btn-primary.sm { padding: 0.55rem 1.2rem; font-size: 0.9rem; border-radius: 10px; box-shadow: none; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: transparent; border: 1px solid var(--border); color: var(--muted) !important;
  border-radius: 10px; padding: 0.65rem 1.25rem; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { border-color: var(--indigo); color: var(--white) !important; }
.btn-ghost.sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ── Badge pill ── */
.ff-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(79,70,229,0.15); border: 1px solid rgba(79,70,229,0.4);
  border-radius: 100px; padding: 0.4rem 1rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--indigo-light); margin-bottom: 2rem;
}
.ff-badge .dot { width: 6px; height: 6px; background: var(--emerald); border-radius: 50%; animation: ffBlink 2s ease-in-out infinite; }
@keyframes ffBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── Type ── */
.ff-h1 {
  font-family: 'Sora', sans-serif; font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.ff-h2 { font-family: 'Sora', sans-serif; font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.gradient {
  background: linear-gradient(135deg, var(--indigo-light) 0%, var(--emerald) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ff-sub { color: var(--muted); font-size: 1.1rem; line-height: 1.7; font-weight: 300; }

/* ── Sections ── */
.ff-section { padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem); max-width: 1120px; margin: 0 auto; }
.ff-section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }

/* ── Hero ── */
.ff-hero { text-align: center; padding-top: clamp(4rem, 10vw, 7rem); }
.ff-hero .ff-sub { max-width: 620px; margin: 0 auto 2.5rem; }
.ff-hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.ff-hero-note { color: var(--muted); font-size: 0.8rem; }

/* ── Signature: animated funnel pipeline ── */
.ff-pipeline { display: flex; align-items: center; justify-content: center; gap: 0; margin: 3.5rem auto 0; max-width: 860px; flex-wrap: wrap; }
.ff-node {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.85rem 1.1rem; text-align: center; min-width: 128px;
  animation: ffNodeGlow 4s ease-in-out infinite;
}
.ff-node:nth-child(3) { animation-delay: 1s; }
.ff-node:nth-child(5) { animation-delay: 2s; }
.ff-node:nth-child(7) { animation-delay: 3s; }
@keyframes ffNodeGlow {
  0%, 100% { border-color: var(--border); box-shadow: none; }
  12% { border-color: var(--indigo); box-shadow: 0 0 24px var(--indigo-glow); }
  24% { border-color: var(--border); box-shadow: none; }
}
.ff-node .icon { font-size: 1.3rem; display: block; margin-bottom: 0.3rem; }
.ff-node .label { font-size: 0.78rem; font-weight: 600; }
.ff-node .sublabel { font-size: 0.65rem; color: var(--muted); }
.ff-flow { width: 56px; height: 2px; position: relative; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(90deg, rgba(79,70,229,0.35), rgba(16,185,129,0.35)); }
.ff-flow-dash {
  position: absolute; top: -1.5px; left: -12px; width: 12px; height: 5px; border-radius: 3px;
  background: var(--emerald); filter: blur(0.5px); animation: ffFlow 2s linear infinite;
}
@keyframes ffFlow { to { transform: translateX(80px); } }
@media (max-width: 760px) {
  .ff-pipeline { flex-direction: column; gap: 0; }
  .ff-flow { width: 2px; height: 32px; background: linear-gradient(180deg, rgba(79,70,229,0.35), rgba(16,185,129,0.35)); }
  .ff-flow-dash { top: -12px; left: -1.5px; width: 5px; height: 12px; animation-name: ffFlowV; }
  @keyframes ffFlowV { to { transform: translateY(56px); } }
}

/* ── Cards / grids ── */
.ff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.ff-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.5rem; transition: border-color 0.2s, transform 0.2s;
}
.ff-card:hover { border-color: rgba(79,70,229,0.5); transform: translateY(-3px); }
.ff-card .icon { font-size: 1.6rem; display: block; margin-bottom: 0.75rem; }
.ff-card h3 { font-family: 'Sora', sans-serif; font-size: 1.02rem; font-weight: 600; margin-bottom: 0.4rem; }
.ff-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

/* ── Steps ── */
.ff-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; counter-reset: ffstep; }
.ff-step { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 1.75rem 1.5rem; position: relative; }
.ff-step::before {
  counter-increment: ffstep; content: counter(ffstep);
  position: absolute; top: -14px; left: 1.4rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--indigo); color: #fff; font-weight: 700; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 18px var(--indigo-glow);
}
.ff-step h3 { font-family: 'Sora', sans-serif; font-size: 1rem; margin: 0.4rem 0 0.4rem; }
.ff-step p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

/* ── Pricing ── */
.ff-pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; align-items: stretch; }
.ff-price-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.9rem 1.6rem; display: flex; flex-direction: column;
}
.ff-price-card.featured { border-color: var(--indigo); box-shadow: 0 0 40px rgba(79,70,229,0.18); position: relative; }
.ff-price-card.featured::before {
  content: 'Most popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--indigo); color: #fff; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 0.25rem 0.8rem; border-radius: 100px;
}
.ff-price-card .tier { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 0.6rem; }
.ff-price-card .price { font-family: 'Sora', sans-serif; font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; }
.ff-price-card .period { color: var(--muted); font-size: 0.85rem; margin-left: 0.2rem; }
.ff-price-card .tagline { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 1.1rem; line-height: 1.5; }
.ff-price-card ul { list-style: none; margin-bottom: 1.5rem; flex: 1; }
.ff-price-card li { font-size: 0.87rem; color: var(--white); padding: 0.35rem 0 0.35rem 1.5rem; position: relative; }
.ff-price-card li::before { content: '✓'; position: absolute; left: 0; color: var(--emerald); font-weight: 700; }

/* ── FAQ ── */
.ff-faq { max-width: 720px; margin: 0 auto; }
.ff-faq details { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.75rem; }
.ff-faq summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 600; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.ff-faq summary::after { content: '+'; color: var(--indigo-light); font-size: 1.2rem; font-weight: 400; }
.ff-faq details[open] summary::after { content: '–'; }
.ff-faq details p { padding: 0 1.25rem 1.1rem; color: var(--muted); font-size: 0.9rem; line-height: 1.65; }

/* ── Auth cards (login/register) ── */
.ff-auth { min-height: calc(100vh - 70px); display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.ff-auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 2.4rem 2.1rem; width: 100%; max-width: 420px; }
.ff-auth-card .ff-h2 { text-align: center; }
.ff-auth-card .ff-sub { text-align: center; font-size: 0.92rem; margin-bottom: 1.8rem; }
.ff-field { margin-bottom: 1.1rem; }
.ff-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.4rem; }
.ff-input {
  width: 100%; background: var(--navy2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--white); padding: 0.8rem 1rem; font-size: 0.95rem; font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ff-input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,0.2); }
.ff-form .btn-primary { width: 100%; margin-top: 0.4rem; }
.ff-auth-alt { text-align: center; margin-top: 1.4rem; font-size: 0.87rem; color: var(--muted); }
.ff-auth-fine { text-align: center; margin-top: 0.9rem; font-size: 0.78rem; }
.ff-auth-fine a { color: var(--muted); text-decoration: underline; }

/* ── Flash messages ── */
.ff-flash { border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.88rem; margin-bottom: 1.2rem; }
.ff-flash.error { background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.45); color: #fda4af; }
.ff-flash.notice { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.45); color: #6ee7b7; }

/* ── Account ── */
.ff-account { max-width: 880px; margin: 0 auto; padding: 3rem clamp(1rem, 4vw, 2rem); }
.ff-account-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.ff-stat .num { font-family: 'Sora', sans-serif; font-size: 1.9rem; font-weight: 800; }
.ff-stat .lbl { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 0.2rem; }
.ff-chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 600; border-radius: 100px; padding: 0.3rem 0.8rem; }
.ff-chip.ok { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.4); color: #6ee7b7; }
.ff-chip.warn { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.4); color: #fcd34d; }

/* ── Final CTA + footer ── */
.ff-cta-final { text-align: center; }
.ff-footer { border-top: 1px solid var(--border); padding: 2rem clamp(1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; position: relative; z-index: 1; }
.ff-footer a { color: var(--muted); margin-left: 1rem; }
.ff-footer a:hover { color: var(--white); }

:focus-visible { outline: 2px solid var(--indigo-light); outline-offset: 2px; }

/* ── Checkout (two-panel) ── */
.ff-checkout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 1.25rem; width: 100%; max-width: 880px; align-items: start; }
@media (max-width: 760px) { .ff-checkout { grid-template-columns: 1fr; } }
.ff-order { border-color: rgba(79,70,229,0.45); box-shadow: 0 0 40px rgba(79,70,229,0.12); }
.ff-order-list { list-style: none; }
.ff-order-list li { font-size: 0.85rem; padding: 0.32rem 0 0.32rem 1.5rem; position: relative; }
.ff-order-list li::before { content: '✓'; position: absolute; left: 0; color: var(--emerald); font-weight: 700; }

/* ── Single-plan pricing ── */
.ff-pricing.single { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
