/* Repaga — components */

function Icon({ name, size = 16, ...rest }) {
  const p = { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.6, strokeLinecap: "round", strokeLinejoin: "round", ...rest };
  switch (name) {
    case "arrow-right": return <svg {...p}><path d="M5 12h14M13 6l6 6-6 6"/></svg>;
    case "arrow-down-right": return <svg {...p}><path d="M7 7l10 10M17 7v10H7"/></svg>;
    case "check": return <svg {...p}><path d="M20 6 9 17l-5-5"/></svg>;
    case "x": return <svg {...p}><path d="M18 6 6 18M6 6l12 12"/></svg>;
    case "zap": return <svg {...p}><path d="M13 2 3 14h9l-1 8 10-12h-9l1-8z"/></svg>;
    case "shield": return <svg {...p}><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>;
    case "trend-down": return <svg {...p}><path d="M22 17l-8.5-8.5-5 5L2 7"/><path d="M16 17h6v-6"/></svg>;
    case "trend-up": return <svg {...p}><path d="M22 7l-8.5 8.5-5-5L2 17"/><path d="M16 7h6v6"/></svg>;
    case "calc": return <svg {...p}><rect x="4" y="3" width="16" height="18" rx="2"/><path d="M8 7h8M8 12h.01M12 12h.01M16 12h.01M8 16h.01M12 16h.01M16 16h.01"/></svg>;
    case "msg": return <svg {...p}><path d="M21 11.5a8.4 8.4 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.4 8.4 0 0 1-3.8-.9L3 21l1.9-5.7a8.4 8.4 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.4 8.4 0 0 1 3.8-.9h.5a8.5 8.5 0 0 1 8 8v.5z"/></svg>;
    case "mail": return <svg {...p}><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><path d="m22 6-10 7L2 6"/></svg>;
    case "phone": return <svg {...p}><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.37 1.9.72 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.35 1.85.59 2.81.72A2 2 0 0 1 22 16.92z"/></svg>;
    case "plug": return <svg {...p}><path d="M12 22v-5M9 8V2M15 8V2M5 10h14a2 2 0 0 1 2 2 7 7 0 0 1-7 7h-4a7 7 0 0 1-7-7 2 2 0 0 1 2-2z"/></svg>;
    case "lock": return <svg {...p}><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>;
    case "clock": return <svg {...p}><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>;
    case "chevron-down": return <svg {...p}><path d="m6 9 6 6 6-6"/></svg>;
    case "sun": return <svg {...p}><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>;
    case "moon": return <svg {...p}><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>;
    default: return null;
  }
}

const Money = ({ value, prefix = "R$" }) => {
  const v = Math.round(value).toLocaleString("pt-BR");
  return <span className="money">{prefix}{prefix ? " " : ""}{v}</span>;
};

function Nav({ theme, setTheme }) {
  return (
    <header className="nav">
      <div className="container nav-inner">
        <a href="#" className="brand">
          <span className="brand-mark">R</span>
          <span>Repaga</span>
          </a>
        <nav style={{ display: "flex", gap: 4 }}>
          <a className="nav-link" href="#como-funciona">Como funciona</a>
          <a className="nav-link" href="#integra">Integrações</a>
          <a className="nav-link" href="#preco">Preço</a>
          <a className="nav-link" href="#faq">FAQ</a>
        </nav>
        <div style={{ display: "flex", gap: 8, alignItems: "center" }}>
          <button className="theme-toggle" onClick={() => setTheme(theme === "dark" ? "light" : "dark")} title={theme === "dark" ? "Modo claro" : "Modo escuro"} aria-label="Alternar tema">
            <Icon name={theme === "dark" ? "sun" : "moon"} size={15}/>
          </button>
          <a href="#calc" className="btn btn-ghost btn-sm">Entrar</a>
          <a href="#calc" className="btn btn-primary btn-sm"><span className="nav-cta-text">Calcular meu vazamento</span><span style={{ display: "none" }} className="nav-cta-short">Calcular</span> <Icon name="arrow-right" size={13}/></a>
        </div>
      </div>
    </header>
  );
}

function Hero() {
  return (
    <section style={{ paddingTop: 72, paddingBottom: 48, position: "relative", overflow: "hidden" }}>
      <div className="bg-grid" style={{ position: "absolute", inset: 0, opacity: 0.5, pointerEvents: "none" }}/>
      <div className="container" style={{ position: "relative" }}>
        <span className="pill"><span className="dot"/>Pagamentos · feito pro Brasil</span>
        <h1 style={{ fontSize: "clamp(40px, 6.4vw, 76px)", marginTop: 22, marginBottom: 22, maxWidth: 920 }}>
          Lojas brasileiras perdem <span style={{ color: "var(--loss)" }}>5–15% do MRR</span> em pagamento falho.
          <br/>
          <span className="display" style={{ color: "var(--ink-soft)" }}>A Repaga repaga.</span>
        </h1>
        <p style={{ fontSize: 19, color: "var(--muted)", maxWidth: 620, marginBottom: 28, lineHeight: 1.55 }}>
          Cartão recusado, boleto esquecido, PIX que não passou. Repaga tenta de novo na hora certa, manda WhatsApp em PT-BR de gente, e te mostra exatamente quanto voltou pro caixa.
        </p>
        <div style={{ display: "flex", gap: 12, flexWrap: "wrap", alignItems: "center" }}>
          <a href="#calc" className="btn btn-primary btn-lg">
            <Icon name="calc" size={15}/> Calcular meu vazamento
          </a>
          <a href="#integra" className="btn btn-secondary btn-lg">
            <Icon name="plug" size={15}/> Conectar meu gateway
          </a>
        </div>
        <div style={{ display: "flex", gap: 24, marginTop: 28, flexWrap: "wrap", color: "var(--subtle)", fontSize: 13 }} className="mono">
          <span><Icon name="check" size={12}/> Sem código no seu produto</span>
          <span><Icon name="check" size={12}/> Mercado Pago · Pagar.me · Asaas · Iugu</span>
          <span><Icon name="check" size={12}/> WhatsApp Business oficial</span>
        </div>

        {/* Headline alternatives — for the user to pick */}
        <details style={{ marginTop: 56, fontSize: 12, color: "var(--subtle)" }}>
          <summary className="mono" style={{ cursor: "pointer", textTransform: "uppercase", letterSpacing: "0.08em" }}>3 variações de headline (designer note)</summary>
          <div style={{ display: "grid", gap: 10, marginTop: 14, paddingLeft: 14, borderLeft: "2px solid var(--line)" }}>
            <div><span className="pill" style={{ marginRight: 10, background: "var(--accent-soft)", color: "var(--accent)", borderColor: "transparent" }}>★ MELHOR</span> "Lojas brasileiras perdem 5–15% do MRR em pagamento falho. A gente devolve quase tudo."</div>
            <div><span className="pill" style={{ marginRight: 10 }}>B</span>"Seu gateway falha. A gente liga no cliente, no dia certo, no canal certo."</div>
            <div><span className="pill" style={{ marginRight: 10 }}>C</span>"Recovery de pagamento, feito pra Brasil. Stripe não atende aqui — a gente sim."</div>
          </div>
        </details>
      </div>
    </section>
  );
}

/* Calculadora — input MRR, taxa estimada, output recuperado */
function Calc() {
  const [mrr, setMrr] = React.useState(50000);
  const [leak, setLeak] = React.useState(8); // %
  const monthly = mrr * (leak / 100);
  const yearly = monthly * 12;
  const recovered = monthly * 0.65; // Repaga claim: ~65% recovery
  const recoveredYear = recovered * 12;

  return (
    <section id="calc" style={{ background: "var(--bg-sunken)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1.2fr", gap: 56, alignItems: "center" }}>
          <div>
            <span className="pill"><Icon name="calc" size={12}/> Calculadora honesta</span>
            <h2 style={{ fontSize: "clamp(28px, 3.5vw, 44px)", marginTop: 16, marginBottom: 14 }}>
              Quanto você está perdendo <span className="display">agora mesmo?</span>
            </h2>
            <p style={{ color: "var(--muted)", fontSize: 16, lineHeight: 1.6, maxWidth: 460 }}>
              Mexe nos sliders. A média do mercado BR é 8% — a gente recupera ~65% disso. Se o seu vazamento for menor, ótimo, Repaga não é pra você.
            </p>
          </div>

          <div className="card" style={{ padding: 28, boxShadow: "var(--shadow-lg)" }}>
            <div style={{ marginBottom: 22 }}>
              <div style={{ display: "flex", justifyContent: "space-between", marginBottom: 8 }}>
                <label className="mono" style={{ fontSize: 11, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--subtle)" }}>Seu MRR</label>
                <span className="money" style={{ fontWeight: 600 }}><Money value={mrr}/></span>
              </div>
              <input type="range" min="5000" max="500000" step="1000" value={mrr} onChange={(e) => setMrr(+e.target.value)} style={{ width: "100%", accentColor: "var(--ink)" }}/>
              <div className="mono" style={{ display: "flex", justifyContent: "space-between", fontSize: 10, color: "var(--subtle)", marginTop: 4 }}>
                <span>R$ 5K</span><span>R$ 500K</span>
              </div>
            </div>

            <div style={{ marginBottom: 26 }}>
              <div style={{ display: "flex", justifyContent: "space-between", marginBottom: 8 }}>
                <label className="mono" style={{ fontSize: 11, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--subtle)" }}>Taxa de falha estimada</label>
                <span className="money" style={{ fontWeight: 600 }}>{leak}%</span>
              </div>
              <input type="range" min="2" max="20" step="0.5" value={leak} onChange={(e) => setLeak(+e.target.value)} style={{ width: "100%", accentColor: "var(--ink)" }}/>
              <div className="mono" style={{ display: "flex", justifyContent: "space-between", fontSize: 10, color: "var(--subtle)", marginTop: 4 }}>
                <span>2%</span><span>20%</span>
              </div>
            </div>

            <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1, background: "var(--line)", borderRadius: 8, overflow: "hidden", border: "1px solid var(--line)" }}>
              <div style={{ background: "var(--loss-soft)", padding: 18 }}>
                <div className="mono" style={{ fontSize: 10, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--loss)", marginBottom: 6, display: "flex", alignItems: "center", gap: 6 }}>
                  <Icon name="trend-down" size={11}/> Vazando hoje
                </div>
                <div style={{ fontSize: 24, fontWeight: 600, color: "var(--loss)" }} className="money"><Money value={monthly}/></div>
                <div className="mono" style={{ fontSize: 11, color: "var(--loss)", opacity: 0.7, marginTop: 2 }}>/ mês · <Money value={yearly}/> /ano</div>
              </div>
              <div style={{ background: "var(--accent-soft)", padding: 18 }}>
                <div className="mono" style={{ fontSize: 10, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--accent)", marginBottom: 6, display: "flex", alignItems: "center", gap: 6 }}>
                  <Icon name="trend-up" size={11}/> Volta com Repaga
                </div>
                <div style={{ fontSize: 24, fontWeight: 600, color: "var(--accent)" }} className="money"><Money value={recovered}/></div>
                <div className="mono" style={{ fontSize: 11, color: "var(--accent)", opacity: 0.8, marginTop: 2 }}>/ mês · <Money value={recoveredYear}/> /ano</div>
              </div>
            </div>

            <a href="#preco" className="btn btn-primary" style={{ width: "100%", marginTop: 18 }}>
              Quero esse dinheiro de volta <Icon name="arrow-right" size={14}/>
            </a>
            <p className="mono" style={{ fontSize: 11, color: "var(--subtle)", textAlign: "center", marginTop: 10, marginBottom: 0 }}>
              Estimativa baseada em mediana do mercado BR. Resultado real varia por gateway e nicho.
            </p>
          </div>
        </div>
      </div>
    </section>
  );
}

function HowItWorks() {
  const steps = [
    { n: "01", t: "Conecta o gateway", d: "Cola a API key do Mercado Pago, Pagar.me, Asaas ou Iugu. 2 minutos. Sem código no seu produto.", icon: "plug" },
    { n: "02", t: "A gente entende a falha", d: "Cada cobrança recusada é classificada: insufficient funds, expired, fraud, boleto vencido, PIX sem saldo. Estratégia muda por motivo.", icon: "zap" },
    { n: "03", t: "Tentamos de novo, no momento certo", d: "Retry automático no horário com maior chance de sucesso pro perfil do cliente. Não 5 vezes seguidas às 3 da manhã.", icon: "clock" },
    { n: "04", t: "WhatsApp, e-mail, SMS", d: "Mensagem em PT-BR de gente, com nome do cliente e link de pagamento direto. Sem 'prezado(a) usuário(a)'.", icon: "msg" },
    { n: "05", t: "Você vê tudo no dashboard", d: "MRR recuperado, taxa de recovery por gateway, próximas tentativas. Exporta CSV se quiser cruzar com seu BI.", icon: "trend-up" },
  ];
  return (
    <section id="como-funciona">
      <div className="container">
        <div style={{ maxWidth: 680, marginBottom: 48 }}>
          <span className="pill"><Icon name="zap" size={12}/> Como funciona</span>
          <h2 style={{ fontSize: "clamp(28px, 3.5vw, 44px)", marginTop: 16 }}>
            5 passos. <span className="display">Nenhum mistério.</span>
          </h2>
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: 0, border: "1px solid var(--line)", borderRadius: 14, overflow: "hidden", background: "var(--line)" }}>
          {steps.map((s, i) => (
            <div key={i} style={{ background: "var(--bg-elev)", padding: 22 }}>
              <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 18 }}>
                <span className="mono" style={{ fontSize: 12, color: "var(--subtle)", letterSpacing: "0.04em" }}>{s.n}</span>
                <span style={{ color: "var(--muted)" }}><Icon name={s.icon} size={16}/></span>
              </div>
              <h3 style={{ fontSize: 16, marginBottom: 8, lineHeight: 1.25 }}>{s.t}</h3>
              <p style={{ color: "var(--muted)", fontSize: 13, lineHeight: 1.55, margin: 0 }}>{s.d}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

function Integrations() {
  const gateways = [
    { name: "Mercado Pago", short: "MP", status: "ready", hue: "#00B1EA" },
    { name: "Pagar.me", short: "PM", status: "ready", hue: "#65A300" },
    { name: "Asaas", short: "AS", status: "ready", hue: "#1E5BFF" },
    { name: "Iugu", short: "IU", status: "ready", hue: "#9013FE" },
    { name: "Stripe BR", short: "ST", status: "soon", hue: "#635BFF" },
    { name: "Vindi", short: "VI", status: "soon", hue: "#E63946" },
  ];
  return (
    <section id="integra" className="integra-section">
      <div className="container integra-grid">
        <div className="integra-copy">
          <span className="pill"><Icon name="plug" size={12}/> Integrações</span>
          <h2 className="integra-title">
            Os gateways que <span className="display">você já usa.</span>
          </h2>
          <p className="integra-lead">
            Sem migração. Sem trocar provedor. Sem refazer integração no seu produto. Você cola a API key, a gente lê os webhooks, e começa a recuperar.
          </p>
        </div>
        <div className="integra-cards">
          {gateways.map((g, i) => (
            <div key={i} className={"integra-card " + (g.status === "soon" ? "is-soon" : "")}>
              <div className="integra-card-left">
                <div className="integra-mark" style={{ background: g.hue + "1a", color: g.hue }}>{g.short}</div>
                <span className="integra-name">{g.name}</span>
              </div>
              <span className={"integra-badge " + (g.status === "ready" ? "is-ready" : "is-soon")}>
                {g.status === "ready" ? "● Ativo" : "○ Em breve"}
              </span>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

function Comparison() {
  const rows = [
    ["Mercado Pago, Pagar.me, Asaas, Iugu", true, false],
    ["WhatsApp Business oficial em PT-BR", true, false],
    ["Mensagens humanas, sem 'prezado(a)'", true, false],
    ["Retry baseado em motivo da falha", true, true],
    ["Dashboard de MRR recuperado", true, true],
    ["Stripe / Braintree", false, true],
    ["Documentação em inglês obrigatória", false, true],
  ];
  return (
    <section className="tight">
      <div className="container-tight">
        <div style={{ marginBottom: 36 }}>
          <span className="pill">vs. soluções gringas</span>
          <h2 style={{ fontSize: "clamp(26px, 3vw, 36px)", marginTop: 14 }}>
            Por que não usar Churnkey ou Stunning?
          </h2>
          <p style={{ color: "var(--muted)", marginTop: 12, fontSize: 15 }}>
            Honestamente: se você roda em Stripe e fatura em USD, use. Eles são bons. Mas pra Brasil, a gente é a única opção que fala com Mercado Pago e WhatsApp Business sem gambiarra.
          </p>
        </div>
        <div className="card" style={{ overflow: "hidden" }}>
          <div style={{ display: "grid", gridTemplateColumns: "1.6fr 1fr 1fr", padding: "14px 20px", borderBottom: "1px solid var(--line)", background: "var(--bg-sunken)" }}>
            <div className="mono" style={{ fontSize: 11, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--subtle)" }}>Recurso</div>
            <div className="mono" style={{ fontSize: 11, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--accent)", fontWeight: 600 }}>Repaga</div>
            <div className="mono" style={{ fontSize: 11, textTransform: "uppercase", letterSpacing: "0.08em", color: "var(--subtle)" }}>Churnkey / Stunning</div>
          </div>
          {rows.map(([label, a, b], i) => (
            <div key={i} style={{ display: "grid", gridTemplateColumns: "1.6fr 1fr 1fr", padding: "14px 20px", borderTop: i === 0 ? "none" : "1px solid var(--line)", alignItems: "center" }}>
              <div style={{ fontSize: 14 }}>{label}</div>
              <div>{a ? <Icon name="check" size={16} style={{ color: "var(--accent)" }}/> : <Icon name="x" size={16} style={{ color: "var(--subtle)", opacity: 0.5 }}/>}</div>
              <div>{b ? <Icon name="check" size={16} style={{ color: "var(--muted)" }}/> : <Icon name="x" size={16} style={{ color: "var(--subtle)", opacity: 0.5 }}/>}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

function Pricing() {
  return (
    <section id="preco" style={{ background: "var(--bg-sunken)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        <div style={{ textAlign: "center", maxWidth: 600, margin: "0 auto 48px" }}>
          <span className="pill">Preço</span>
          <h2 style={{ fontSize: "clamp(28px, 3.5vw, 44px)", marginTop: 16, marginBottom: 12 }}>
            Você escolhe <span className="display">como quer pagar.</span>
          </h2>
          <p style={{ color: "var(--muted)", fontSize: 16 }}>Os dois planos recuperam igual. A diferença é só de risco.</p>
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16, maxWidth: 880, margin: "0 auto" }}>
          {[
            { name: "Fixo", price: "R$ 99", per: "/ mês", desc: "Você paga sempre o mesmo. A gente fica com o upside.", best: "Ideal se você já recupera mais de R$ 700/mês.",
              feat: ["Recuperação ilimitada", "Todos os gateways", "WhatsApp + email + SMS", "Dashboard completo", "Suporte por WhatsApp"] },
            { name: "Performance", price: "15%", per: "do que recuperar", desc: "Sem mensalidade. A gente só ganha se você ganhar.", best: "Ideal se você não tem certeza do tamanho do vazamento.", featured: true,
              feat: ["Sem custo fixo", "Sem fidelidade", "Tudo do plano Fixo", "Relatório auditável de recovery", "Suporte por WhatsApp"] },
          ].map((p, i) => (
            <div key={i} className="card" style={{
              padding: 32, position: "relative",
              borderColor: p.featured ? "var(--ink)" : "var(--line)",
              boxShadow: p.featured ? "var(--shadow-lg)" : "none",
            }}>
              {p.featured && <span className="pill" style={{ position: "absolute", top: -11, left: 28, background: "var(--ink)", color: "var(--bg)", borderColor: "transparent" }}>Recomendado pra começar</span>}
              <h3 style={{ fontSize: 20, marginBottom: 6 }}>{p.name}</h3>
              <div style={{ display: "flex", alignItems: "baseline", gap: 8, marginBottom: 10 }}>
                <span style={{ fontSize: 42, fontWeight: 600, letterSpacing: "-0.03em" }}>{p.price}</span>
                <span style={{ color: "var(--muted)", fontSize: 14 }}>{p.per}</span>
              </div>
              <p style={{ color: "var(--muted)", fontSize: 14, marginBottom: 6 }}>{p.desc}</p>
              <p className="mono" style={{ fontSize: 11, color: "var(--subtle)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: 22 }}>{p.best}</p>
              <a href="#calc" className={`btn ${p.featured ? "btn-primary" : "btn-secondary"}`} style={{ width: "100%", marginBottom: 22 }}>
                Começar com {p.name}
              </a>
              <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "grid", gap: 10 }}>
                {p.feat.map((f, j) => (
                  <li key={j} style={{ display: "flex", gap: 10, fontSize: 14, alignItems: "flex-start" }}>
                    <span style={{ color: "var(--accent)", marginTop: 3 }}><Icon name="check" size={13}/></span>
                    <span style={{ color: "var(--ink-soft)" }}>{f}</span>
                  </li>
                ))}
              </ul>
            </div>
          ))}
        </div>
        <p className="mono" style={{ textAlign: "center", marginTop: 28, fontSize: 12, color: "var(--subtle)" }}>
          Você troca de plano quando quiser. Sem multa, sem fidelidade, sem letra miúda.
        </p>
      </div>
    </section>
  );
}

function Honest() {
  return (
    <section className="tight">
      <div className="container-tight">
        <div className="card" style={{ padding: 32, background: "transparent", borderStyle: "dashed" }}>
          <span className="pill"><Icon name="shield" size={12}/> Bilhete honesto</span>
          <h3 style={{ fontSize: 22, marginTop: 14, marginBottom: 14 }}>Ainda não temos cases pra mostrar.</h3>
          <p style={{ color: "var(--muted)", fontSize: 15, lineHeight: 1.6, marginBottom: 12 }}>
            Repaga está em beta privado. Estamos rodando com 7 empresas selecionadas, ajustando algoritmo de retry e tom das mensagens. Não vamos colocar logo de cliente fake aqui pra parecer bigger than we are.
          </p>
          <p style={{ color: "var(--muted)", fontSize: 15, lineHeight: 1.6, marginBottom: 18 }}>
            Se você fatura entre R$ 10K e R$ 500K de MRR e quer entrar agora, o setup é manual e o atendimento é direto com fundador (eu). Quando tivermos cases reais, eles aparecem aqui — com nome, número e permissão.
          </p>
          <a href="#calc" className="btn btn-secondary">
            Falar com a gente <Icon name="arrow-right" size={14}/>
          </a>
        </div>
      </div>
    </section>
  );
}

function FAQ() {
  const items = [
    ["Quanto tempo leva pra integrar?", "Entre 5 e 15 minutos. Você cria a conta, cola a API key do gateway, e a gente confirma a leitura dos webhooks na hora. Se travar, fundador entra no WhatsApp com você."],
    ["Vocês têm acesso aos meus dados de cliente?", "Só ao mínimo necessário pra cobrar: nome, e-mail, telefone, valor, motivo da falha. Não tocamos em dado de cartão. LGPD: você é controlador, a gente é operador, contrato disponível em PDF."],
    ["O WhatsApp é via Business API oficial?", "Sim. Usamos número verificado da Meta. Sem broadcast em massa por número pessoal. Cada mensagem tem opt-out de uma palavra (\"sair\")."],
    ["E se o cliente reclamar da cobrança?", "A gente para de tentar imediatamente quando recebe \"sair\", \"não quero\" ou variações. Você vê todas as conversas no dashboard."],
    ["Vocês integram com Stripe?", "Stripe Brasil entra no roadmap pro próximo trimestre. Hoje atendemos Mercado Pago, Pagar.me, Asaas e Iugu — que cobrem ~85% do mercado SaaS BR."],
    ["Posso cancelar quando?", "Quando quiser, no dashboard, em um clique. Sem multa, sem fidelidade. Os dados de recovery ficam disponíveis pra export por 90 dias depois do cancelamento."],
  ];
  const [open, setOpen] = React.useState(0);
  return (
    <section id="faq">
      <div className="container" style={{ display: "grid", gridTemplateColumns: "1fr 1.4fr", gap: 56 }}>
        <div>
          <span className="pill">FAQ</span>
          <h2 style={{ fontSize: "clamp(28px, 3.5vw, 40px)", marginTop: 16 }}>Perguntas que o pessoal faz <span className="display">de verdade.</span></h2>
        </div>
        <div>
          {items.map(([q, a], i) => (
            <div key={i} style={{ borderTop: i === 0 ? "1px solid var(--line-strong)" : "1px solid var(--line)", borderBottom: i === items.length - 1 ? "1px solid var(--line-strong)" : "none" }}>
              <button onClick={() => setOpen(open === i ? -1 : i)} style={{ width: "100%", padding: "20px 0", display: "flex", justifyContent: "space-between", alignItems: "center", textAlign: "left", fontSize: 16, fontWeight: 500 }}>
                {q}
                <span style={{ color: "var(--subtle)", transform: open === i ? "rotate(180deg)" : "none", transition: "transform 200ms" }}><Icon name="chevron-down" size={16}/></span>
              </button>
              {open === i && <div style={{ paddingBottom: 22, fontSize: 15, lineHeight: 1.65, color: "var(--muted)", maxWidth: 580 }}>{a}</div>}
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

function Footer() {
  return (
    <footer style={{ borderTop: "1px solid var(--line)", padding: "40px 0", background: "var(--bg)" }}>
      <div className="container" style={{ display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16, flexWrap: "wrap" }}>
        <div className="brand">
          <span className="brand-mark">R</span>
          <span>Repaga</span>
        </div>
        <div className="mono" style={{ fontSize: 12, color: "var(--subtle)" }}>
          © 2026 Repaga · CNPJ em formação · Feito em São Paulo
        </div>
      </div>
    </footer>
  );
}

window.RP = { Nav, Hero, Calc, HowItWorks, Integrations, Comparison, Pricing, Honest, FAQ, Footer };
