// All remaining sections + footer.
const { motion: mS, AnimatePresence: APS } = window;

// ---------- How it works (pet owner side — 4-step preview) ----------
const HowItWorks = () => {
  const cards = [
    {
      step: "01",
      title: "Create your pet profile",
      copy: "Save Luna's size, age, vaccines, and care needs once. Hosts see the important details before they reply.",
      tone: "mint",
      preview: <PreviewPet />,
    },
    {
      step: "02",
      title: "Search by real care needs",
      copy: "Look for medication support, fenced gardens, accepted sizes, daily updates, and other details that matter for your pet.",
      tone: "cream",
      preview: <PreviewSearch />,
    },
    {
      step: "03",
      title: "Compare trusted providers",
      copy: "Review profiles with photos, ratings, response times, care policies, and verification signals in one calm view.",
      tone: "butter",
      preview: <PreviewCompare />,
    },
    {
      step: "04",
      title: "Request a quote · message the host",
      copy: "Send one clear request, ask questions, and agree the details directly with the sitter or hotel before you confirm.",
      tone: "coral",
      preview: <PreviewQuote />,
    },
  ];
  return (
    <Section
      id="how"
      eyebrow="For pet owners"
      title="From profile to peace of mind — in four steps."
      kicker="Save your pet's needs once, then use them to find care that feels right. Every request gives the host the details they need to answer with confidence."
      className="py-16 sm:py-24"
    >
      <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
        {cards.map((c, i) => (
          <Reveal key={c.step} delay={i * 80}>
            <div className="h-full bg-white border border-line rounded-3xl p-5 hover:shadow-lift transition-shadow flex flex-col">
              <div className="flex items-center justify-between mb-4">
                <span className="font-mono text-[11px] tracking-tight text-inkSoft">{c.step}</span>
                <ToneDot tone={c.tone} />
              </div>
              <div className="rounded-2xl border border-line bg-cream overflow-hidden h-[160px]">
                {c.preview}
              </div>
              <div className="mt-4 font-display text-[20px] text-forestDeep leading-tight">
                {c.title}
              </div>
              <div className="mt-1.5 text-[13.5px] text-inkSoft text-pretty">{c.copy}</div>
            </div>
          </Reveal>
        ))}
      </div>
    </Section>
  );
};

const ToneDot = ({ tone }) => {
  const map = { mint: "#5EEAD4", cream: "#E2E8F0", butter: "#FEF3C7", coral: "#FED7AA" };
  return <span className="w-3 h-3 rounded-full" style={{ background: map[tone] }} />;
};

const PreviewPet = () => (
  <div className="h-full p-3 bg-mint/40 flex flex-col gap-1.5 justify-center">
    {["Name · Luna", "Species · Dog", "Size · Medium", "Special needs · Oral medication"].map(
      (t, i) => (
        <mS.div
          key={t}
          initial={{ opacity: 0, x: -10 }}
          whileInView={{ opacity: 1, x: 0 }}
          viewport={{ once: true }}
          transition={{ delay: i * 0.12 }}
          className="text-[12px] bg-white border border-line rounded-full px-3 py-1 text-forestDeep w-fit"
        >
          {t}
        </mS.div>
      )
    )}
  </div>
);

const PreviewSearch = () => (
  <div className="h-full p-3 flex flex-col gap-1.5 justify-center">
    {[
      { i: <IconShield size={11} />, t: "Verified", a: true },
      { i: <IconMed size={11} />, t: "Oral medication", a: true },
      { i: <IconFence size={11} />, t: "Fenced yard" },
      { i: <IconBolt size={11} />, t: "Instant quote" },
    ].map((c) => (
      <span
        key={c.t}
        className={`text-[11.5px] inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full border w-fit ${
          c.a ? "bg-forest text-cream border-forest" : "bg-white text-ink border-line"
        }`}
      >
        {c.i} {c.t}
      </span>
    ))}
  </div>
);

const PreviewCompare = () => (
  <div className="h-full p-3 grid grid-cols-2 gap-2">
    {[
      { n: "Green Paws", r: 4.9, p: "€32" },
      { n: "Cozy Tails", r: 4.8, p: "€24" },
    ].map((l, i) => (
      <div key={l.n} className={`rounded-xl p-2 border ${i === 0 ? "bg-white border-forest/30" : "bg-white border-line"}`}>
        <Photo ratio="4/3" rounded="rounded-lg" tone={i ? "mint" : "forest"} className="mb-1.5" cat="host" idx={i + 1} w={220} alt={l.n} />
        <div className="text-[11px] font-semibold text-forestDeep truncate">{l.n}</div>
        <div className="flex items-center justify-between text-[10.5px] text-inkSoft">
          <span className="flex items-center gap-1"><IconStar size={10} className="text-coral" />{l.r}</span>
          <span className="font-semibold text-forestDeep">{l.p}</span>
        </div>
      </div>
    ))}
  </div>
);

const PreviewQuote = () => (
  <div className="h-full p-3 flex flex-col gap-2 justify-center">
    {[
      { side: "me", t: "Luna takes oral meds 2× / day. OK?" },
      { side: "them", t: "Yes — pet first-aid certified ✓" },
    ].map((b, i) => (
      <mS.div
        key={i}
        initial={{ opacity: 0, y: 6 }}
        whileInView={{ opacity: 1, y: 0 }}
        viewport={{ once: true }}
        transition={{ delay: i * 0.18 }}
        className={`text-[11.5px] max-w-[85%] px-3 py-1.5 rounded-2xl ${
          b.side === "me"
            ? "bg-forest text-cream self-end rounded-br-sm"
            : "bg-white border border-line text-ink rounded-bl-sm"
        }`}
      >
        {b.t}
      </mS.div>
    ))}
  </div>
);

// ---------- Inline icons for new platform features ----------
const IconWallet = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
    <path d="M3 7h15a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1z" />
    <path d="M3 7V5a2 2 0 0 1 2-2h11" />
    <circle cx="16" cy="13" r="1.4" />
  </svg>
);
const IconGrid = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
    <rect x="3" y="3" width="7" height="7" rx="1.2" />
    <rect x="14" y="3" width="7" height="7" rx="1.2" />
    <rect x="3" y="14" width="7" height="7" rx="1.2" />
    <rect x="14" y="14" width="7" height="7" rx="1.2" />
  </svg>
);
const IconChart = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
    <path d="M4 20V10" />
    <path d="M10 20V4" />
    <path d="M16 20v-7" />
    <path d="M22 20H2" />
  </svg>
);
const IconStethoscope = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
    <path d="M6 3v6a4 4 0 0 0 8 0V3" />
    <path d="M10 13v3a4 4 0 0 0 8 0v-2" />
    <circle cx="18" cy="14" r="2" />
  </svg>
);
const IconPhone = ({ size = 16 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
    <rect x="7" y="2" width="10" height="20" rx="2.5" />
    <line x1="11" y1="18.5" x2="13" y2="18.5" />
  </svg>
);

// ---------- Platform feature grid ----------
const FeatureGrid = () => {
  const features = [
    {
      icon: <IconCal size={20} />,
      tone: "mint",
      title: "Smart Booking Management",
      copy: "Manage the full booking journey, from first enquiry to check-out, with clear statuses and a shared history for every client.",
    },
    {
      icon: <IconPaw size={20} />,
      tone: "butter",
      title: "Customer & Pet Profiles",
      copy: "Keep contact details, breed, weight, vaccinations, behaviour notes, microchip numbers, and special needs in one trusted record.",
    },
    {
      icon: <IconCamera size={20} />,
      tone: "coral",
      title: "Check-In & Check-Out with Photos",
      copy: "Document arrival and departure with photos, belongings, and behaviour notes, so owners feel informed and your team has a clear record.",
    },
    {
      icon: <IconWallet size={20} />,
      tone: "mint",
      title: "Quotations & Payment Tracking",
      copy: "Create clear quotes and record off-platform payments, outstanding balances, and refunds without losing track.",
    },
    {
      icon: <IconGrid size={20} />,
      tone: "butter",
      title: "Capacity Calendar",
      copy: "See availability, daily limits, rooms, services, and busy days at a glance, so you can avoid overbooking.",
    },
    {
      icon: <IconChart size={20} />,
      tone: "coral",
      title: "Dashboard & KPIs",
      copy: "Start each day with arrivals, departures, occupancy, open quotes, and the tasks your team should not miss.",
    },
    {
      icon: <IconStethoscope size={20} />,
      tone: "mint",
      title: "Veterinary Records",
      copy: "Keep vet contacts and health notes close, especially for pets with medication or special care needs.",
    },
    {
      icon: <IconPhone size={20} />,
      tone: "butter",
      title: "iOS App for Your Team",
      copy: "Give staff a mobile view for check-ins, bookings, pet records, and updates while they are moving around the property.",
    },
  ];
  const toneBg = { mint: "bg-mint text-forest", butter: "bg-butter text-[#6a4f00]", coral: "bg-coralSoft text-coral" };
  return (
    <Section
      id="features"
      eyebrow="For sitters &amp; pet hotels"
      title="Everything pet sitters and hotels need to build trust."
      kicker="Show a professional profile, receive clearer requests, keep every pet record close, and manage the daily work in one calm place."
      className="py-16 sm:py-24"
    >
      <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
        {features.map((f, i) => (
          <Reveal key={f.title} delay={i * 50}>
            <div className="h-full bg-white border border-line rounded-2xl p-5 hover:shadow-soft hover:-translate-y-0.5 transition-all">
              <span className={`inline-flex w-11 h-11 rounded-xl items-center justify-center mb-4 ${toneBg[f.tone]}`}>
                {f.icon}
              </span>
              <div className="font-display text-[19px] text-forestDeep leading-tight">{f.title}</div>
              <div className="mt-2 text-[13.5px] text-inkSoft text-pretty leading-relaxed">{f.copy}</div>
            </div>
          </Reveal>
        ))}
      </div>
    </Section>
  );
};

// ---------- Operations Control ----------
const OperationsControl = () => {
  const points = [
    {
      title: "Every pet has a clear record",
      copy: "Weight, breed, medication, vaccines, microchip, vet, and notes.",
      icon: <IconPaw size={20} />,
      tone: "mint",
    },
    {
      title: "Check-in and check-out are documented",
      copy: "Photos, belongings, and notes reduce doubts on departure.",
      icon: <IconCamera size={20} />,
      tone: "butter",
    },
    {
      title: "Bookings stay organized",
      copy: "Clear statuses, dates, rooms, payments, and communication in one place.",
      icon: <IconCal size={20} />,
      tone: "coral",
    },
    {
      title: "Your team knows what to do next",
      copy: "Arrivals, departures, tasks, and daily capacity are visible.",
      icon: <IconGrid size={20} />,
      tone: "mint",
    },
  ];
  const toneBg = { mint: "bg-mint text-forest", butter: "bg-butter text-[#6a4f00]", coral: "bg-coralSoft text-coral" };

  return (
    <Section
      id="operations"
      eyebrow="What StayWise helps you control"
      title="Built for calmer daily operations."
      kicker="Manage your pet care business with everything in one place, keeping your team aligned and your clients informed."
      className="py-16 sm:py-24"
    >
      <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
        {points.map((p, i) => (
          <Reveal key={p.title} delay={i * 70}>
            <div className="h-full bg-white border border-line rounded-3xl p-6 flex flex-col hover:shadow-soft hover:-translate-y-0.5 transition-all">
              <div className={`inline-flex w-12 h-12 rounded-xl items-center justify-center mb-5 ${toneBg[p.tone]}`}>
                {p.icon}
              </div>
              <div className="font-display text-[20px] text-forestDeep mb-2">{p.title}</div>
              <p className="text-[15px] leading-relaxed text-inkSoft text-pretty">
                {p.copy}
              </p>
            </div>
          </Reveal>
        ))}
      </div>
    </Section>
  );
};

// ---------- Service Types ----------
const ServiceTypes = () => {
  const services = [
    {
      title: "Pet Boarding",
      copy: "Your pet stays safely at the sitter's home.",
      icon: <IconHome size={22} />,
      tone: "mint",
    },
    {
      title: "House Sitting",
      copy: "The sitter cares for your pet and your home.",
      icon: <IconKey size={22} />,
      tone: "butter",
    },
    {
      title: "Dog Walking",
      copy: "Daily walks to keep your dog happy and healthy.",
      icon: <IconWalk size={22} />,
      tone: "coral",
    },
    {
      title: "Drop-in Visits",
      copy: "Quick visits for feeding, potty breaks, or medication.",
      icon: <IconClock size={22} />,
      tone: "mint",
    },
  ];
  const toneBg = { mint: "bg-mint text-forest", butter: "bg-butter text-[#6a4f00]", coral: "bg-coralSoft text-coral" };

  return (
    <Section
      id="services"
      eyebrow="Flexible care options"
      title="Find the right care for your pet's routine."
      kicker="Whether you need someone to stay over or just drop by, you can find a trusted local sitter."
      className="py-16 sm:py-24"
    >
      <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
        {services.map((s, i) => (
          <Reveal key={s.title} delay={i * 60}>
            <div className="h-full bg-white border border-line rounded-3xl p-6 flex flex-col items-center text-center hover:shadow-soft transition-shadow">
              <div className={`w-14 h-14 rounded-2xl flex items-center justify-center mb-5 ${toneBg[s.tone]}`}>
                {s.icon}
              </div>
              <div className="font-display text-[18px] text-forestDeep mb-2">{s.title}</div>
              <p className="text-[14px] text-inkSoft leading-relaxed">{s.copy}</p>
            </div>
          </Reveal>
        ))}
      </div>
    </Section>
  );
};

// ---------- Trust and Safety ----------
const TrustAndSafety = () => {
  const pillars = [
    {
      title: "Verified Identity",
      copy: "Every sitter passes a strict ID and background check before they can accept bookings.",
      icon: <IconShield size={20} />,
      tone: "mint",
    },
    {
      title: "Pet First Aid",
      copy: "Look for the first-aid badge. Many of our sitters are trained to handle emergencies.",
      icon: <IconHeart size={20} />,
      tone: "coral",
    },
    {
      title: "Centralized Records",
      copy: "Diet, medication, and vet details are shared securely. No miscommunication.",
      icon: <IconSearch size={20} />,
      tone: "butter",
    },
  ];
  const toneBg = { mint: "bg-mint text-forest", butter: "bg-butter text-[#6a4f00]", coral: "bg-coralSoft text-coral" };

  return (
    <Section
      id="trust"
      eyebrow="Trust & Safety"
      title="Peace of mind comes standard."
      kicker="Leaving your pet is hard. We make it easier by building a foundation of trust before you even send a message."
      className="py-16 sm:py-24"
    >
      <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
        {pillars.map((p, i) => (
          <Reveal key={p.title} delay={i * 60}>
            <div className="h-full bg-white border border-line rounded-3xl p-6 flex flex-col hover:shadow-soft transition-all">
              <div className={`inline-flex w-12 h-12 rounded-xl items-center justify-center mb-5 ${toneBg[p.tone]}`}>
                {p.icon}
              </div>
              <div className="font-display text-[19px] text-forestDeep mb-2">{p.title}</div>
              <p className="text-[14.5px] leading-relaxed text-inkSoft text-pretty">{p.copy}</p>
            </div>
          </Reveal>
        ))}
      </div>
    </Section>
  );
};

// ---------- Owner Testimonials ----------
const InitialAvatar = ({ name, tone = "mint" }) => {
  const palette = {
    mint: "bg-mint text-forest",
    butter: "bg-butter text-[#6a4f00]",
    coral: "bg-coralSoft text-coral",
    forest: "bg-forest text-cream",
  };
  return (
    <span
      aria-hidden="true"
      className={`w-11 h-11 rounded-full flex items-center justify-center font-display text-[18px] flex-none ${palette[tone] || palette.mint}`}
    >
      {name.trim()[0]}
    </span>
  );
};

const OwnerTestimonials = () => {
  const ts = [
    {
      q: "Luna needs medication twice a day. On StayWise I found a sitter with first-aid experience, and the daily photos completely put my mind at ease.",
      n: "Mariana S.",
      r: "Dog Owner, Madrid",
      tone: "mint",
    },
    {
      q: "The pet profile is genius. I only had to write out Max's allergies and routine once. Every sitter I contacted already knew exactly what to expect.",
      n: "David K.",
      r: "Cat Owner, Berlin",
      tone: "coral",
    },
    {
      q: "It's so much more professional than finding someone on social media. The secure payment and clear check-in process make a huge difference.",
      n: "Elena V.",
      r: "Pet Owner, Amsterdam",
      tone: "butter",
    },
  ];
  return (
    <Section
      id="owner-voices"
      eyebrow="What pet owners say"
      title="Connecting pets with people they can trust."
      kicker="Stories from owners who found their second home for their pets on StayWise."
      className="py-16 sm:py-24"
    >
      <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
        {ts.map((t, i) => (
          <Reveal key={t.n} delay={i * 70}>
            <div className="h-full bg-white border border-line rounded-3xl p-6 flex flex-col">
              <div className="flex items-center gap-1 text-coral mb-3">
                {[0, 1, 2, 3, 4].map((s) => (
                  <IconStar key={s} size={14} className="fill-current" />
                ))}
              </div>
              <p className="text-[15px] leading-relaxed text-forestDeep flex-1 text-pretty">
                "{t.q}"
              </p>
              <div className="mt-5 flex items-center gap-3 pt-4 border-t border-line">
                <InitialAvatar name={t.n} tone={t.tone} />
                <div>
                  <div className="text-[14px] font-semibold text-forestDeep">{t.n}</div>
                  <div className="text-[12.5px] text-inkSoft">{t.r}</div>
                </div>
              </div>
            </div>
          </Reveal>
        ))}
      </div>
    </Section>
  );
};

// ---------- Contact form ----------
const FORMSPREE_PLACEHOLDER = "https://formspree.io/f/REPLACE_WITH_YOUR_FORM_ID";

const getFormspreeEndpoint = () =>
  window.STAYWISE_CONFIG?.formspreeEndpoint ||
  window.STAYWISE_FORMSPREE_ENDPOINT ||
  FORMSPREE_PLACEHOLDER;

const isFormspreeEndpointConfigured = (endpoint) =>
  /^https:\/\/formspree\.io\/f\/[A-Za-z0-9]+$/.test(endpoint) &&
  !endpoint.includes("REPLACE_WITH_YOUR_FORM_ID");

const ContactForm = ({ audience = "pets" }) => {
  const [sent, setSent] = React.useState(false);
  const [sending, setSending] = React.useState(false);
  const [error, setError] = React.useState("");
  const formspreeEndpoint = getFormspreeEndpoint();

  const onSubmit = async (e) => {
    e.preventDefault();
    setError("");

    if (!isFormspreeEndpointConfigured(formspreeEndpoint)) {
      setError("Contact form is not connected yet. Add your Formspree endpoint in src/formspree-config.js.");
      return;
    }

    const form = e.currentTarget;
    const data = new FormData(form);
    data.set("_subject", "New StayWise contact request");
    data.set("source_page", window.location.href);
    data.set("language", window.SW_I18N?.lang || "en");

    setSending(true);
    try {
      const response = await fetch(formspreeEndpoint, {
        method: "POST",
        body: data,
        headers: { Accept: "application/json" },
      });

      if (!response.ok) {
        setError("Could not send your message. Please try again.");
        return;
      }

      form.reset();
      setSent(true);
    } catch {
      setError("Could not send your message. Please try again.");
    } finally {
      setSending(false);
    }
  };
  return (
    <section id="contact" className="relative py-16 sm:py-24 px-5 sm:px-8 lg:px-12">
      <div className="mx-auto max-w-3xl">
        <div className="bg-white border border-line rounded-[28px] p-6 sm:p-10 shadow-soft">
          <Reveal>
            <div className="text-center mb-8">
              <div className="inline-flex items-center gap-2 mb-4 px-3 py-1 rounded-full bg-mint text-forest text-[12px] font-medium">
                <span className="w-1.5 h-1.5 rounded-full bg-coral" /> Get in touch
              </div>
              <h2 className="font-display text-[32px] sm:text-[44px] leading-[1.05] text-forestDeep">
                {audience === "pets" 
                  ? "Excited to find the perfect pet sitter?" 
                  : "Ready to start using StayWise?"}
              </h2>
              <p className="mt-3 text-[15px] sm:text-[16px] text-inkSoft max-w-xl mx-auto text-pretty">
                {audience === "pets"
                  ? "Leave your contact and we will let you know when it's ready."
                  : "Contact our team and get early access to the platform."}
              </p>
            </div>
          </Reveal>

          {sent ? (
            <Reveal>
              <div className="bg-mint/50 border border-mintDeep/60 rounded-2xl p-6 text-center max-w-md mx-auto">
                <span className="inline-flex w-12 h-12 rounded-full bg-forest text-cream items-center justify-center mb-3">
                  <IconCheck size={20} />
                </span>
                <div className="font-display text-[20px] text-forestDeep">Message sent</div>
                <p className="text-[14px] text-ink/70 mt-1">Thanks — we'll be in touch within 1 business day.</p>
              </div>
            </Reveal>
          ) : (
            <form action={formspreeEndpoint} method="POST" onSubmit={onSubmit} className="max-w-[560px] mx-auto space-y-3">
              <input type="text" name="_gotcha" className="hidden" tabIndex="-1" autoComplete="off" />
              <Field label="Name">
                <input
                  required
                  name="name"
                  type="text"
                  autoComplete="name"
                  placeholder="Your name"
                  className="w-full bg-cream border border-line rounded-xl px-4 py-3 text-[14.5px] text-ink placeholder-inkSoft/70 focus:outline-none focus:border-forest/50"
                />
              </Field>
              <Field label="Email">
                <input
                  required
                  name="email"
                  type="email"
                  autoComplete="email"
                  placeholder="your@email.com"
                  className="w-full bg-cream border border-line rounded-xl px-4 py-3 text-[14.5px] text-ink placeholder-inkSoft/70 focus:outline-none focus:border-forest/50"
                />
              </Field>
              <Field label="I am a…">
                <div className="relative">
                  <select
                    required
                    name="audience"
                    defaultValue=""
                    className="w-full appearance-none bg-cream border border-line rounded-xl px-4 py-3 pr-10 text-[14.5px] text-ink focus:outline-none focus:border-forest/50"
                  >
                    <option value="" disabled>Select one…</option>
                    <option>Pet sitter or home boarder</option>
                    <option>Pet hotel or kennel</option>
                    <option>Pet owner looking for a sitter</option>
                    <option>Other</option>
                  </select>
                  <IconArrow size={14} className="absolute right-3 top-1/2 -translate-y-1/2 rotate-90 text-inkSoft pointer-events-none" />
                </div>
              </Field>
              <Field label="Message">
                <textarea
                  required
                  name="message"
                  rows={5}
                  placeholder="Tell us about your business, ask a question, or request a demo…"
                  className="w-full bg-cream border border-line rounded-xl px-4 py-3 text-[14.5px] text-ink placeholder-inkSoft/70 focus:outline-none focus:border-forest/50 min-h-[120px] resize-y"
                />
              </Field>
              {error && (
                <div role="alert" className="rounded-xl border border-coral/30 bg-coralSoft/60 px-4 py-3 text-[13px] text-forestDeep">
                  {error}
                </div>
              )}
              <div className="pt-2">
                <Button type="submit" variant="coral" size="lg" disabled={sending} className="w-full sm:w-auto disabled:opacity-60 disabled:cursor-not-allowed">
                  {sending ? "Sending..." : "Send Message"} <IconArrow size={14} />
                </Button>
              </div>
            </form>
          )}
        </div>
      </div>
    </section>
  );
};

const Field = ({ label, children }) => (
  <label className="block">
    <span className="block text-[12px] font-medium uppercase tracking-[0.12em] text-inkSoft mb-1.5">
      {label}
    </span>
    {children}
  </label>
);

// ---------- Footer ----------
const Footer = () => (
  <footer className="relative bg-forestDeep text-cream/85">
    <div className="max-w-7xl mx-auto px-5 sm:px-8 lg:px-12 py-12 grid grid-cols-1 sm:grid-cols-[1fr_auto] gap-8">
      <div>
        <Logo tone="cream" />
        <p className="mt-3 text-[13px] text-cream/60 max-w-sm">
          The trusted pet care platform for owners, sitters, and pet hotels.
        </p>
      </div>
      <div>
        <div className="text-[12px] uppercase tracking-[0.12em] text-cream/50 mb-3">Explore</div>
        <ul className="space-y-2 text-[13.5px]">
          <li><a className="hover:text-coral" href="#operations">Operations</a></li>
          <li><a className="hover:text-coral" href="#contact">Contact</a></li>
        </ul>
      </div>
    </div>
    <div className="border-t border-cream/10">
      <div className="max-w-7xl mx-auto px-5 sm:px-8 lg:px-12 py-5 flex flex-col sm:flex-row items-center justify-between gap-3 text-[12px] text-cream/55">
        <div>© 2026 StayWise. All rights reserved.</div>
        <div className="flex items-center gap-3">
          <span className="flex items-center gap-1.5"><IconLang size={12} /> English</span>
        </div>
      </div>
    </div>
  </footer>
);

Object.assign(window, {
  HowItWorks, FeatureGrid, OperationsControl, ServiceTypes, TrustAndSafety, OwnerTestimonials, ContactForm, Footer,
});
