// Content sections for AI Virtuvė landing

// ───────────────────────────────────────────────────────────
// INLINE CTA — reusable button block for inserting throughout the page
// ───────────────────────────────────────────────────────────
function InlineCTA({ label = "Noriu prisijungti", secondary = null, marginTop = 48 }) {
  return (
    <div style={{
      display: "flex",
      justifyContent: "center",
      alignItems: "center",
      gap: 14,
      flexWrap: "wrap",
      marginTop: marginTop,
      padding: "0 16px",
    }}>
      <a href="#registracija" className="btn btn-primary">
        {label}
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
          <path d="M5 12h14M13 6l6 6-6 6" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" />
        </svg>
      </a>
      {secondary && (
        <a href="#apie" className="btn btn-ghost">{secondary}</a>
      )}
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// TURN-ON banner — Įjunkite savo AI virtuvę
// ───────────────────────────────────────────────────────────
function SectionTurnOn() {
  return (
    <section id="ijunkti" style={{ padding: "72px 0 56px", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)", background: "var(--bg-2)", position: "relative", overflow: "hidden" }}>
      {/* Neon ambient */}
      <div style={{
        position: "absolute", top: "50%", left: "50%", transform: "translate(-50%, -50%)",
        width: "min(800px, 90%)", height: 200,
        background: "radial-gradient(ellipse, rgba(255,210,63,.10), transparent 70%)",
        pointerEvents: "none",
      }}></div>

        <div className="container" style={{ position: "relative", textAlign: "center", maxWidth: 920 }}>
        <div style={{ display: "flex", justifyContent: "center", marginBottom: 24 }}>
          <div className="float-y" style={{ color: "var(--neon-yellow)", width: 72, height: 72, filter: "drop-shadow(0 0 12px rgba(255,210,63,.45))" }}>
            <BrainMark color="var(--neon-yellow)" />
          </div>
        </div>
        <h2 style={{ fontSize: "clamp(36px, 5.5vw, 72px)" }}>
          Įjunkite savo <span className="script neon-flicker" style={{ color: "var(--neon-yellow)", fontSize: "1.15em", display: "inline-block", transform: "rotate(-2deg)" }}>AI virtuvę</span>.
        </h2>
        <p className="text-muted" style={{ marginTop: 20, fontSize: "clamp(17px, 2vw, 22px)", maxWidth: 640, margin: "20px auto 0" }}>
          Lietuviška AI bendruomenė. Praktiniai mokymai.
        </p>
        <div style={{ display: "flex", justifyContent: "center", gap: 28, flexWrap: "wrap", marginTop: 36 }}>
          <BannerStat number="47" label="būsimų AI šefų bendruomenėje" />
          <BannerDivider />
          <BannerStat number="1 val." label="per savaitę" />
          <BannerDivider />
          <BannerStat number="19€" label="per mėnesį" />
        </div>
      </div>
    </section>
  );
}

function BannerStat({ number, label }) {
  return (
    <div style={{ textAlign: "center" }}>
      <div style={{ fontFamily: "var(--font-display)", fontSize: "clamp(28px, 3.5vw, 42px)", fontWeight: 700, color: "var(--neon-yellow)", lineHeight: 1, letterSpacing: "-0.02em" }}>
        {number}
      </div>
      <div className="tag-mono" style={{ color: "var(--text-muted)", marginTop: 6 }}>{label}</div>
    </div>
  );
}

function BannerDivider() {
  return <div style={{ width: 1, alignSelf: "stretch", background: "var(--line-2)", minHeight: 40 }} />;
}

// ───────────────────────────────────────────────────────────
// TESTIMONIALS — Atsiliepimai
// ───────────────────────────────────────────────────────────
function TestimonialCard({ quote, name, role, avatar, accent, big }) {
  return (
    <div style={{
      padding: big ? 36 : 28,
      background: big
        ? "linear-gradient(160deg, rgba(255,210,63,.08), rgba(79,179,255,.04))"
        : "var(--surface)",
      border: `1px solid ${big ? "rgba(255,210,63,.25)" : "var(--line)"}`,
      borderRadius: "var(--radius-lg)",
      display: "flex", flexDirection: "column", gap: 18,
      position: "relative",
      transition: "transform .25s, border-color .25s",
    }}
      onMouseOver={e => { e.currentTarget.style.transform = "translateY(-3px)"; }}
      onMouseOut={e => { e.currentTarget.style.transform = "translateY(0)"; }}
    >
      {/* Decorative open quote */}
      <div style={{
        fontFamily: "var(--font-script)",
        fontSize: 64, lineHeight: 0.5,
        color: accent, opacity: 0.4,
        height: 24,
      }}>"</div>

      <p style={{
        fontFamily: "var(--font-display)",
        fontSize: big ? "clamp(20px, 2.2vw, 24px)" : 16,
        lineHeight: 1.45,
        color: "var(--text)",
        letterSpacing: "-0.005em",
      }}>
        {quote}
      </p>

      {/* Star rating */}
      <div style={{ display: "flex", gap: 2, color: accent }}>
        {[1,2,3,4,5].map(i => (
          <svg key={i} width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
            <path d="M12 2l2.9 6.9 7.1.6-5.4 4.6 1.7 7-6.3-3.9-6.3 3.9 1.7-7L2 9.5l7.1-.6z"/>
          </svg>
        ))}
      </div>

      {/* Author */}
      <div style={{
        display: "flex", alignItems: "center", gap: 12,
        paddingTop: 14, borderTop: "1px solid var(--line)",
      }}>
        <span style={{
          width: 40, height: 40, borderRadius: "50%",
          background: `linear-gradient(135deg, ${accent}, ${accent}80)`,
          color: "#0A1230",
          display: "inline-flex", alignItems: "center", justifyContent: "center",
          fontFamily: "var(--font-display)", fontWeight: 700, fontSize: 16,
          flexShrink: 0,
        }}>{avatar}</span>
        <div style={{ minWidth: 0 }}>
          <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 15 }}>{name}</div>
          <div className="text-muted" style={{ fontSize: 13 }}>{role}</div>
        </div>
      </div>
    </div>
  );
}

function SectionTestimonials() {
  return (
    <section id="atsiliepimai" style={{ background: "var(--bg-2)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        <div style={{ textAlign: "center", maxWidth: 760, margin: "0 auto 48px" }}>
          <span className="tag-mono text-yellow">— Mūsų virtuvės lankytojos —</span>
          <h2 style={{ marginTop: 14 }}>
            47 būsimi AI šefai jau <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em" }}>mokosi</span> kiekvieną savaitę
          </h2>
        </div>

        <div style={{
          display: "grid",
          gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))",
          gap: 18,
        }}>
          <TestimonialCard
            avatar="D"
            name="Daiva, 52"
            role="Buhalterė · Kaunas"
            accent="#FFD23F"
            quote="Po antros pamokos ChatGPT'as man ataskaitas rašo per 15 minučių vietoj 2 valandų. Ir aš nemoku programuoti. Tikrai dirba."
          />
          <TestimonialCard
            avatar="R"
            name="Rita, 46"
            role="Mokytoja · Vilnius"
            accent="#4FB3FF"
            quote="Buvau įsitikinusi, kad AI ne man. Po mėnesio supratau, kad nesu skirta IT — bet AI yra skirtas man."
          />
          <TestimonialCard
            avatar="A"
            name="Aurelija, 41"
            role="Slaugytoja · Klaipėda"
            accent="#FF9D2C"
            quote="Geriausia investicija per metus. Suvalgom šeimos savaitės meniu su Claude — vaikai laimingi, aš irgi."
          />
          <TestimonialCard
            avatar="L"
            name="Lina, 58"
            role="Pensininkė · Šiauliai"
            accent="#A78BFA"
            quote="Mano dukra siūlė kursus už 800€. Užtenka 19€ per mėnesį ir dar gyvas pokalbis su bendruomene."
          />
          <TestimonialCard
            avatar="J"
            name="Jurgita, 44"
            role="Versle savininkė · Vilnius"
            accent="#FFD23F"
            quote="Anksčiau bijodavau prisėsti prie ChatGPT. Dabar jis padeda derybose, dokumentų peržiūroje ir net mama linkėjimuose."
          />
          <TestimonialCard
            avatar="V"
            name="Vilma, 49"
            role="Personalo vadovė"
            accent="#4FB3FF"
            quote="Rekomenduoju draugėms ne todėl, kad gerai moko. Todėl, kad bendruomenė pirmoji tikrai šilta."
          />
        </div>

        {/* Trust strip */}
        <div style={{
          marginTop: 48,
          padding: "24px 32px",
          background: "rgba(0,0,0,.25)",
          border: "1px solid var(--line-2)",
          borderRadius: "var(--radius)",
          display: "flex", justifyContent: "space-around", alignItems: "center",
          flexWrap: "wrap", gap: 20,
        }}>
          <TrustStat number="47" label="aktyvūs nariai" />
          <TrustStat number="8" label="tiesioginės pamokos" />
          <TrustStat number="4.9" label="vidutinis įvertinimas" sub="iš 5" />
          <TrustStat number="89%" label="lieka po pirmojo mėnesio" />
        </div>
      </div>
    </section>
  );
}

function TrustStat({ number, label, sub }) {
  return (
    <div style={{ textAlign: "center" }}>
      <div style={{
        fontFamily: "var(--font-display)",
        fontSize: "clamp(28px, 3.5vw, 38px)",
        fontWeight: 700,
        color: "var(--neon-yellow)",
        lineHeight: 1,
        letterSpacing: "-0.02em",
      }}>{number}{sub && <span style={{ fontSize: "0.5em", color: "var(--text-dim)" }}>/{sub}</span>}</div>
      <div className="tag-mono" style={{ marginTop: 6, color: "var(--text-muted)" }}>{label}</div>
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// MOBILE STICKY CTA — only visible on small screens
// ───────────────────────────────────────────────────────────
function MobileStickyCTA() {
  return (
    <div className="mobile-sticky-cta" style={{
      position: "fixed",
      bottom: 16, left: 16, right: 16,
      zIndex: 40,
      padding: "10px 12px 10px 16px",
      background: "rgba(10, 18, 48, 0.92)",
      backdropFilter: "blur(18px) saturate(160%)",
      WebkitBackdropFilter: "blur(18px) saturate(160%)",
      border: "1px solid rgba(255,210,63,.3)",
      borderRadius: 999,
      boxShadow: "0 12px 40px rgba(0,0,0,.4)",
      display: "none",
      alignItems: "center", justifyContent: "space-between",
      gap: 10,
    }}>
      <div style={{ minWidth: 0 }}>
        <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 14, lineHeight: 1.1 }}>
          AI Virtuvė · narystė
        </div>
        <div className="text-muted" style={{ fontSize: 12 }}>nuo 19€/mėn · atšaukite bet kada</div>
      </div>
      <a href="#registracija" className="btn btn-primary btn-sm" style={{ flexShrink: 0, padding: "10px 16px", fontSize: 13 }}>
        Prisijungti
      </a>
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// AUDIENCE — Kam tai skirta?
// ───────────────────────────────────────────────────────────
function SectionAudience() {
  const items = [
    { ic: "🥄", t: "Pavargai nuo painių instrukcijų?", d: "Mokomės be sudėtingos teorijos — su konkrečiais žingsniais ir pavyzdžiais." },
    { ic: "⏰", t: "Užtenka 1 val. per savaitę", d: "Viena gyva pamoka antradieniais — ne valandos prie ekrano, o realūs rezultatai." },
    { ic: "🧂", t: "Lietuviška bendruomenė", d: "Visiems, kurie nori suprasti AI — be IT žargono, su realiu palaikymu kiekvieną savaitę." },
    { ic: "🍯", t: "Lengvai pritaikoma", d: "Praktiniai pavyzdžiai darbui, šeimai ir kasdienybei." },
  ];
  return (
    <section id="kam" style={{ paddingTop: 80 }}>
      <div className="container">
        <div style={{ textAlign: "center", maxWidth: 760, margin: "0 auto 56px" }}>
          <span className="tag-mono text-yellow">— Kam ši virtuvė —</span>
          <h2 style={{ marginTop: 14 }}>
            AI <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em", display: "inline-block", transform: "rotate(-2deg)" }}>virtuvė</span>, kurioje gimsta <span style={{ color: "var(--neon-yellow)" }}>aiškumas</span>.
          </h2>
          <p className="text-muted" style={{ marginTop: 18, fontSize: 18 }}>
            Išmokysime panaudoti dirbtinį intelektą savo gyvenime. Praktiniai mokymai darbui ir kasdienybei — be IT žargono, be sudėtingų instrukcijų.
          </p>
        </div>

        <div style={{
          display: "grid",
          gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
          gap: 16,
        }}>
          {items.map((it, i) => (
            <div key={i} className="card" style={{ textAlign: "left" }}>
              <div style={{ fontSize: 36, marginBottom: 16, filter: "saturate(1.1)" }}>{it.ic}</div>
              <h3 style={{ fontSize: 20, marginBottom: 8 }}>{it.t}</h3>
              <p className="text-muted" style={{ fontSize: 15 }}>{it.d}</p>
            </div>
          ))}
        </div>
      </div>
        <InlineCTA label="Noriu prisijungti" />
      
    </section>
  );
}

// ───────────────────────────────────────────────────────────
// PAIN → PROMISE — DABAR vs PO MOKYMŲ
// ───────────────────────────────────────────────────────────
function SectionTransformation() {
  const before = [
    "Užduotys užtrunka ilgiau, nei turėtų",
    "Sunku greitai apsispręsti",
    "Darbas ir buitis \u201Esuvalgo\u201C dieną",
    "AI naudoji paviršutiniškai",
  ];
  const after = [
    "Užduotis atliekate greičiau ir paprasčiau",
    "Sprendimus priimate užtikrinčiau",
    "Atsiranda daugiau laiko sau",
    "AI tampa realiu pagalbininku",
  ];

  return (
    <section id="transformacija" style={{ background: "var(--bg-2)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        <div style={{ textAlign: "center", maxWidth: 760, margin: "0 auto 56px" }}>
          <span className="tag-mono text-yellow">— Reali nauda —</span>
          <h2 style={{ marginTop: 14 }}>
            Tas pats laikas. <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em", display: "inline-block", transform: "rotate(-2deg)" }}>Daug daugiau</span> naudos.
          </h2>
          <p className="text-muted" style={{ marginTop: 16, fontSize: 18 }}>
            AI atlaisvina valandas, kurios eidavo į rutiną. Per kelias savaites pamatysite, kaip ta pati diena talpina kur kas daugiau.
          </p>
        </div>

        <div style={{
          display: "grid",
          gridTemplateColumns: "1fr auto 1fr",
          gap: 32,
          alignItems: "stretch",
        }} className="transform-grid">
          {/* BEFORE */}
          <div style={{
            padding: 32,
            background: "rgba(255,255,255,.02)",
            border: "1px solid var(--line)",
            borderRadius: "var(--radius-lg)",
          }}>
            <div style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 20 }}>
              <span style={{ width: 10, height: 10, borderRadius: "50%", background: "var(--text-dim)" }}></span>
              <span className="tag-mono" style={{ color: "var(--text-muted)" }}>DABAR</span>
            </div>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 14 }}>
              {before.map((it, i) => (
                <li key={i} style={{ display: "flex", gap: 12, alignItems: "flex-start", color: "var(--text-muted)" }}>
                  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0, marginTop: 2 }}>
                    <circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth="1.6" opacity="0.4"/>
                    <path d="M8 12h8" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/>
                  </svg>
                  {it}
                </li>
              ))}
            </ul>
          </div>

          {/* Arrow */}
          <div style={{ display: "flex", alignItems: "center", justifyContent: "center" }} className="transform-arrow">
            <div style={{
              width: 64, height: 64, borderRadius: "50%",
              background: "var(--neon-yellow)",
              color: "#0A1230",
              display: "flex", alignItems: "center", justifyContent: "center",
              boxShadow: "0 0 32px rgba(255,210,63,.4)",
            }}>
              <svg width="28" height="28" viewBox="0 0 24 24" fill="none">
                <path d="M5 12h14M13 6l6 6-6 6" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round"/>
              </svg>
            </div>
          </div>

          {/* AFTER */}
          <div style={{
            padding: 32,
            background: "linear-gradient(145deg, rgba(255,210,63,.08), rgba(79,179,255,.04))",
            border: "1px solid rgba(255,210,63,.25)",
            borderRadius: "var(--radius-lg)",
          }}>
            <div style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 20 }}>
              <span style={{ width: 10, height: 10, borderRadius: "50%", background: "var(--neon-yellow)", boxShadow: "0 0 8px var(--neon-yellow)" }}></span>
              <span className="tag-mono text-yellow">PO MOKYMŲ</span>
            </div>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 14 }}>
              {after.map((it, i) => (
                <li key={i} style={{ display: "flex", gap: 12, alignItems: "flex-start" }}>
                  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0, marginTop: 2 }}>
                    <circle cx="12" cy="12" r="9" fill="var(--neon-yellow)"/>
                    <path d="M7 12.5l3.5 3.5L17 8.5" stroke="#0A1230" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round"/>
                  </svg>
                  {it}
                </li>
              ))}
            </ul>
          </div>
        </div>
        <InlineCTA label="Noriu šio pasikeitimo" />
      </div>
      <style>{`
        @media (max-width: 820px) {
          .transform-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
          .transform-arrow { transform: rotate(90deg); margin: 4px 0; }
        }
      `}</style>
    </section>
  );
}


// ───────────────────────────────────────────────────────────
// AI TOOLS — ChatGPT / Claude / Midjourney / Gemini
// ───────────────────────────────────────────────────────────
function SectionTools() {
  const tools = [
    { name: "ChatGPT", brand: "OpenAI", color: "#10A37F", use: "Rašymas, planavimas, atsakymai" },
    { name: "Claude", brand: "Anthropic", color: "#D97757", use: "Ilgi tekstai, dokumentų analizė" },
    { name: "Grok", brand: "xAI", color: "#1DA1F2", use: "Naujausios temos, X integracijos" },
    { name: "Gemini", brand: "Google", color: "#4FB3FF", use: "Paieška, integracijos, Google" },
  ];
  return (
    <section id="zinai" style={{ paddingTop: 48 }}>
      <div className="container">
        <div style={{ textAlign: "center", maxWidth: 720, margin: "0 auto 40px" }}>
          <span className="tag-mono text-yellow">— Mūsų ingredientai —</span>
          <h2 style={{ marginTop: 12, fontSize: "clamp(28px, 3.5vw, 42px)" }}>
            Pasirinksime tau tinkamiausią AI įrankį
          </h2>
        </div>
        <div style={{
          display: "grid",
          gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))",
          gap: 14,
        }}>
          {tools.map((t, i) => (
            <div key={i} style={{
              padding: 22,
              background: "var(--surface)",
              border: "1px solid var(--line)",
              borderRadius: "var(--radius)",
              display: "flex", flexDirection: "column", gap: 10,
            }}>
              <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
                <span style={{
                  width: 36, height: 36, borderRadius: 10,
                  background: t.color, display: "inline-flex",
                  alignItems: "center", justifyContent: "center",
                  fontFamily: "var(--font-display)", fontWeight: 700,
                  color: "white", fontSize: 16,
                }}>{t.name[0]}</span>
                <div>
                  <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 17 }}>{t.name}</div>
                  <div className="tag-mono" style={{ color: "var(--text-dim)" }}>{t.brand}</div>
                </div>
              </div>
              <p className="text-muted" style={{ fontSize: 14 }}>{t.use}</p>
            </div>
          ))}
        </div>
      </div>
        <InlineCTA label="Pradėti naudoti su mumis" />
      
    </section>
  );
}

// ───────────────────────────────────────────────────────────
// HOSTS — Šefai + Meniu (chefs + menu metaphor)
// ───────────────────────────────────────────────────────────
function ChefCard({ portrait, name, role, specialty, bio, quote, accent, objectPos = "center top" }) {
  return (
    <div style={{
      background: "var(--surface)",
      border: "1px solid var(--line)",
      borderRadius: "var(--radius-xl)",
      overflow: "hidden",
      display: "flex",
      flexDirection: "column",
      position: "relative",
      transition: "transform .3s, border-color .3s",
    }}
      onMouseOver={e => { e.currentTarget.style.transform = "translateY(-4px)"; e.currentTarget.style.borderColor = accent + "55"; }}
      onMouseOut={e => { e.currentTarget.style.transform = "translateY(0)"; e.currentTarget.style.borderColor = "var(--line)"; }}
    >
      {/* Cropped portrait — "plated" framing */}
      <div style={{
        position: "relative",
        aspectRatio: "5/6",
        overflow: "hidden",
        background: "#000",
      }}>
        <img src={portrait} alt={name} style={{
          width: "100%", height: "100%",
          objectFit: "cover",
          objectPosition: objectPos,
        }} />
        {/* Subtle vignette */}
        <div style={{
          position: "absolute", inset: 0,
          background: "linear-gradient(to bottom, transparent 50%, rgba(10,18,48,0.85) 100%)",
          pointerEvents: "none",
        }}></div>
        {/* Floating specialty badge */}
        <div style={{
          position: "absolute", top: 18, right: 18,
          background: "rgba(10,18,48,0.85)",
          backdropFilter: "blur(10px)",
          border: `1px solid ${accent}55`,
          color: accent,
          padding: "6px 12px",
          borderRadius: 999,
          fontFamily: "var(--font-mono)",
          fontSize: 11,
          letterSpacing: "0.12em",
          textTransform: "uppercase",
          fontWeight: 600,
        }}>
          {specialty}
        </div>
        {/* Name plate at bottom */}
        <div style={{
          position: "absolute", bottom: 20, left: 20, right: 20,
        }}>
          <div className="tag-mono" style={{ color: accent, marginBottom: 4 }}>{role}</div>
          <div style={{
            fontFamily: "var(--font-display)",
            fontSize: 32,
            fontWeight: 700,
            letterSpacing: "-0.02em",
            lineHeight: 1.05,
          }}>{name}</div>
        </div>
      </div>

      {/* Body */}
      <div style={{ padding: 28, display: "flex", flexDirection: "column", gap: 16, flex: 1 }}>
        <p className="text-muted" style={{ fontSize: 15 }}>{bio}</p>
        <div style={{
          padding: "14px 18px",
          background: `linear-gradient(145deg, ${accent}14, transparent)`,
          borderLeft: `3px solid ${accent}`,
          borderRadius: "0 8px 8px 0",
        }}>
          <div style={{
            fontFamily: "var(--font-script)",
            fontSize: 22,
            lineHeight: 1.35,
            color: "var(--cream)",
          }}>
            „{quote}"
          </div>
        </div>
      </div>
    </div>
  );
}

function WeeklyPerk({ dotColor, pulse, label, detail }) {
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
      <span style={{
        width: 10, height: 10, borderRadius: "50%",
        background: dotColor,
        boxShadow: `0 0 8px ${dotColor}`,
        animation: pulse ? "pulse-dot 1.4s ease-in-out infinite" : "none",
        flexShrink: 0,
      }}></span>
      <div>
        <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 15, lineHeight: 1.2 }}>{label}</div>
        <div className="tag-mono" style={{ color: "var(--text-dim)", marginTop: 2 }}>{detail}</div>
      </div>
    </div>
  );
}

function AIMenuItem({ icon, title, desc }) {
  return (
    <div style={{ display: "flex", flexDirection: "row", gap: 14, alignItems: "flex-start" }}>
      <div style={{
        width: 44, height: 44,
        flexShrink: 0,
        color: "var(--neon-yellow)",
        display: "inline-flex", alignItems: "center", justifyContent: "center",
        background: "rgba(255,210,63,.08)",
        border: "1px solid rgba(255,210,63,.2)",
        borderRadius: 10,
        padding: 8,
      }}>
        {icon}
      </div>
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 18, lineHeight: 1.2, color: "var(--text)", marginBottom: 6 }}>
          {title}
        </div>
        <p className="text-muted" style={{ fontSize: 14, lineHeight: 1.5, margin: 0 }}>{desc}</p>
      </div>
    </div>
  );
}

function MenuItem({ problem, dish, recipe, chef, accent, num }) {
  return (
    <div style={{
      display: "grid",
      gridTemplateColumns: "auto 1fr auto",
      alignItems: "flex-start",
      gap: 22,
      padding: "24px 0",
      borderBottom: "1px dashed var(--line-2)",
    }} className="menu-item">
      <div style={{
        fontFamily: "var(--font-display)", fontSize: 28, fontWeight: 700,
        color: accent, lineHeight: 1, paddingTop: 6,
        fontVariantNumeric: "tabular-nums",
        minWidth: 40,
      }}>
        {num}
      </div>
      <div style={{ minWidth: 0 }}>
        {/* The problem — in quotes, big, conversational */}
        <div style={{
          fontFamily: "var(--font-script)",
          fontSize: "clamp(22px, 2.6vw, 30px)",
          color: "var(--cream)",
          lineHeight: 1.25,
          marginBottom: 10,
        }}>
          „{problem}"
        </div>
        {/* Topic name + recipe description */}
        <h4 style={{
          fontFamily: "var(--font-display)", fontSize: 18, fontWeight: 600,
          margin: "0 0 4px", color: "var(--text)",
          letterSpacing: "-0.01em",
        }}>
          {dish}
        </h4>
        <p className="text-muted" style={{ fontSize: 15 }}>{recipe}</p>
      </div>
      <div style={{ flexShrink: 0, textAlign: "right", minWidth: 110 }} className="menu-chef">
        <div className="tag-mono" style={{ color: "var(--text-dim)" }}>gamins</div>
        <div className="script" style={{
          fontSize: 22,
          color: accent,
          lineHeight: 1,
          marginTop: 4,
        }}>
          {chef}
        </div>
      </div>
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// AI MENU — standalone section (was inside SectionHosts)
// ───────────────────────────────────────────────────────────
function SectionAIMenu() {
  return (
    <section id="ai-meniu" style={{ paddingTop: 80, paddingBottom: 80 }}>
      <div className="container">
        {/* Menu — split layout: items left, board right */}
        <div style={{
          padding: "clamp(28px, 4vw, 56px)",
          background: "rgba(0,0,0,.3)",
          border: "1px solid var(--line-2)",
          borderRadius: "var(--radius-xl)",
          position: "relative",
          overflow: "hidden",
        }}>
          {/* Decorative neon glow */}
          <div style={{
            position: "absolute", top: -80, left: "30%", transform: "translateX(-50%)",
            width: 400, height: 200,
            background: "radial-gradient(ellipse, rgba(255,210,63,.08), transparent 70%)",
            pointerEvents: "none",
          }}></div>

          <div style={{
            display: "grid",
            gridTemplateColumns: "minmax(0, 1.05fr) minmax(0, 0.95fr)",
            gap: "clamp(28px, 4vw, 56px)",
            alignItems: "center",
          }} className="ai-menu-grid">

            {/* LEFT — items */}
            <div>
              <span className="tag-mono text-yellow">— AI meniu —</span>
              <h2 style={{ marginTop: 10, fontSize: "clamp(32px, 4.5vw, 52px)" }}>
                Įjunkite savo <span className="script neon-flicker" style={{ color: "var(--neon-yellow)", fontSize: "1.15em", display: "inline-block", transform: "rotate(-2deg)" }}>AI virtuvę</span>.
              </h2>
              <p className="text-muted" style={{ marginTop: 12, fontSize: 17, maxWidth: 480 }}>
                Lietuviška AI bendruomenė. Praktiniai mokymai.
              </p>

              <div style={{
                marginTop: 32,
                display: "grid",
                gridTemplateColumns: "1fr 1fr",
                gap: "20px 24px",
              }} className="ai-menu-items">
                <AIMenuItem
                  icon={
                    <svg viewBox="0 0 24 24" fill="none">
                      <path d="M12 3a6 6 0 0 0-3 11.2V17h6v-2.8A6 6 0 0 0 12 3z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                      <path d="M9 20h6M10 17h4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                    </svg>
                  }
                  title="Idėjos"
                  desc="Kūrybiškos idėjos tavo verslui, paremtos dirbtinio intelekto įžvalgomis."
                />
                <AIMenuItem
                  icon={
                    <svg viewBox="0 0 24 24" fill="none">
                      <rect x="5" y="8" width="14" height="12" rx="2" stroke="currentColor" strokeWidth="1.6"/>
                      <circle cx="9.5" cy="13" r="1.3" fill="currentColor"/>
                      <circle cx="14.5" cy="13" r="1.3" fill="currentColor"/>
                      <path d="M12 4v4M9 17h6" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                      <circle cx="12" cy="3" r="1.2" fill="currentColor"/>
                    </svg>
                  }
                  title="AI agentai"
                  desc="Išmanūs AI agentai, kurie padeda atlikti užduotis, aptarnauti klientus ir taupyti laiką."
                />
                <AIMenuItem
                  icon={
                    <svg viewBox="0 0 24 24" fill="none">
                      <path d="M4 20V10M9 20V14M14 20V8M19 20V5" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                      <path d="M3 20h18" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                      <path d="M4 10l5-4 5 2 5-4" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" opacity="0.6"/>
                    </svg>
                  }
                  title="Analitika"
                  desc="Duomenų analizė ir aiškios įžvalgos, padedančios priimti geresnius sprendimus."
                />
                <AIMenuItem
                  icon={
                    <svg viewBox="0 0 24 24" fill="none">
                      <path d="M9 19c-3-2-5-5-5-9a5 5 0 0 1 8-2 5 5 0 0 1 8 2c0 4-2 7-5 9" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                      <path d="M9 12c1-1 2-1 3-1M14 12c-1 0-2 0-3 1M11 13c0 2 0 3-1 5M13 13c0 2 0 3 1 5" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round"/>
                      <circle cx="9.5" cy="9.5" r="1" fill="currentColor"/>
                      <circle cx="14.5" cy="9.5" r="1" fill="currentColor"/>
                    </svg>
                  }
                  title="Kūryba"
                  desc="AI generuoja turinį, dizainus ir sprendimus, kurie įkvepia."
                />
                <AIMenuItem
                  icon={
                    <svg viewBox="0 0 24 24" fill="none">
                      <path d="M12 21c-6-4-9-8-9-12a4 4 0 0 1 9-2 4 4 0 0 1 9 2c0 4-3 8-9 12z" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round"/>
                    </svg>
                  }
                  title="Skonis"
                  desc="Technologijos ir kūryba, jungiamos tam, kad rezultatas būtų išskirtinis."
                />
                <AIMenuItem
                  icon={
                    <svg viewBox="0 0 24 24" fill="none">
                      <circle cx="12" cy="12" r="3" stroke="currentColor" strokeWidth="1.6"/>
                      <path d="M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M5 19l2-2M17 7l2-2" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round"/>
                    </svg>
                  }
                  title="AI automatizacijos"
                  desc="Procesų automatizavimas leidžia sutaupyti laiko, mažinti rutiną ir pasiekti daugiau."
                />
              </div>

              <div style={{
                marginTop: 32, paddingTop: 24,
                borderTop: "1px dashed var(--line-2)",
                fontFamily: "var(--font-mono)",
                fontSize: 13,
                fontWeight: 600,
                letterSpacing: "0.18em",
                textTransform: "uppercase",
                color: "var(--neon-yellow)",
                textAlign: "center",
              }}>
                ✦ Išmanūs sprendimai. Skanūs rezultatai. ✦
              </div>
            </div>

            {/* RIGHT — board image */}
            <div style={{
              position: "relative",
              display: "flex", justifyContent: "center", alignItems: "center",
            }}>
              <img
                src="assets/ai-menu-board.png"
                alt="AI Virtuvė meniu lentoje"
                style={{
                  width: "100%",
                  maxWidth: 480,
                  borderRadius: "var(--radius-lg)",
                  boxShadow: "0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04)",
                }}
              />
            </div>
          </div>
        </div>
      </div>
      <style>{`
        @media (max-width: 860px) {
          .ai-menu-grid { grid-template-columns: 1fr !important; }
          .ai-menu-grid > div:last-child { order: -1; max-width: 360px; margin: 0 auto; }
        }
        @media (max-width: 540px) {
          .ai-menu-items { grid-template-columns: 1fr !important; }
        }
      `}</style>
        <InlineCTA label="Užsisakyti vietą" />
      
    </section>
  );
}

function SectionHosts() {
  return (
    <section id="apie" style={{ background: "var(--bg-2)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        {/* Header */}
        <div style={{ maxWidth: 820, marginBottom: 56 }}>
          <span className="tag-mono text-yellow">— Šios virtuvės šefai —</span>
          <h2 style={{ marginTop: 14 }}>
            Mes paruošime tau <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em" }}>AI patiekalą</span> — sriubą, pietus ar vakarienę.
          </h2>
          <p className="text-muted" style={{ marginTop: 16, fontSize: 18, maxWidth: 680 }}>
            Du praktikai. Du požiūriai. Vienas tikslas — kad tu realiai mokėtum naudoti AI. Pasakyk, ko šiandien reikia, ir žinome, ką paduoti.
          </p>
        </div>

        {/* Two chef cards */}
        <div style={{
          display: "grid",
          gridTemplateColumns: "repeat(auto-fit, minmax(320px, 1fr))",
          gap: 24,
          marginBottom: 56,
        }}>
          <ChefCard
            portrait="assets/chef-aurimas.png"
            name="Aurimas Levickas"
            role="AI Sriubos šefas"
            specialty="AI Sriubos"
            bio={<>Verslo ir AI konsultantas. Pirmosios su AI parašytos knygos Lietuvoje autorius. Aurimas konsultuoja verslus dėl AI strategijos ir automatizacijos, kuria verslo valdymo sistemas, tinklapius ir apps — <a href="https://aurimaslevickas.lt" target="_blank" rel="noopener noreferrer" style={{ color: "#FFD23F", textDecoration: "underline", textUnderlineOffset: 3 }}>aurimaslevickas.lt</a></>}
            quote="Geras receptas — kai bet kas gali pakartoti. Net pirmą kartą."
            accent="#FFD23F"
            objectPos="50% 18%"
          />
          <ChefCard
            portrait="assets/chef-rytis.png"
            name="Rytis Zdanavičius"
            role="AI Patiekalų šefas"
            specialty="AI Patiekalai"
            bio={<>15 metų patirties socialiniuose tinkluose. Kuriamas turinys surinko 320M+ peržiūrų — 8 video peržengė 1M peržiūrų ribą. Mokymų platforma — <a href="https://rytis.io" target="_blank" rel="noopener noreferrer" style={{ color: "#4FB3FF", textDecoration: "underline", textUnderlineOffset: 3 }}>rytis.io</a>. AI Rytis naudoja turinio kūrime kasdien, moka, kaip iš dirbtinio intelekto gauti gyvus, ne robotiškus rezultatus.</>}
            quote="AI yra įrankis. Mokomės jį valdyti, ne atvirkščiai."
            accent="#4FB3FF"
            objectPos="50% 18%"
          />
        </div>
        <InlineCTA label="Susitikti su šefais" />
      </div>
    </section>
  );
}

// ───────────────────────────────────────────────────────────
// COUNTDOWN
// ───────────────────────────────────────────────────────────
function useCountdown(targetDate) {
  const [now, setNow] = React.useState(Date.now());
  React.useEffect(() => {
    const id = setInterval(() => setNow(Date.now()), 1000);
    return () => clearInterval(id);
  }, []);
  const diff = Math.max(0, targetDate - now);
  const days = Math.floor(diff / 86400000);
  const hours = Math.floor((diff % 86400000) / 3600000);
  const minutes = Math.floor((diff % 3600000) / 60000);
  const seconds = Math.floor((diff % 60000) / 1000);
  return { days, hours, minutes, seconds };
}

function CountdownBox({ value, label }) {
  return (
    <div style={{
      flex: 1,
      minWidth: 90,
      padding: "20px 12px",
      background: "rgba(0,0,0,.3)",
      border: "1px solid var(--line-2)",
      borderRadius: 14,
      textAlign: "center",
    }}>
      <div style={{
        fontFamily: "var(--font-display)",
        fontSize: "clamp(36px, 6vw, 56px)",
        fontWeight: 700,
        fontVariantNumeric: "tabular-nums",
        color: "var(--neon-yellow)",
        lineHeight: 1,
        letterSpacing: "-0.02em",
      }}>
        {String(value).padStart(2, "0")}
      </div>
      <div className="tag-mono" style={{ color: "var(--text-muted)", marginTop: 8 }}>{label}</div>
    </div>
  );
}

function SectionCountdown() {
  // Next Thursday 19:00 LT time
  const target = React.useMemo(() => {
    const d = new Date();
    const day = d.getDay();
    const daysUntilThu = (4 - day + 7) % 7 || 7;
    d.setDate(d.getDate() + daysUntilThu);
    d.setHours(19, 0, 0, 0);
    return d.getTime();
  }, []);
  const { days, hours, minutes, seconds } = useCountdown(target);

  return (
    <section id="laikrodis">
      <div className="container">
        <div style={{
          padding: "48px 36px",
          background: "linear-gradient(145deg, rgba(255,210,63,.06), rgba(79,179,255,.04))",
          border: "1px solid rgba(255,210,63,.2)",
          borderRadius: "var(--radius-xl)",
          position: "relative",
          overflow: "hidden",
        }}>
          <div style={{
            position: "absolute", top: -60, right: -60,
            width: 200, height: 200, borderRadius: "50%",
            background: "radial-gradient(circle, rgba(255,210,63,.15), transparent 70%)",
            pointerEvents: "none",
          }}></div>

          <div style={{ display: "flex", flexWrap: "wrap", gap: 32, alignItems: "center", justifyContent: "space-between" }}>
            <div style={{ maxWidth: 480 }}>
              <div style={{ display: "inline-flex", alignItems: "center", gap: 10, marginBottom: 14 }}>
                <span className="live-badge">● ARTĖJA</span>
                <span className="tag-mono" style={{ color: "var(--text-muted)" }}>Kita transliacija</span>
              </div>
              <h2 style={{ fontSize: "clamp(28px, 3.5vw, 42px)", marginBottom: 12 }}>
                Tiesioginė pamoka <span className="script" style={{ color: "var(--neon-yellow)" }}>prasidės</span>:
              </h2>
              <p className="text-muted">
                Antradienį, 19:00. Tema: „Kaip ChatGPT padės suplanuoti šeimos savaitę." Po pamokos — atsiunčiame įrašą ir užrašus.
              </p>
            </div>

            <div style={{ display: "flex", gap: 10, flex: 1, minWidth: 280, flexWrap: "wrap" }}>
              <CountdownBox value={days} label="Dienos" />
              <CountdownBox value={hours} label="Valandos" />
              <CountdownBox value={minutes} label="Min." />
              <CountdownBox value={seconds} label="Sek." />
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ───────────────────────────────────────────────────────────
// LIVE STREAM PLACEHOLDER
// ───────────────────────────────────────────────────────────
function SectionLive() {
  return (
    <section id="live">
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "minmax(0, 2.2fr) minmax(0, 1fr)", gap: 24 }} className="live-grid">
          <div style={{
            position: "relative",
            aspectRatio: "16/9",
            background: "linear-gradient(145deg, #0d1740, #060a20)",
            border: "1px solid var(--line-2)",
            borderRadius: "var(--radius-lg)",
            overflow: "hidden",
            display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center",
          }}>
            {/* Scanline texture */}
            <div style={{
              position: "absolute", inset: 0,
              background: "repeating-linear-gradient(to bottom, transparent 0 3px, rgba(79,179,255,.03) 3px 4px)",
              pointerEvents: "none",
            }}></div>

            {/* Big play */}
            <div style={{
              width: 96, height: 96, borderRadius: "50%",
              background: "var(--neon-yellow)",
              display: "flex", alignItems: "center", justifyContent: "center",
              boxShadow: "0 0 48px rgba(255,210,63,.4)",
              cursor: "pointer",
              animation: "pulse-play 2.5s ease-in-out infinite",
            }}>
              <svg width="36" height="36" viewBox="0 0 24 24" fill="#0A1230">
                <path d="M8 5v14l11-7z" />
              </svg>
            </div>
            <div style={{ marginTop: 24, fontFamily: "var(--font-display)", fontSize: 22, fontWeight: 600 }}>
              Prisijunkite prie tiesioginės pamokos
            </div>
            <p className="text-muted" style={{ marginTop: 6, fontSize: 14 }}>
              Transliacija prasidės antradienį 19:00
            </p>

            {/* Corner overlays */}
            <div style={{ position: "absolute", top: 16, left: 16 }}>
              <span className="live-badge">● LIVE NETRUKUS</span>
            </div>
            <div style={{
              position: "absolute", top: 16, right: 16,
              padding: "4px 10px",
              fontFamily: "var(--font-mono)", fontSize: 11,
              background: "rgba(0,0,0,.5)", borderRadius: 4,
              color: "var(--text-muted)",
            }}>
              CH·12 · 1080p · LT
            </div>
          </div>

          {/* Chat sidebar */}
          <div style={{
            background: "var(--surface)",
            border: "1px solid var(--line)",
            borderRadius: "var(--radius-lg)",
            padding: 20,
            display: "flex", flexDirection: "column", gap: 14,
            minHeight: 300,
          }}>
            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
              <span style={{ fontFamily: "var(--font-display)", fontWeight: 600 }}>💬 Bendruomenės pokalbis</span>
              <span className="tag-mono" style={{ color: "var(--text-dim)" }}>247 online</span>
            </div>
            <div style={{ display: "flex", flexDirection: "column", gap: 12, fontSize: 14, flex: 1 }}>
              <ChatMsg name="Daiva" color="#FFD23F">Po praeitos pamokos ChatGPT suplanavo visą savaitę 😍</ChatMsg>
              <ChatMsg name="Lina" color="#4FB3FF">Ar bus apie Midjourney šiandien?</ChatMsg>
              <ChatMsg name="Rita" color="#FF9D2C">Ačiū už pamoką, viskas suprantama!</ChatMsg>
              <ChatMsg name="Aurelija" color="#A78BFA">Pirmoji savaitė, baisu prisijungti — visi tokie mieli ❤️</ChatMsg>
            </div>
            <div style={{
              padding: "12px 14px",
              background: "rgba(0,0,0,.25)",
              borderRadius: 999,
              fontSize: 14, color: "var(--text-dim)",
              border: "1px solid var(--line)",
            }}>
              Rašyti žinutę...
            </div>
          </div>
        </div>
      </div>
      <style>{`
        @keyframes pulse-play {
          0%, 100% { transform: scale(1); box-shadow: 0 0 48px rgba(255,210,63,.4); }
          50% { transform: scale(1.05); box-shadow: 0 0 64px rgba(255,210,63,.6); }
        }
        @media (max-width: 880px) {
          .live-grid { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

function ChatMsg({ name, color, children }) {
  return (
    <div style={{ display: "flex", gap: 10 }}>
      <span style={{ width: 28, height: 28, borderRadius: "50%", background: color, color: "#0A1230", display: "inline-flex", alignItems: "center", justifyContent: "center", fontWeight: 700, fontSize: 13, flexShrink: 0 }}>
        {name[0]}
      </span>
      <div>
        <div style={{ fontSize: 12, color, fontWeight: 600 }}>{name}</div>
        <div className="text-muted" style={{ fontSize: 14 }}>{children}</div>
      </div>
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// PRICING — Monthly + Annual
// ───────────────────────────────────────────────────────────
function SectionPricing({ price = 19 }) {
  const annualPrice = price * 10; // 2 months free
  const annualSavings = price * 2;

  const features = [
    "4 gyvi online susitikimai per mėnesį (antradieniais 19:00)",
    "4 klausimų-atsakymų sesijos per mėnesį",
    "Visos paskaitos įrašuose — žiūri, kada tau patogu",
    "Promptų ir AI agentų biblioteka — kopijuok ir naudok",
    "Uždara WhatsApp / Telegram bendruomenė",
    "Asmeninė pagalba nuo Aurimo ir Ryčio",
  ];

  return (
    <section id="kaina">
      <div className="container">
        <div style={{ textAlign: "center", maxWidth: 720, margin: "0 auto 48px" }}>
          <span className="tag-mono text-yellow">— Kainoraštis —</span>
          <h2 style={{ marginTop: 14 }}>
            Mažiau, nei <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em" }}>vakarienė restorane.</span>
          </h2>
          <p className="text-muted" style={{ marginTop: 14, fontSize: 18 }}>
            Pasirinkis mėnesinį arba metinį narystės planą. Atšaukite bet kada.
          </p>
        </div>

        <div style={{
          maxWidth: 960, margin: "0 auto",
          display: "grid",
          gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))",
          gap: 20,
          alignItems: "stretch",
        }}>
          {/* MONTHLY */}
          <PricingCard
            tag="Mėnesinis"
            tagline="Norintiems lankstumo"
            price={price}
            period="mėn."
            sub="Mokama kas mėnesį. Atšaukite bet kada."
            features={features}
            cta="Pasirinkti mėnesinį"
            ctaTarget="registracija"
            cycle="monthly"
          />
          {/* ANNUAL — featured */}
          <PricingCard
            tag="Metinis"
            tagline="Populiariausia · taupote 2 mėnesius"
            price={annualPrice}
            period="metams"
            sub={`Tik ${(annualPrice/12).toFixed(2).replace(".", ",")}€/mėn · vienkartinis mokėjimas`}
            features={[
              ...features,
              <strong style={{ color: "var(--neon-yellow)" }}>2 mėnesiai dovanai (taupote {annualSavings}€)</strong>,
              <strong style={{ color: "var(--neon-yellow)" }}>Bankinis pavedimas — galimas</strong>,
            ]}
            cta="Pasirinkti metinį"
            ctaTarget="registracija"
            cycle="annual"
            featured
          />
        </div>
      </div>
    </section>
  );
}

function PricingCard({ tag, tagline, price, period, sub, features, cta, ctaTarget, cycle, featured }) {
  return (
    <div style={{
      padding: 32,
      background: featured
        ? "linear-gradient(160deg, rgba(255,210,63,.10), rgba(79,179,255,.04) 60%, transparent)"
        : "var(--surface)",
      border: `1px solid ${featured ? "rgba(255,210,63,.4)" : "var(--line)"}`,
      borderRadius: "var(--radius-xl)",
      position: "relative",
      overflow: "hidden",
      display: "flex", flexDirection: "column",
    }}>
      {featured && (
        <div style={{
          position: "absolute", top: 20, right: 20,
          background: "var(--neon-yellow)", color: "#0A1230",
          padding: "6px 14px", borderRadius: 999,
          fontFamily: "var(--font-script)", fontSize: 18, fontWeight: 600,
          transform: "rotate(8deg)",
        }}>
          taupote 2 mėn!
        </div>
      )}

      <div className="tag-mono" style={{ color: featured ? "var(--neon-yellow)" : "var(--text-muted)" }}>{tag}</div>
      <div className="text-muted" style={{ fontSize: 13, marginTop: 4 }}>{tagline}</div>

      <div style={{ display: "flex", alignItems: "baseline", gap: 6, marginTop: 18 }}>
        <span style={{
          fontFamily: "var(--font-display)", fontSize: 60, fontWeight: 700,
          color: featured ? "var(--neon-yellow)" : "var(--text)",
          lineHeight: 1, letterSpacing: "-0.03em",
        }}>{price}€</span>
        <span className="text-muted" style={{ fontSize: 16 }}>/ {period}</span>
      </div>
      <p className="text-muted" style={{ marginTop: 8, fontSize: 13 }}>{sub}</p>

      <ul style={{ listStyle: "none", padding: 0, margin: "24px 0 0", display: "flex", flexDirection: "column", gap: 11, flex: 1 }}>
        {features.map((f, i) => (
          <li key={i} style={{ display: "flex", gap: 10, alignItems: "flex-start", fontSize: 14, lineHeight: 1.5 }}>
            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0, marginTop: 2 }}>
              <circle cx="12" cy="12" r="9" fill="var(--neon-yellow)"/>
              <path d="M7 12.5l3.5 3.5L17 8.5" stroke="#0A1230" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round"/>
            </svg>
            <span>{f}</span>
          </li>
        ))}
      </ul>

      <a
        href={`#${ctaTarget}`}
        onClick={() => { try { localStorage.setItem("aivirtuve_cycle", cycle); window.dispatchEvent(new Event("cycle-change")); } catch (e) {} }}
        className={featured ? "btn btn-primary" : "btn btn-ghost"}
        style={{ marginTop: 24, justifyContent: "center" }}
      >
        {cta}
        <svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M13 6l6 6-6 6" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" /></svg>
      </a>
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// FAQ
// ───────────────────────────────────────────────────────────
function FAQItem({ q, a, index }) {
  const [open, setOpen] = React.useState(index === 0);
  return (
    <div style={{
      borderBottom: "1px solid var(--line)",
      padding: "20px 0",
    }}>
      <button
        onClick={() => setOpen(!open)}
        style={{
          width: "100%", display: "flex", justifyContent: "space-between", alignItems: "center",
          background: "transparent", border: 0, padding: 0,
          color: "var(--text)", textAlign: "left",
          fontFamily: "var(--font-display)", fontSize: "clamp(18px, 2vw, 22px)", fontWeight: 600,
          cursor: "pointer",
        }}
      >
        <span style={{ paddingRight: 16 }}>{q}</span>
        <span style={{
          flexShrink: 0,
          width: 36, height: 36, borderRadius: "50%",
          background: open ? "var(--neon-yellow)" : "var(--surface-2)",
          color: open ? "#0A1230" : "var(--text)",
          display: "inline-flex", alignItems: "center", justifyContent: "center",
          transition: "background .25s, transform .25s",
          transform: open ? "rotate(45deg)" : "rotate(0)",
        }}>
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12h14" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round"/></svg>
        </span>
      </button>
      <div style={{
        maxHeight: open ? 400 : 0,
        overflow: "hidden",
        transition: "max-height .35s ease, margin .25s",
        marginTop: open ? 14 : 0,
      }}>
        <p className="text-muted" style={{ fontSize: 16, paddingRight: 52 }}>{a}</p>
      </div>
    </div>
  );
}

function SectionFAQ() {
  const faqs = [
    {
      q: "Aš visiškai nieko nesu darius su AI. Tikrai galėsiu sekti?",
      a: "Tikrai. Programa sukurta būtent pradedantiesiems — nuo pirmo paspaudimo iki realaus rezultato. Neturi reikšmės, ar dirbote IT srityje, ar ne. Pradedame nuo nulio ir einame žingsnis po žingsnio.",
    },
    {
      q: "Kiek laiko tai užims per savaitę?",
      a: "Užtenka 1 valandos per savaitę. Tiesioginė pamoka antradieniais 19:00 trunka apie 1 val. + per mėnesį dar 4 klausimų-atsakymų sesijos. Visus įrašus gali pažiūrėti savo laiku — jeigu kažkurią savaitę praleidi, viskas išlieka tavo narystei.",
    },
    {
      q: "Kas vyksta tiesioginėse pamokose?",
      a: "Aurimas arba Rytis pristato vieną temą (pvz. \u201Ekaip naudoti ChatGPT planavimui\u201C), parodo gyvai, kaip jis pats tai daro, ir atsako į tavo klausimus. Daug praktikos, mažai teorijos.",
    },
    {
      q: "O jeigu kursai man netiks?",
      a: "Atšaukti narystę gali bet kada — be klausimų, be sutarčių. Moki tik už tą mėnesį, kurį naudoji.",
    },
    {
      q: "Ar gausiu sertifikatą?",
      a: "Bendruomenė nesiekia sertifikato — ji siekia, kad tu realiai mokėtum naudoti AI. Tačiau jeigu reikia patvirtinimo darbdaviui — pateiksime dalyvavimo dokumentą.",
    },
    {
      q: "Kokie įrankiai bus mokomi?",
      a: "ChatGPT, Claude, Midjourney ir Gemini — pagrindiniai. Kartas nuo karto pridedame naujus, kai pasirodo verti dėmesio.",
    },
  ];
  return (
    <section id="duk" style={{ background: "var(--bg-2)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container" style={{ maxWidth: 880 }}>
        <div style={{ textAlign: "center", marginBottom: 40 }}>
          <span className="tag-mono text-yellow">— DUK —</span>
          <h2 style={{ marginTop: 14 }}>
            Dažniausiai užduodami <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em" }}>klausimai</span>
          </h2>
        </div>
        <div>
          {faqs.map((f, i) => <FAQItem key={i} index={i} q={f.q} a={f.a} />)}
        </div>
      </div>
    </section>
  );
}

// ───────────────────────────────────────────────────────────
// CHECKOUT — Apmokėjimas (Shopify/Stripe-style structure, dark theme)
// ───────────────────────────────────────────────────────────
function CheckoutField({ label, type = "text", value, onChange, placeholder, required, optional, autoComplete }) {
  return (
    <label style={{ display: "flex", flexDirection: "column", gap: 6 }}>
      <span style={{ fontSize: 13, fontWeight: 500, color: "var(--text-muted)", display: "flex", justifyContent: "space-between" }}>
        <span>{label} {required && <span style={{ color: "var(--neon-yellow)" }}>*</span>}</span>
        {optional && <span style={{ color: "var(--text-dim)", fontWeight: 400 }}>nebūtina</span>}
      </span>
      <input
        type={type}
        required={required}
        autoComplete={autoComplete}
        placeholder={placeholder}
        value={value}
        onChange={onChange}
        style={{
          padding: "13px 16px",
          background: "rgba(0,0,0,.3)",
          border: "1px solid var(--line-2)",
          borderRadius: 10,
          color: "var(--text)",
          fontFamily: "var(--font-body)",
          fontSize: 15,
          outline: "none",
          transition: "border-color .2s, background .2s",
          width: "100%",
        }}
        onFocus={(e) => { e.target.style.borderColor = "var(--neon-yellow)"; e.target.style.background = "rgba(0,0,0,.4)"; }}
        onBlur={(e) => { e.target.style.borderColor = "var(--line-2)"; e.target.style.background = "rgba(0,0,0,.3)"; }}
      />
    </label>
  );
}

function CheckoutSelect({ label, value, onChange, options, required }) {
  return (
    <label style={{ display: "flex", flexDirection: "column", gap: 6 }}>
      <span style={{ fontSize: 13, fontWeight: 500, color: "var(--text-muted)" }}>
        {label} {required && <span style={{ color: "var(--neon-yellow)" }}>*</span>}
      </span>
      <select
        required={required}
        value={value}
        onChange={onChange}
        style={{
          padding: "13px 16px",
          background: "rgba(0,0,0,.3)",
          border: "1px solid var(--line-2)",
          borderRadius: 10,
          color: "var(--text)",
          fontFamily: "var(--font-body)",
          fontSize: 15,
          outline: "none",
          appearance: "none",
          backgroundImage: "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23F8F5E9' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round' opacity='.6'/%3E%3C/svg%3E\")",
          backgroundRepeat: "no-repeat",
          backgroundPosition: "right 16px center",
          paddingRight: 40,
        }}
      >
        {options.map(o => <option key={o.value} value={o.value} style={{ background: "#0A1230" }}>{o.label}</option>)}
      </select>
    </label>
  );
}

function CycleOption({ active, onClick, title, detail, badge }) {
  return (
    <button
      type="button"
      onClick={onClick}
      style={{
        position: "relative",
        padding: "14px 18px",
        background: active ? "var(--neon-yellow)" : "transparent",
        color: active ? "#0A1230" : "var(--text)",
        border: 0,
        borderRadius: 10,
        cursor: "pointer",
        textAlign: "left",
        transition: "all .2s",
        display: "flex", alignItems: "center", justifyContent: "space-between",
        gap: 12,
      }}
    >
      <div>
        <div style={{ fontFamily: "var(--font-display)", fontWeight: 700, fontSize: 15, lineHeight: 1.1 }}>{title}</div>
        <div style={{ fontSize: 12, opacity: 0.75, marginTop: 2 }}>{detail}</div>
      </div>
      {badge && (
        <span style={{
          fontFamily: "var(--font-script)",
          fontSize: 16, fontWeight: 600,
          color: active ? "#0A1230" : "var(--neon-yellow)",
          background: active ? "rgba(10,18,48,.12)" : "rgba(255,210,63,.12)",
          padding: "3px 10px", borderRadius: 999,
          whiteSpace: "nowrap",
        }}>{badge}</span>
      )}
    </button>
  );
}

function PaymentMethodRadio({ id, value, current, onChange, icon, title, subtitle }) {
  const active = value === current;
  return (
    <label style={{
      display: "flex",
      alignItems: "center",
      gap: 14,
      padding: "16px 18px",
      background: active ? "rgba(255,210,63,.08)" : "rgba(0,0,0,.3)",
      border: `1px solid ${active ? "var(--neon-yellow)" : "var(--line-2)"}`,
      borderRadius: 12,
      cursor: "pointer",
      transition: "all .2s",
    }}>
      <input type="radio" name="payment" value={value} checked={active} onChange={onChange} style={{ accentColor: "var(--neon-yellow)", margin: 0 }} />
      {icon}
      <div style={{ flex: 1, minWidth: 0 }}>
        <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 15 }}>{title}</div>
        <div className="text-muted" style={{ fontSize: 13 }}>{subtitle}</div>
      </div>
    </label>
  );
}

function CheckoutProgress({ step }) {
  const steps = ["Krepšelis", "Apmokėjimas", "Patvirtinimas"];
  return (
    <div style={{ display: "flex", justifyContent: "center", alignItems: "center", gap: 0, flexWrap: "wrap", marginBottom: 40 }}>
      {steps.map((label, i) => (
        <React.Fragment key={i}>
          <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
            <span style={{
              width: 24, height: 24, borderRadius: "50%",
              border: `2px solid ${i <= step ? "var(--neon-yellow)" : "var(--line-2)"}`,
              background: i < step ? "var(--neon-yellow)" : "transparent",
              display: "inline-flex", alignItems: "center", justifyContent: "center",
              flexShrink: 0,
            }}>
              {i < step && <svg width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M7 12.5l3.5 3.5L17 8.5" stroke="#0A1230" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"/></svg>}
              {i === step && <span style={{ width: 8, height: 8, borderRadius: "50%", background: "var(--neon-yellow)" }}></span>}
            </span>
            <span style={{
              fontFamily: "var(--font-mono)",
              fontSize: 12,
              fontWeight: 600,
              letterSpacing: "0.1em",
              textTransform: "uppercase",
              color: i === step ? "var(--text)" : "var(--text-muted)",
            }}>{label}</span>
          </div>
          {i < steps.length - 1 && (
            <span style={{
              width: "clamp(40px, 8vw, 100px)",
              height: 1,
              background: i < step ? "var(--neon-yellow)" : "var(--line-2)",
              margin: "0 14px",
            }}></span>
          )}
        </React.Fragment>
      ))}
    </div>
  );
}

function SectionRegistration({ price = 19 }) {
  const [submitted, setSubmitted] = React.useState(false);
  const [loading, setLoading] = React.useState(false);
  const [showCoupon, setShowCoupon] = React.useState(false);
  const [couponApplied, setCouponApplied] = React.useState(false);
  const [paymentMethod, setPaymentMethod] = React.useState("card");
  const [cycle, setCycle] = React.useState(() => {
    try { return localStorage.getItem("aivirtuve_cycle") || "monthly"; } catch (e) { return "monthly"; }
  });
  const [form, setForm] = React.useState({
    name: "", surname: "", company: "",
    country: "LT", address: "", city: "", postal: "",
    phone: "", email: "", coupon: "",
  });

  // Listen for cycle changes from pricing card clicks
  React.useEffect(() => {
    const handler = () => {
      try { setCycle(localStorage.getItem("aivirtuve_cycle") || "monthly"); } catch (e) {}
    };
    window.addEventListener("cycle-change", handler);
    return () => window.removeEventListener("cycle-change", handler);
  }, []);

  // If user switches to monthly, force card payment (bank transfer not allowed for recurring)
  React.useEffect(() => {
    if (cycle === "monthly" && paymentMethod === "bank") {
      setPaymentMethod("card");
    }
  }, [cycle, paymentMethod]);

  const update = (k) => (e) => setForm(s => ({ ...s, [k]: e.target.value }));

  const basePrice = cycle === "annual" ? price * 10 : price;
  const cycleLabel = cycle === "annual" ? "metams" : "mėn.";
  const discount = couponApplied ? 5 : 0;
  const total = Math.max(0, basePrice - discount);

  function handleSubmit(e) {
    e.preventDefault();
    setLoading(true);
    // Placeholder: would POST to backend → Stripe Checkout Session → redirect
    setTimeout(() => {
      setLoading(false);
      setSubmitted(true);
    }, 900);
  }

  return (
    <section id="registracija" style={{ paddingTop: 72, paddingBottom: 120 }}>
      <div className="container" style={{ maxWidth: 1120 }}>
        <div style={{ textAlign: "center", maxWidth: 720, margin: "0 auto 32px" }}>
          <span className="tag-mono text-yellow">— Apmokėjimas —</span>
          <h2 style={{ marginTop: 14 }}>
            Vienas žingsnis — ir esi <span className="script" style={{ color: "var(--neon-yellow)", fontSize: "1.15em" }}>virtuvėje.</span>
          </h2>
        </div>

        <CheckoutProgress step={submitted ? 2 : 1} />

        {/* BILLING CYCLE TOGGLE */}
        {!submitted && (
          <div style={{
            maxWidth: 580, margin: "0 auto 24px",
            padding: 6,
            background: "rgba(0,0,0,.3)",
            border: "1px solid var(--line-2)",
            borderRadius: 14,
            display: "grid",
            gridTemplateColumns: "1fr 1fr",
            gap: 4,
            position: "relative",
          }}>
            <CycleOption
              active={cycle === "monthly"}
              onClick={() => setCycle("monthly")}
              title="Mėnesinis"
              detail={`${price}€ / mėn.`}
            />
            <CycleOption
              active={cycle === "annual"}
              onClick={() => setCycle("annual")}
              title="Metinis"
              detail={`${price * 10}€ / metams`}
              badge={`taupote ${price * 2}€`}
            />
          </div>
        )}

        {!submitted ? (
          <form onSubmit={handleSubmit} style={{
            display: "grid",
            gridTemplateColumns: "minmax(0, 1.4fr) minmax(0, 1fr)",
            gap: 24,
            alignItems: "start",
          }} className="checkout-grid">
            {/* LEFT — payment details */}
            <div style={{
              padding: "clamp(24px, 3vw, 36px)",
              background: "var(--surface)",
              border: "1px solid var(--line)",
              borderRadius: "var(--radius-xl)",
            }}>
              <h3 style={{ fontSize: 22, margin: "0 0 22px" }}>Tavo duomenys</h3>

              <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14, marginBottom: 14 }} className="checkout-row">
                <CheckoutField label="Vardas" required autoComplete="given-name" value={form.name} onChange={update("name")} placeholder="Daiva" />
                <CheckoutField label="Pavardė" required autoComplete="family-name" value={form.surname} onChange={update("surname")} placeholder="Pavardenytė" />
              </div>
              <div style={{ marginBottom: 14 }}>
                <CheckoutField label="El. paštas" type="email" required autoComplete="email" value={form.email} onChange={update("email")} placeholder="daiva@pavyzdys.lt" />
              </div>
              <div style={{ marginBottom: 28 }}>
                <CheckoutField label="Tel. Nr." type="tel" required autoComplete="tel" value={form.phone} onChange={update("phone")} placeholder="+370 ..." />
              </div>

              <h3 style={{ fontSize: 22, margin: "0 0 16px", paddingTop: 24, borderTop: "1px dashed var(--line-2)" }}>Apmokėjimo būdas</h3>

              <div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
                <PaymentMethodRadio
                  value="card"
                  current={paymentMethod}
                  onChange={() => setPaymentMethod("card")}
                  icon={
                    <div style={{
                      width: 44, height: 32, borderRadius: 6,
                      background: "linear-gradient(135deg, #635BFF, #5851DB)",
                      display: "flex", alignItems: "center", justifyContent: "center",
                      flexShrink: 0,
                      fontFamily: "var(--font-display)", fontWeight: 800, fontSize: 14, color: "white",
                    }}>S</div>
                  }
                  title="Mokėjimo kortele · Stripe"
                  subtitle={cycle === "annual"
                    ? "Vienkartinis mokėjimas metams · Visa, Mastercard, Apple/Google Pay"
                    : "Auto-nuskaitymas kas mėnesį · Visa, Mastercard, Apple/Google Pay"}
                />
                {/* Bank transfer — only available for annual */}
                {cycle === "annual" ? (
                  <PaymentMethodRadio
                    value="bank"
                    current={paymentMethod}
                    onChange={() => setPaymentMethod("bank")}
                    icon={
                      <div style={{
                        width: 44, height: 32, borderRadius: 6,
                        background: "rgba(255,255,255,.08)",
                        border: "1px solid var(--line-2)",
                        display: "flex", alignItems: "center", justifyContent: "center",
                        flexShrink: 0,
                        color: "var(--neon-yellow)",
                      }}>
                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none">
                          <path d="M3 10l9-6 9 6M5 10v9M19 10v9M9 10v9M15 10v9M3 21h18" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/>
                        </svg>
                      </div>
                    }
                    title="Bankinis pavedimas"
                    subtitle="Sąskaitą atsiųsime el. paštu · prieiga po pavedimo (1–2 d.d.)"
                  />
                ) : (
                  <div style={{
                    padding: "14px 18px",
                    background: "rgba(0,0,0,.15)",
                    border: "1px dashed var(--line)",
                    borderRadius: 12,
                    fontSize: 13,
                    color: "var(--text-dim)",
                    display: "flex", alignItems: "center", gap: 10,
                  }}>
                    <svg width="16" height="16" viewBox="0 0 24 24" fill="none" style={{ flexShrink: 0 }}>
                      <circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth="2"/>
                      <path d="M12 8v5M12 16v.5" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/>
                    </svg>
                    Bankinis pavedimas — tik metiniam planui (mėnesiniam reikia auto-nuskaitymo)
                  </div>
                )}
              </div>
            </div>

            {/* RIGHT — order summary */}
            <div style={{
              position: "sticky", top: 80,
              padding: "clamp(24px, 3vw, 32px)",
              background: "linear-gradient(160deg, rgba(255,210,63,.10), rgba(79,179,255,.04) 70%)",
              border: "1px solid rgba(255,210,63,.3)",
              borderRadius: "var(--radius-xl)",
              display: "flex", flexDirection: "column", gap: 18,
            }} className="order-summary">
              <h3 style={{ fontSize: 22, margin: 0 }}>Tavo užsakymas</h3>

              {/* Column headers */}
              <div style={{ display: "flex", justifyContent: "space-between", paddingBottom: 8, borderBottom: "1px dashed var(--line-2)" }}>
                <span className="tag-mono" style={{ color: "var(--text-dim)" }}>Prekė</span>
                <span className="tag-mono" style={{ color: "var(--text-dim)" }}>Viso</span>
              </div>

              {/* Product line */}
              <div style={{ display: "flex", gap: 14, alignItems: "flex-start", paddingBottom: 14, borderBottom: "1px dashed var(--line-2)" }}>
                <div style={{
                  width: 48, height: 48, borderRadius: 10,
                  background: "var(--bg-2)", border: "1px solid var(--line-2)",
                  display: "flex", alignItems: "center", justifyContent: "center",
                  flexShrink: 0,
                  color: "var(--neon-yellow)",
                  padding: 6,
                }}>
                  <BrainMark color="var(--neon-yellow)" />
                </div>
                <div style={{ flex: 1, minWidth: 0 }}>
                  <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 15, lineHeight: 1.25 }}>
                    AI Virtuvė · narystė
                  </div>
                  <div className="text-muted" style={{ fontSize: 12, marginTop: 3 }}>
                    {cycle === "annual"
                      ? `Metinis planas · 12 mėnesių prieiga · 2 mėn. dovanai`
                      : `Mėnesinis planas · Atnaujinama kas mėn. · Atšaukite bet kada`}
                  </div>
                </div>
                <div style={{ display: "flex", alignItems: "baseline", gap: 8, whiteSpace: "nowrap" }}>
                  <span className="text-muted" style={{ fontSize: 13 }}>× 1</span>
                  <span style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 15 }}>{basePrice.toFixed(2).replace(".", ",")}€</span>
                </div>
              </div>

              {/* Totals */}
              <div style={{ display: "flex", flexDirection: "column", gap: 8, fontSize: 14, paddingTop: 6 }}>
                <div style={{ display: "flex", justifyContent: "space-between", color: "var(--text-muted)" }}>
                  <span>Tarpinė suma</span>
                  <span>{basePrice.toFixed(2).replace(".", ",")}€</span>
                </div>
                {cycle === "annual" && (
                  <div style={{ display: "flex", justifyContent: "space-between", color: "var(--neon-yellow)" }}>
                    <span>Metinė nuolaida (2 mėn. dovanai)</span>
                    <span>−2 mėn.</span>
                  </div>
                )}
              </div>

              <div style={{
                paddingTop: 18, borderTop: "1px solid var(--line-2)",
                display: "flex", justifyContent: "space-between", alignItems: "baseline",
              }}>
                <span style={{ fontFamily: "var(--font-display)", fontSize: 18, fontWeight: 700 }}>
                  Viso
                </span>
                <span style={{
                  fontFamily: "var(--font-display)", fontSize: 36, fontWeight: 700,
                  color: "var(--neon-yellow)", letterSpacing: "-0.02em", lineHeight: 1,
                }}>
                  {total.toFixed(2).replace(".", ",")}€
                </span>
              </div>

              <button type="submit" disabled={loading} className="btn btn-primary" style={{ justifyContent: "center", width: "100%", marginTop: 4, opacity: loading ? 0.7 : 1 }}>
                {loading ? (
                  <>
                    <span style={{ width: 16, height: 16, border: "2px solid #0A1230", borderTopColor: "transparent", borderRadius: "50%", animation: "spin 0.7s linear infinite", display: "inline-block" }}></span>
                    Nukreipiama...
                  </>
                ) : paymentMethod === "card" ? (
                  <>
                    Apmokėti per Stripe
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none">
                      <rect x="4" y="11" width="16" height="10" rx="2" stroke="currentColor" strokeWidth="2"/>
                      <path d="M8 11V7a4 4 0 0 1 8 0v4" stroke="currentColor" strokeWidth="2"/>
                    </svg>
                  </>
                ) : (
                  <>
                    Pateikti užsakymą
                    <svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M13 6l6 6-6 6" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" /></svg>
                  </>
                )}
              </button>

              <p className="text-muted" style={{ fontSize: 12, textAlign: "center", marginTop: 0 }}>
                Spausdami patvirtinate <a href="naudojimosi-salygos.html" target="_blank" rel="noopener" style={{ color: "var(--text)", textDecoration: "underline" }}>Naudojimo sąlygas</a> ir <a href="privatumo-politika.html" target="_blank" rel="noopener" style={{ color: "var(--text)", textDecoration: "underline" }}>Privatumo politiką</a>.
              </p>

              {/* Trust row */}
              <div style={{ display: "flex", justifyContent: "space-between", paddingTop: 14, borderTop: "1px solid var(--line)", gap: 6, flexWrap: "wrap" }}>
                <TrustBit label="Atšaukite bet kada" />
                <TrustBit label="14 d. garantija" />
                <TrustBit label="Saugu su Stripe" />
              </div>
            </div>
          </form>
        ) : (
          // SUCCESS STATE — patvirtinimas
          <div style={{
            maxWidth: 640, margin: "0 auto",
            padding: 44, textAlign: "center",
            background: "linear-gradient(160deg, rgba(255,210,63,.10), rgba(79,179,255,.06))",
            border: "1px solid rgba(255,210,63,.4)",
            borderRadius: "var(--radius-xl)",
          }}>
            <div style={{ fontSize: 56 }}>🎉</div>
            <h3 style={{ marginTop: 14, color: "var(--neon-yellow)", fontSize: 32 }}>Sveiki atvykę į virtuvę, {form.name}!</h3>
            <p className="text-muted" style={{ marginTop: 12, fontSize: 16 }}>
              {paymentMethod === "card"
                ? "Apmokėjimas sėkmingas."
                : "Užsakymas priimtas. Sąskaitą bankiniam pavedimui išsiuntėme el. paštu."}
              {" "}Per 5 minutes gausite kvietimo nuorodą į <strong style={{ color: "var(--text)" }}>{form.email}</strong>.
            </p>
            <div style={{ marginTop: 24, padding: "16px 20px", background: "rgba(0,0,0,.3)", borderRadius: 12, fontSize: 14, color: "var(--text-muted)", display: "inline-block" }}>
              Užsakymas: <strong style={{ color: "var(--neon-yellow)" }}>{total}€</strong> · AI Virtuvė narystė · #LT{Math.floor(Math.random() * 90000 + 10000)}
            </div>
          </div>
        )}
      </div>
      <style>{`
        @keyframes spin { to { transform: rotate(360deg); } }
        @media (max-width: 900px) {
          .checkout-grid { grid-template-columns: 1fr !important; }
          .order-summary { position: relative !important; top: auto !important; }
        }
        @media (max-width: 520px) {
          .checkout-row { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

function TrustBit({ label }) {
  return (
    <div style={{ display: "flex", alignItems: "center", gap: 6, fontSize: 12, color: "var(--text-muted)" }}>
      <svg width="13" height="13" viewBox="0 0 24 24" fill="none" style={{ color: "var(--neon-yellow)", flexShrink: 0 }}>
        <circle cx="12" cy="12" r="9" fill="currentColor"/>
        <path d="M7 12.5l3.5 3.5L17 8.5" stroke="#0A1230" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round"/>
      </svg>
      <span style={{ whiteSpace: "nowrap" }}>{label}</span>
    </div>
  );
}

// ───────────────────────────────────────────────────────────
// NAV + FOOTER
// ───────────────────────────────────────────────────────────
function BrainMark({ color = "currentColor" }) {
  // Stylized two-hemisphere brain, matching the apron print
  return (
    <svg viewBox="0 0 64 64" fill="none" stroke={color} strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round">
      {/* Left hemisphere */}
      <path d="M30 14 C 22 12, 14 16, 14 24 C 8 26, 8 34, 14 36 C 12 42, 16 48, 22 48 C 24 52, 30 52, 30 48 Z"/>
      {/* Right hemisphere */}
      <path d="M34 14 C 42 12, 50 16, 50 24 C 56 26, 56 34, 50 36 C 52 42, 48 48, 42 48 C 40 52, 34 52, 34 48 Z"/>
      {/* Central divider gyri */}
      <path d="M32 14 L 32 50"/>
      {/* Inner curves — left */}
      <path d="M22 22 C 26 24, 26 28, 22 30"/>
      <path d="M18 32 C 22 33, 22 38, 18 40"/>
      <path d="M26 38 C 28 40, 28 44, 26 46"/>
      {/* Inner curves — right */}
      <path d="M42 22 C 38 24, 38 28, 42 30"/>
      <path d="M46 32 C 42 33, 42 38, 46 40"/>
      <path d="M38 38 C 36 40, 36 44, 38 46"/>
    </svg>
  );
}

function BrandLogo({ size = "md", color = "var(--text)" }) {
  return (
    <span className={`brand-logo${size === "lg" ? " size-lg" : ""}`}>
      <span className="brain-mark" style={{ color }}>
        <BrainMark color={color} />
      </span>
      <span className="brand-text">
        <span className="brand-ai">AI</span>
        <span className="brand-virtuve">virtuvė</span>
      </span>
    </span>
  );
}

function Nav() {
  return (
    <nav className="nav">
      <div className="nav-inner">
        <a href="#" style={{ display: "inline-flex", alignItems: "center" }}>
          <BrandLogo />
        </a>
        <div className="nav-links">
          <a href="#kam">Kam tai</a>
          <a href="#apie">Šefai</a>
          <a href="#atsiliepimai">Atsiliepimai</a>
          <a href="#kaina">Kaina</a>
          <a href="#duk">DUK</a>
          <a href="#registracija" className="nav-cta" style={{ marginLeft: 8, fontSize: 14 }}>Prisijungti</a>
        </div>
      </div>
    </nav>
  );
}

function Footer() {
  return (
    <footer style={{
      borderTop: "1px solid var(--line)",
      padding: "48px 0 32px",
      background: "var(--bg-2)",
    }}>
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr)", gap: 32, marginBottom: 32 }} className="footer-grid">
          <div>
            <div style={{ marginBottom: 14 }}>
              <BrandLogo />
            </div>
            <p className="text-muted" style={{ fontSize: 14, maxWidth: 360 }}>
              Receptai iš proto, skonis iš širdies. Lietuviška AI mokymų bendruomenė.
            </p>
          </div>
          <div>
            <div className="tag-mono" style={{ marginBottom: 12, color: "var(--text)" }}>Naršyti</div>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 8, fontSize: 14 }}>
              <li><a href="#kam" className="text-muted">Kam tai skirta</a></li>
              <li><a href="#apie" className="text-muted">Apie vedėjus</a></li>
              <li><a href="#kaina" className="text-muted">Kaina</a></li>
              <li><a href="#duk" className="text-muted">DUK</a></li>
            </ul>
          </div>
          <div>
            <div className="tag-mono" style={{ marginBottom: 12, color: "var(--text)" }}>Teisinė info</div>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 8, fontSize: 14 }}>
              <li><a href="naudojimosi-salygos.html" className="text-muted">Naudojimo sąlygos</a></li>
              <li><a href="privatumo-politika.html" className="text-muted">Privatumo politika</a></li>
              <li><a href="mailto:labas@aivirtuve.lt" className="text-muted">labas@aivirtuve.lt</a></li>
            </ul>
          </div>
        </div>
        <div style={{ paddingTop: 24, borderTop: "1px solid var(--line)", display: "flex", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", gap: 12 }}>
          <div className="text-dim" style={{ fontSize: 13, color: "var(--text-dim)" }}>
            © 2026 Projektas „AI virtuvė". Visos teisės saugomos.
          </div>
          <div className="text-dim" style={{ fontSize: 13, color: "var(--text-dim)", fontFamily: "var(--font-script)", fontSize: 20 }}>
            iškepta su ♥ Lietuvoje
          </div>
        </div>
      </div>
      <style>{`
        @media (max-width: 720px) {
          .footer-grid { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </footer>
  );
}

Object.assign(window, {
  BrainMark, BrandLogo, CycleOption, PricingCard,
  SectionTurnOn, SectionAudience, SectionAIMenu, SectionTransformation, SectionTools,
  SectionHosts, SectionTestimonials, SectionCountdown, SectionLive, SectionPricing, SectionFAQ,
  SectionRegistration, MobileStickyCTA, Nav, Footer,
});
