// EngagementPage — Smart Engagement product detail page.
// Composes: Nav → Hero → Problem → 5 Tools (with mini visuals) → Pipeline → CaseStudy → FAQ → FooterCTA → Footer

const { useState: useES, useEffect: useEE } = React;

// ---------------------------------------------------------------------------
// HERO
// ---------------------------------------------------------------------------
function EngagementHero({ t }) {
  return (
    <section data-screen-label="ses-hero" style={{
      position: "relative",
      background: "var(--bg-ink)",
      color: "var(--fg-cream)",
      overflow: "hidden",
      padding: "84px 0 0",
      borderBottom: "1px solid var(--border-dark)"
    }}>
      <div className="container" style={{
        display: "grid",
        gridTemplateColumns: "minmax(0, 1.05fr) minmax(0, 0.95fr)",
        gap: 64,
        alignItems: "center",
        paddingBottom: 80
      }} id="ses-hero-grid">

        {/* LEFT */}
        <div>
          <div className="eyebrow" style={{ color: "var(--accent-teal)" }}>
            {t.hero.eyebrow}
          </div>
          <h1 className="display-tight" style={{
            fontSize: "clamp(48px, 6vw, 88px)",
            margin: "20px 0 22px", maxWidth: "13ch",
            color: "var(--fg-cream)"
          }}>
            {t.hero.h1Pre} <span style={{ color: "var(--accent-teal)" }}>{t.hero.h1Accent}</span>
          </h1>
          <p style={{ fontSize: 19, lineHeight: 1.5, color: "var(--muted-cream)", maxWidth: "56ch", margin: 0 }}>
            {t.hero.sub}
          </p>
          <div style={{ marginTop: 30 }}>
            <a href="#book" className="btn" style={{
              fontSize: 15, padding: "13px 22px",
              background: "var(--accent-teal)", color: "var(--fg-ink)", fontWeight: 600
            }}>
              {t.hero.cta} <Icon.Arrow size={14} />
            </a>
          </div>

          {/* stats row */}
          <div style={{
            display: "grid", gridTemplateColumns: "repeat(3, 1fr)",
            gap: 14, marginTop: 38, paddingTop: 26,
            borderTop: "1px solid var(--border-dark)"
          }} id="ses-hero-stats">
            {t.hero.stats.map((s, i) => (
              <div key={i}>
                <div className="display" style={{
                  fontSize: 32, fontWeight: 700, letterSpacing: "-0.03em",
                  color: "var(--accent-teal)"
                }}>{s.value}</div>
                <div className="mono" style={{
                  fontSize: 10.5, letterSpacing: "0.14em",
                  color: "var(--muted-cream)", textTransform: "uppercase",
                  marginTop: 4
                }}>{s.label}</div>
              </div>
            ))}
          </div>
        </div>

        {/* RIGHT — WhatsApp conversation visual */}
        <EngagementHeroVisual />
      </div>

      <style>{`
        @media (max-width: 960px) {
          #ses-hero-grid { grid-template-columns: 1fr !important; gap: 56px !important; }
        }
        @media (max-width: 540px) {
          #ses-hero-stats { grid-template-columns: 1fr !important; }
        }
      `}</style>
    </section>
  );
}

function EngagementHeroVisual() {
  return (
    <div style={{ position: "relative", width: "100%", maxWidth: 520, marginLeft: "auto" }}>
      <div aria-hidden="true" style={{
        position: "absolute", inset: "-22px", borderRadius: 36,
        background: "rgba(155, 201, 210, 0.40)",
        filter: "blur(28px)", pointerEvents: "none", zIndex: 0
      }} />
      <div style={{
        position: "relative", zIndex: 1,
        background: "rgba(255, 255, 255, 0.96)",
        backdropFilter: "blur(24px) saturate(140%)",
        WebkitBackdropFilter: "blur(24px) saturate(140%)",
        border: "1px solid rgba(231, 228, 216, 0.55)",
        borderRadius: 24,
        boxShadow:
          "0 30px 60px -30px rgba(0,0,0,0.55), " +
          "0 0 40px rgba(155, 201, 210, 0.28), " +
          "inset 0 1px 0 rgba(255,255,255,0.6)",
        padding: "22px 22px",
        color: "var(--fg-ink)"
      }}>
        {/* header */}
        <div style={{ display: "flex", alignItems: "center", gap: 11, paddingBottom: 16, borderBottom: "1px solid var(--border-light)" }}>
          <div style={{
            width: 28, height: 28, borderRadius: 8,
            display: "grid", placeItems: "center"
          }}>
            <Icon.WhatsApp size={22} />
          </div>
          <div style={{ flex: 1, minWidth: 0 }}>
            <div className="mono" style={{ fontSize: 10, letterSpacing: "0.14em", color: "var(--muted-ink)", textTransform: "uppercase" }}>
              PATIENT ENGAGEMENT · CENTRAL PRACTICE
            </div>
            <div style={{ fontSize: 13, fontWeight: 600, marginTop: 2 }}>4 active conversations</div>
          </div>
          <span style={{ display: "inline-flex", alignItems: "center", gap: 6 }}>
            <span style={{ width: 6, height: 6, borderRadius: 999, background: "var(--cat-green)" }} />
            <span className="mono" style={{ fontSize: 9.5, letterSpacing: "0.18em", color: "var(--cat-green)", fontWeight: 600 }}>LIVE</span>
          </span>
        </div>

        {/* conversation column */}
        <div style={{ marginTop: 16, display: "flex", flexDirection: "column", gap: 12 }}>
          <Bubble incoming
            kicker="REMINDERS · T-24h" kickerColor="#14B8A6"
            text="Hi Sara, you have a hygiene appointment tomorrow at 10:00. Confirm with one tap?"
          />
          <BubbleOut text="✓ Confirmed" time="12s later" />

          <Bubble incoming
            kicker="RECOVERY · WAITLIST MATCH" kickerColor="#EF4444"
            text="Hi Paola, a slot just opened tomorrow at 10:00 with Dr. Bianchi. Want it?"
          />
          <BubbleOut text="Yes please ✓" time="4 min later" />

          <Bubble incoming
            kicker="REVIEWS · T+24h" kickerColor="#F59E0B"
            text="Thanks for coming in, Sara. Would you rate us on Google? ★★★★★"
          />
        </div>

        {/* result strip */}
        <div style={{
          marginTop: 16, padding: "12px 14px",
          background: "rgba(155, 201, 210, 0.14)",
          border: "1px solid rgba(91, 158, 173, 0.30)",
          borderRadius: 12,
          display: "flex", alignItems: "center", justifyContent: "space-between"
        }}>
          <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
            <div style={{
              width: 24, height: 24, borderRadius: 7,
              background: "#5B9EAD", color: "white",
              display: "grid", placeItems: "center"
            }}>
              <Icon.Check size={13} />
            </div>
            <span className="display" style={{ fontSize: 14, color: "#3F7783" }}>Today's recovered revenue</span>
          </div>
          <div className="display" style={{ fontSize: 18, color: "#3F7783", fontWeight: 700 }}>+€540</div>
        </div>
      </div>
    </div>
  );
}

function Bubble({ kicker, kickerColor, text, incoming }) {
  return (
    <div style={{ alignSelf: incoming ? "flex-start" : "flex-end", maxWidth: "92%" }}>
      {kicker && (
        <div className="mono" style={{
          fontSize: 9, letterSpacing: "0.18em", color: kickerColor, fontWeight: 700,
          marginBottom: 4, paddingLeft: 4,
          display: "inline-flex", alignItems: "center", gap: 6
        }}>
          <span style={{ width: 4, height: 4, borderRadius: 999, background: kickerColor }} />
          {kicker}
        </div>
      )}
      <div style={{
        background: "var(--bg-cream)",
        border: "1px solid var(--border-light)",
        padding: "9px 12px 10px",
        borderRadius: "14px 14px 14px 4px",
        fontSize: 13, lineHeight: 1.4, color: "var(--fg-ink)"
      }}>
        {text}
      </div>
    </div>
  );
}

function BubbleOut({ text, time }) {
  return (
    <div style={{ alignSelf: "flex-end", maxWidth: "55%" }}>
      <div style={{
        background: "#0B0F14", color: "#F5F3EB",
        padding: "8px 12px 9px",
        borderRadius: "14px 14px 4px 14px",
        fontSize: 13, fontWeight: 500
      }}>
        {text}
      </div>
      {time && (
        <div className="mono" style={{ fontSize: 9.5, color: "var(--muted-ink)", marginTop: 3, paddingRight: 4, textAlign: "right" }}>
          {time}
        </div>
      )}
    </div>
  );
}

// ---------------------------------------------------------------------------
// PROBLEM
// ---------------------------------------------------------------------------
function EngagementProblem({ t }) {
  const p = t.problem;
  return (
    <section data-screen-label="ses-problem" style={{
      background: "var(--bg-cream)", padding: "120px 0 100px"
    }}>
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "minmax(0, 1.05fr) minmax(0, 0.95fr)", gap: 56, alignItems: "start" }} id="sp-grid">
          <div>
            <div className="eyebrow" style={{ color: "var(--muted-ink)" }}>{p.eyebrow}</div>
            <h2 className="display-tight" style={{ fontSize: "clamp(40px, 5vw, 62px)", margin: "18px 0 20px" }}>
              {p.h2Pre} <span style={{ color: "#5B9EAD" }}>{p.h2Accent}</span>
            </h2>
            <p style={{ fontSize: 17.5, lineHeight: 1.55, color: "var(--muted-ink)", margin: 0, maxWidth: "54ch" }}>
              {p.body}
            </p>
          </div>
          <div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
            {p.stats.map((s, i) => (
              <div key={i} style={{
                background: "var(--bg-white)", border: "1px solid var(--border-light)",
                borderRadius: 16, padding: "20px 22px",
                display: "flex", alignItems: "baseline", gap: 18
              }}>
                <div className="display" style={{
                  fontSize: 38, fontWeight: 700, letterSpacing: "-0.035em",
                  color: "var(--soft-rose-fg)", flex: "none", minWidth: 90
                }}>{s.value}</div>
                <div style={{ fontSize: 14, color: "var(--muted-ink)", lineHeight: 1.45 }}>
                  {s.label}
                </div>
              </div>
            ))}
          </div>
        </div>
      </div>
      <style>{`@media (max-width: 960px) { #sp-grid { grid-template-columns: 1fr !important; } }`}</style>
    </section>
  );
}

// ---------------------------------------------------------------------------
// TOOLS — 5 deep panels
// ---------------------------------------------------------------------------
function EngagementTools({ t }) {
  const tt = t.tools;
  return (
    <section data-screen-label="ses-tools" style={{
      background: "var(--bg-ink)", color: "var(--fg-cream)",
      padding: "120px 0 120px"
    }}>
      <div className="container">
        <div style={{ maxWidth: 760, marginBottom: 56 }}>
          <div className="eyebrow" style={{ color: "var(--muted-cream)" }}>{tt.eyebrow}</div>
          <h2 className="display-tight" style={{ fontSize: "clamp(40px, 5vw, 62px)", margin: "18px 0 18px", color: "var(--fg-cream)" }}>
            {tt.h2Pre} <span style={{ color: "var(--accent-teal)" }}>{tt.h2Accent}</span>
          </h2>
          <p style={{ fontSize: 17.5, color: "var(--muted-cream)", lineHeight: 1.5, margin: 0, maxWidth: "60ch" }}>
            {tt.sub}
          </p>
        </div>

        <div style={{ display: "flex", flexDirection: "column", gap: 22 }}>
          {tt.items.map((it, i) => (
            <ToolPanel key={it.id} tool={it} index={i} />
          ))}
        </div>
      </div>
    </section>
  );
}

function ToolPanel({ tool, index }) {
  const reverse = index % 2 === 1;
  return (
    <div id={tool.id} style={{
      position: "relative",
      background: "rgba(255,255,255,0.03)",
      border: "1px solid var(--border-dark)",
      borderRadius: 22,
      padding: "32px 32px 32px",
      overflow: "hidden",
      display: "grid",
      gridTemplateColumns: reverse ? "minmax(0, 0.95fr) minmax(0, 1.05fr)" : "minmax(0, 1.05fr) minmax(0, 0.95fr)",
      gap: 36,
      alignItems: "center"
    }} className="tool-panel">
      {/* color glow */}
      <div style={{
        position: "absolute", inset: 0, pointerEvents: "none",
        background: `radial-gradient(40% 40% at ${reverse ? "8%" : "92%"} 10%, ${tool.color}22, transparent 70%)`
      }} />

      {/* COPY */}
      <div style={{ position: "relative", order: reverse ? 2 : 1 }}>
        <div className="mono" style={{
          fontSize: 11, letterSpacing: "0.18em", color: tool.color, fontWeight: 700
        }}>
          {tool.kicker}
        </div>
        <div className="display" style={{
          fontSize: "clamp(26px, 2.8vw, 34px)", fontWeight: 600,
          letterSpacing: "-0.022em", lineHeight: 1.15,
          margin: "16px 0 14px", maxWidth: "26ch", color: "var(--fg-cream)"
        }}>
          {tool.title}
        </div>
        <p style={{
          fontSize: 15.5, color: "var(--muted-cream)", lineHeight: 1.55,
          margin: 0, maxWidth: "48ch"
        }}>
          {tool.body}
        </p>
        <ul style={{
          listStyle: "none", padding: 0, margin: "22px 0 0",
          display: "flex", flexDirection: "column", gap: 10
        }}>
          {tool.features.map((f, i) => (
            <li key={i} style={{ display: "flex", gap: 12, alignItems: "flex-start", fontSize: 14, color: "var(--fg-cream)" }}>
              <span style={{
                flex: "none", marginTop: 2,
                width: 18, height: 18, borderRadius: 999,
                display: "grid", placeItems: "center",
                background: `${tool.color}25`, color: tool.color
              }}>
                <Icon.Check size={10} />
              </span>
              {f}
            </li>
          ))}
        </ul>
      </div>

      {/* VISUAL */}
      <div style={{ position: "relative", order: reverse ? 1 : 2 }}>
        <ToolVisual id={tool.id} color={tool.color} />
      </div>

      <style>{`
        @media (max-width: 880px) {
          .tool-panel { grid-template-columns: 1fr !important; }
          .tool-panel > * { order: 0 !important; }
        }
      `}</style>
    </div>
  );
}

// per-tool mini visual
function ToolVisual({ id, color }) {
  if (id === "reminders")  return <RemindersVisual color={color} />;
  if (id === "reviews")    return <ReviewsVisual color={color} />;
  if (id === "recovery")   return <RecoveryVisual color={color} />;
  if (id === "waitlist")   return <WaitlistVisual color={color} />;
  if (id === "recall")     return <RecallVisual color={color} />;
  return null;
}

function VisualShell({ children, height = 280 }) {
  return (
    <div style={{
      position: "relative",
      background: "rgba(255, 255, 255, 0.04)",
      border: "1px solid var(--border-dark)",
      borderRadius: 16,
      padding: "20px 20px",
      minHeight: height,
      display: "flex", flexDirection: "column", justifyContent: "center"
    }}>
      {children}
    </div>
  );
}

function RemindersVisual({ color }) {
  return (
    <VisualShell>
      <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--muted-cream)", marginBottom: 14 }}>
        REMINDER TIMELINE · SARA C.
      </div>
      {[
        { t: "T-24h", channel: "WhatsApp", status: "delivered" },
        { t: "T-12h", channel: "—",        status: "skipped (confirmed)" },
        { t: "T-2h",  channel: "WhatsApp", status: "delivered" }
      ].map((step, i) => (
        <div key={i} style={{ display: "flex", alignItems: "center", gap: 14, padding: "10px 0", borderTop: i === 0 ? "none" : "1px solid var(--border-dark)" }}>
          <span className="mono" style={{ fontSize: 11, color, fontWeight: 600, width: 50 }}>{step.t}</span>
          <span style={{ fontSize: 13, color: "var(--fg-cream)", flex: 1 }}>{step.channel}</span>
          <span className="mono" style={{ fontSize: 11, color: "var(--muted-cream)" }}>{step.status}</span>
        </div>
      ))}
      <div style={{
        marginTop: 12, padding: "10px 12px",
        background: `${color}1f`, border: `1px solid ${color}55`,
        borderRadius: 10,
        display: "flex", alignItems: "center", gap: 8,
        fontSize: 12.5, color
      }}>
        <Icon.Check size={12} /> Confirmed at T-24h + 12s
      </div>
    </VisualShell>
  );
}

function ReviewsVisual({ color }) {
  return (
    <VisualShell>
      <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--muted-cream)", marginBottom: 14 }}>
        GOOGLE REVIEWS · LAST 30 DAYS
      </div>
      <div style={{ display: "flex", alignItems: "baseline", gap: 12, marginBottom: 14 }}>
        <span className="display" style={{ fontSize: 44, color: color, fontWeight: 700, letterSpacing: "-0.04em" }}>4.9</span>
        <span style={{ color }}>★★★★★</span>
        <span style={{ fontSize: 12, color: "var(--muted-cream)", marginLeft: "auto" }}>+31 new</span>
      </div>
      {/* mini distribution bars */}
      {[5, 4, 3, 2, 1].map((s, i) => {
        const pct = [82, 12, 4, 1, 1][i];
        return (
          <div key={s} style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 6 }}>
            <span className="mono" style={{ fontSize: 11, color: "var(--muted-cream)", width: 14 }}>{s}★</span>
            <div style={{ flex: 1, height: 6, background: "rgba(255,255,255,0.06)", borderRadius: 999, overflow: "hidden" }}>
              <div style={{ width: `${pct}%`, height: "100%", background: s === 5 ? color : "rgba(255,255,255,0.18)" }} />
            </div>
            <span className="mono" style={{ fontSize: 10.5, color: "var(--muted-cream)", width: 26, textAlign: "right" }}>{pct}%</span>
          </div>
        );
      })}
    </VisualShell>
  );
}

function RecoveryVisual({ color }) {
  return (
    <VisualShell>
      <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--muted-cream)", marginBottom: 12 }}>
        CANCELLATION → RECOVERY · LIVE
      </div>
      <div style={{
        padding: "10px 12px", borderRadius: 10,
        background: "rgba(220, 38, 38, 0.10)",
        border: "1px solid rgba(220, 38, 38, 0.25)",
        marginBottom: 10
      }}>
        <div style={{ display: "flex", alignItems: "baseline", gap: 8 }}>
          <span className="mono" style={{ fontSize: 10, letterSpacing: "0.14em", color: "#FCA5A5", fontWeight: 600 }}>CANCELLED</span>
          <span style={{ fontSize: 12.5, color: "var(--fg-cream)", textDecoration: "line-through", opacity: 0.7 }}>10:00 · Marco R. · Checkup</span>
        </div>
        <div style={{ fontSize: 11.5, color: "var(--muted-cream)", marginTop: 4 }}>−€120 in jeopardy</div>
      </div>

      <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--muted-cream)", marginBottom: 8, marginTop: 4 }}>
        ↓ 12 PRIORITY PATIENTS MATCHED IN 8s
      </div>

      <div style={{
        padding: "10px 12px", borderRadius: 10,
        background: `${color}1c`,
        border: `1px solid ${color}55`,
        display: "flex", alignItems: "center", gap: 10
      }}>
        <Icon.Check size={13} style={{ color }} />
        <div style={{ flex: 1 }}>
          <div style={{ fontSize: 13, color: "var(--fg-cream)", fontWeight: 500 }}>10:00 · Paola N. · Checkup</div>
          <div className="mono" style={{ fontSize: 10.5, color, marginTop: 2 }}>RECOVERED · 4 min 12s · +€120</div>
        </div>
      </div>
    </VisualShell>
  );
}

function WaitlistVisual({ color }) {
  const rows = [
    { name: "Paola N.",     since: "3d",  service: "Checkup", match: 96 },
    { name: "Giulia M.",    since: "2d",  service: "Hygiene", match: 88 },
    { name: "Andrea L.",    since: "5d",  service: "Checkup", match: 82 },
    { name: "Sofia R.",     since: "1d",  service: "Hygiene", match: 74 }
  ];
  return (
    <VisualShell>
      <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", marginBottom: 12 }}>
        <span className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--muted-cream)" }}>
          ACTIVE WAITLIST · 47 PATIENTS
        </span>
        <span className="mono" style={{ fontSize: 10, color }}>RANKED BY MATCH</span>
      </div>
      <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
        {rows.map((r, i) => (
          <div key={i} style={{
            display: "grid",
            gridTemplateColumns: "1fr auto 50px",
            gap: 12, alignItems: "center",
            padding: "8px 12px",
            background: i === 0 ? `${color}18` : "rgba(255,255,255,0.025)",
            border: i === 0 ? `1px solid ${color}55` : "1px solid var(--border-dark)",
            borderRadius: 10
          }}>
            <div>
              <div style={{ fontSize: 13, color: "var(--fg-cream)" }}>{r.name}</div>
              <div className="mono" style={{ fontSize: 10.5, color: "var(--muted-cream)" }}>{r.service} · waiting {r.since}</div>
            </div>
            <div style={{ width: 60, height: 6, background: "rgba(255,255,255,0.06)", borderRadius: 999, overflow: "hidden" }}>
              <div style={{ width: `${r.match}%`, height: "100%", background: color }} />
            </div>
            <div className="mono" style={{ fontSize: 11, color, textAlign: "right", fontWeight: 600 }}>{r.match}%</div>
          </div>
        ))}
      </div>
    </VisualShell>
  );
}

function RecallVisual({ color }) {
  return (
    <VisualShell>
      <div className="mono" style={{ fontSize: 10, letterSpacing: "0.16em", color: "var(--muted-cream)", marginBottom: 14 }}>
        DORMANT PATIENT SCAN · THIS WEEK
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 10, marginBottom: 14 }}>
        <Mini value="142" label="dormant"  color="var(--muted-cream)" />
        <Mini value="38"  label="reached"  color="var(--fg-cream)" />
        <Mini value="9"   label="re-booked" color={color} />
      </div>

      <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
        {[
          { name: "Elisa F.", last: "6 mo ago", service: "Checkup", status: "Re-booked" },
          { name: "Marco T.", last: "4 mo ago", service: "Hygiene", status: "Reached" }
        ].map((r, i) => (
          <div key={i} style={{
            display: "flex", alignItems: "center", gap: 10,
            padding: "10px 12px",
            background: "rgba(255,255,255,0.025)",
            border: "1px solid var(--border-dark)",
            borderRadius: 10
          }}>
            <span style={{ width: 28, height: 28, borderRadius: 999, background: `${color}25`, color, display: "grid", placeItems: "center", fontFamily: "var(--font-display)", fontWeight: 700, fontSize: 11 }}>
              {r.name.split(" ").map(n => n[0]).join("")}
            </span>
            <div style={{ flex: 1, minWidth: 0 }}>
              <div style={{ fontSize: 13, color: "var(--fg-cream)" }}>{r.name} · {r.service}</div>
              <div className="mono" style={{ fontSize: 10.5, color: "var(--muted-cream)" }}>last visit {r.last}</div>
            </div>
            <span className="mono" style={{ fontSize: 10, color: r.status === "Re-booked" ? color : "var(--muted-cream)", fontWeight: 600, letterSpacing: "0.12em" }}>
              {r.status.toUpperCase()}
            </span>
          </div>
        ))}
      </div>
    </VisualShell>
  );
}

function Mini({ value, label, color }) {
  return (
    <div style={{
      background: "rgba(255,255,255,0.025)",
      border: "1px solid var(--border-dark)",
      borderRadius: 10,
      padding: "10px 12px"
    }}>
      <div className="display" style={{ fontSize: 22, fontWeight: 700, letterSpacing: "-0.025em", color }}>{value}</div>
      <div className="mono" style={{ fontSize: 9.5, letterSpacing: "0.16em", color: "var(--muted-cream)", marginTop: 2 }}>
        {label.toUpperCase()}
      </div>
    </div>
  );
}

// ---------------------------------------------------------------------------
// PAGE ROOT
// ---------------------------------------------------------------------------
function EngagementPage() {
  const lang = (typeof window !== "undefined" && window.__sonaroLang) || "en";
  const dict = (window.CONTENT && window.CONTENT[lang]) || window.CONTENT.en;
  const t = dict.engagementPage;
  return (
    <div id="top">
      <Nav t={dict} lang={lang} setLang={() => {}} />
      <EngagementHero    t={t} />
      <IntegrationsStrip t={dict} />
      <EngagementProblem t={t} />
      <EngagementTools   t={t} />
      <ProductCaseStudy  data={t.caseStudy} variant="ses" theme="light" />
      <ProductFAQ        data={t.faq} />
      <FooterCTA         t={dict} />
      <Footer            t={dict} />
    </div>
  );
}

Object.assign(window, { EngagementPage });
