/* Maidpilot — single-page landing (final)
   - All CTAs open a modal booking form with success state (no real submit)
   - No fake phone numbers, emails, license IDs, etc.
   - Visuals use abstract tonal art rather than "photo placeholder" captions
*/

const { useState, useMemo, useEffect, createContext, useContext } = React;

/* ---------- Icons ---------- */
const Icon = ({ d, size = 20, stroke = 'currentColor', fill = 'none', sw = 1.6, className = '' }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill} stroke={stroke} strokeWidth={sw}
       strokeLinecap="round" strokeLinejoin="round" className={className} aria-hidden="true">{d}</svg>
);
const IChevron = (p) => <Icon {...p} d={<polyline points="9 18 15 12 9 6" />} />;
const IArrow = (p) => <Icon {...p} d={<><line x1="5" y1="12" x2="19" y2="12" /><polyline points="13 6 19 12 13 18" /></>} />;
const IStar = ({ size = 16, className = '' }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="#4DBDBA" stroke="#4DBDBA" strokeWidth="1" strokeLinejoin="round" className={className} aria-hidden="true">
    <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
  </svg>
);
const ICheck = ({ size = 14, color = '#0F1729' }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
    <polyline points="4 12 10 18 20 6" />
  </svg>
);
const IShield = (p) => <Icon {...p} d={<><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" /><polyline points="9 12 11 14 15 10" /></>} />;
const IHome = (p) => <Icon {...p} d={<><path d="M3 10l9-7 9 7v11a1 1 0 0 1-1 1h-5v-7h-6v7H4a1 1 0 0 1-1-1z" /></>} />;
const IPlus = (p) => <Icon {...p} d={<><line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" /></>} />;
const IX = (p) => <Icon {...p} d={<><line x1="6" y1="6" x2="18" y2="18" /><line x1="18" y1="6" x2="6" y2="18" /></>} />;
const IMail = (p) => <Icon {...p} d={<><rect x="3" y="5" width="18" height="14" rx="2" /><polyline points="3 7 12 13 21 7" /></>} />;
const ICal = (p) => <Icon {...p} d={<><rect x="3" y="5" width="18" height="16" rx="2" /><line x1="3" y1="10" x2="21" y2="10" /><line x1="8" y1="3" x2="8" y2="7" /><line x1="16" y1="3" x2="16" y2="7" /></>} />;
const IMenu = (p) => <Icon {...p} d={<><line x1="4" y1="7" x2="20" y2="7" /><line x1="4" y1="12" x2="20" y2="12" /><line x1="4" y1="17" x2="20" y2="17" /></>} />;

const Broom = ({ size = 22 }) => (
  <svg width={size} height={size} viewBox="0 0 32 32" fill="none" aria-hidden="true">
    <path d="M20.5 4.5L12.5 12.5" stroke="#0F1729" strokeWidth="1.8" strokeLinecap="round" />
    <path d="M19 3L21.5 5.5" stroke="#0F1729" strokeWidth="1.8" strokeLinecap="round" />
    <path d="M10 14L18 22" stroke="#0F1729" strokeWidth="1.8" strokeLinecap="round" />
    <path d="M8 16l-2 8a1 1 0 0 0 1.25 1.2l8.6-2.3c.9-.25 1.2-1.37.55-2.02L9.95 14.9a1.18 1.18 0 0 0-1.95.4L8 16z"
          fill="#4DBDBA" stroke="#0F1729" strokeWidth="1.8" strokeLinejoin="round"/>
    <path d="M8 20l9 -2.4M9 23l8 -2.1" stroke="#0F1729" strokeWidth="1" opacity=".5" />
  </svg>
);

/* ---------- Booking modal context ---------- */
const BookingCtx = createContext({ open: () => {}, close: () => {} });
const useBooking = () => useContext(BookingCtx);

/* ---------- Primitives ---------- */
const TealBtn = ({ children, className = '', ...rest }) => (
  <button {...rest} className={`inline-flex items-center justify-center gap-2 rounded-full px-5 py-3 text-[15px] font-medium bg-teal text-ink transition active:translate-y-px hover:brightness-95 shadow-[0_1px_0_rgba(15,23,41,0.06),0_10px_24px_-10px_rgba(77,189,186,0.65)] ${className}`}>
    {children}
  </button>
);

const GhostBtn = ({ children, className = '', ...rest }) => (
  <button {...rest} className={`inline-flex items-center justify-center gap-2 rounded-full px-5 py-3 text-[15px] font-medium border border-ink/15 text-ink hover:border-ink transition active:translate-y-px ${className}`}>
    {children}
  </button>
);

/* ---------- Abstract "photo" artwork (subtle, tonal, no captions) ---------- */
const HeroArt = () => (
  <svg viewBox="0 0 400 500" className="absolute inset-0 h-full w-full" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
    <defs>
      <linearGradient id="hg1" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stopColor="#EEF4F4" />
        <stop offset="1" stopColor="#DDE7E7" />
      </linearGradient>
      <linearGradient id="hg2" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0" stopColor="#F4E8DD" />
        <stop offset="1" stopColor="#E8D8C6" />
      </linearGradient>
    </defs>
    <rect width="400" height="500" fill="url(#hg1)" />
    {/* horizon line (countertop/wall) */}
    <rect y="310" width="400" height="190" fill="#E3DACB" opacity="0.55" />
    {/* window */}
    <rect x="36" y="60" width="150" height="210" rx="4" fill="#F7FAFA" />
    <line x1="111" y1="60" x2="111" y2="270" stroke="#0F1729" strokeOpacity="0.12" />
    <line x1="36" y1="165" x2="186" y2="165" stroke="#0F1729" strokeOpacity="0.12" />
    {/* pendant */}
    <line x1="280" y1="0" x2="280" y2="90" stroke="#0F1729" strokeOpacity="0.35" />
    <ellipse cx="280" cy="100" rx="22" ry="14" fill="#0F1729" opacity="0.75" />
    {/* vase on counter */}
    <path d="M240 310 C240 285 260 285 260 310 L258 360 C258 370 242 370 242 360 Z" fill="url(#hg2)" />
    <path d="M250 285 C245 270 250 260 253 275" stroke="#4DBDBA" strokeWidth="2.5" fill="none" strokeLinecap="round" />
    <path d="M253 280 C258 265 263 258 260 275" stroke="#4DBDBA" strokeWidth="2.5" fill="none" strokeLinecap="round" opacity="0.7" />
    {/* bowl */}
    <ellipse cx="330" cy="335" rx="38" ry="10" fill="#0F1729" opacity="0.08" />
    <path d="M295 335 Q330 360 365 335" fill="#FAFBFC" stroke="#0F1729" strokeOpacity="0.15" />
    {/* sun ray */}
    <polygon points="186,60 230,60 196,270 170,270" fill="#FDF8F2" opacity="0.55" />
  </svg>
);

const InteriorArt = ({ variant = 'sand' }) => (
  <svg viewBox="0 0 400 500" className="absolute inset-0 h-full w-full" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
    <defs>
      <linearGradient id={`ia-${variant}`} x1="0" y1="0" x2="0" y2="1">
        {variant === 'sand' ? (
          <><stop offset="0" stopColor="#F7ECE0" /><stop offset="1" stopColor="#E6D3BF" /></>
        ) : variant === 'cool' ? (
          <><stop offset="0" stopColor="#EEF3F3" /><stop offset="1" stopColor="#D8E2E2" /></>
        ) : (
          <><stop offset="0" stopColor="#1A2236" /><stop offset="1" stopColor="#0F1729" /></>
        )}
      </linearGradient>
    </defs>
    <rect width="400" height="500" fill={`url(#ia-${variant})`} />
    {/* archway */}
    <path d="M110 500 L110 200 Q200 110 290 200 L290 500 Z"
          fill={variant === 'ink' ? '#0B111F' : variant === 'cool' ? '#E0EAEA' : '#EFDFCB'} opacity="0.9" />
    {/* floor line */}
    <line x1="0" y1="420" x2="400" y2="420" stroke={variant === 'ink' ? '#FFFFFF' : '#0F1729'} strokeOpacity="0.12" />
    {/* small chair shape */}
    <rect x="170" y="340" width="60" height="6" fill={variant === 'ink' ? '#FFFFFF' : '#0F1729'} opacity="0.25" />
    <line x1="178" y1="346" x2="178" y2="420" stroke={variant === 'ink' ? '#FFFFFF' : '#0F1729'} strokeOpacity="0.25" strokeWidth="2" />
    <line x1="222" y1="346" x2="222" y2="420" stroke={variant === 'ink' ? '#FFFFFF' : '#0F1729'} strokeOpacity="0.25" strokeWidth="2" />
    <rect x="182" y="300" width="36" height="44" rx="3" fill={variant === 'ink' ? '#0F1729' : '#4DBDBA'} opacity={variant === 'ink' ? 0.5 : 0.25} />
  </svg>
);

/* Portrait art — abstract silhouette on tonal background, no "portrait" captions */
const PortraitArt = ({ tone = 'warm', seed = 0 }) => {
  const palettes = {
    warm: { bg1: '#F4E8DD', bg2: '#E8D3BC', fg: '#C9A880' },
    cool: { bg1: '#E5EEEE', bg2: '#CFDEDE', fg: '#8FB4B2' },
    sage: { bg1: '#E9EFEA', bg2: '#CFDDD2', fg: '#93AE9A' },
    slate: { bg1: '#E9EBF0', bg2: '#CED3DD', fg: '#8C97AE' },
  };
  const p = palettes[tone] || palettes.warm;
  const cx = 200 + (seed % 2 === 0 ? -6 : 6);
  return (
    <svg viewBox="0 0 400 500" className="absolute inset-0 h-full w-full" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
      <defs>
        <linearGradient id={`pg-${seed}`} x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stopColor={p.bg1} />
          <stop offset="1" stopColor={p.bg2} />
        </linearGradient>
      </defs>
      <rect width="400" height="500" fill={`url(#pg-${seed})`} />
      {/* shoulders */}
      <path d={`M50 500 C 80 380 ${cx-80} 360 ${cx} 360 C ${cx+80} 360 320 380 350 500 Z`} fill={p.fg} opacity="0.85" />
      {/* neck */}
      <rect x={cx - 22} y="300" width="44" height="70" fill={p.fg} opacity="0.85" />
      {/* head */}
      <ellipse cx={cx} cy="260" rx="62" ry="72" fill={p.fg} />
    </svg>
  );
};

/* =================================================================== */
/*  HEADER                                                              */
/* =================================================================== */

function Header() {
  const { open } = useBooking();
  const links = [
    { label: 'Services', href: '#services' },
    { label: 'Pricing', href: '#pricing' },
    { label: 'Reviews', href: '#reviews' },
    { label: 'Areas', href: '#areas' },
  ];
  return (
    <header className="sticky top-0 z-40 bg-bg/85 backdrop-blur border-b border-divider">
      <div className="max-w-[1200px] mx-auto px-6 h-[72px] flex items-center justify-between">
        <a href="#top" className="flex items-center gap-2.5">
          <Broom />
          <span className="font-serif-r text-[22px] tracking-tight leading-none">Maidpilot</span>
        </a>
        <nav className="hidden md:flex items-center gap-8 text-[15px] text-ink/75">
          {links.map(l => (
            <a key={l.label} href={l.href} className="hover:text-ink transition">{l.label}</a>
          ))}
        </nav>
        <div className="flex items-center gap-3">
          <TealBtn onClick={() => open()}>Book a cleaning <IArrow size={16} sw={2} /></TealBtn>
        </div>
      </div>
    </header>
  );
}

/* =================================================================== */
/*  HERO                                                                */
/* =================================================================== */

function Hero() {
  const { open } = useBooking();
  return (
    <section id="top" className="relative">
      <div className="max-w-[1200px] mx-auto px-6 pt-16 md:pt-24 pb-16 md:pb-24 grid grid-cols-1 lg:grid-cols-[1.05fr_1fr] gap-12 lg:gap-16 items-center">
        <div>
          <div className="inline-flex items-center gap-2 text-[13px] tracking-wide uppercase text-ink/55 mb-6">
            <span className="h-px w-8 bg-ink/30" /> Residential cleaning, done right
          </div>
          <h1 className="font-serif-i text-[56px] md:text-[72px] leading-[0.98] tracking-[-0.01em]">
            A spotless home, <br className="hidden md:block" />
            without the <span className="font-serif-r not-italic">awkward</span> phone call.
          </h1>
          <p className="mt-6 max-w-[520px] text-[18px] text-ink/75">
            Book a trusted cleaning in 60 seconds. Real humans, flat rates,
            no lowball-then-upsell.
          </p>
          <div className="mt-8 flex flex-wrap items-center gap-3">
            <TealBtn onClick={() => open()} className="px-6 py-4 text-[16px]">
              Get my price <span className="text-ink/60">(60 seconds)</span>
            </TealBtn>
            <a href="#pricing" className="text-[15px] underline underline-offset-4 decoration-ink/30 hover:decoration-ink ml-2">
              See flat-rate pricing
            </a>
          </div>
          <div className="mt-10 flex flex-wrap items-center gap-x-7 gap-y-4 text-[14px] text-ink/70">
            <span className="flex items-center gap-2">
              <span className="flex">{[0,1,2,3,4].map(i => <IStar key={i} size={15} />)}</span>
              <b className="text-ink font-medium">4.9</b> on Google
            </span>
            <span className="h-4 w-px bg-divider" />
            <span><b className="text-ink font-medium">2,400+</b> homes cleaned</span>
            <span className="h-4 w-px bg-divider" />
            <span className="flex items-center gap-1.5"><IShield size={15} /> Fully insured + bonded</span>
          </div>
        </div>

        <div className="relative">
          <div className="absolute -inset-3 md:-inset-5 rounded-[22px] bg-sand" aria-hidden="true" />
          <div className="relative aspect-[4/5] rounded-[14px] overflow-hidden">
            <HeroArt />
            <div className="absolute bottom-4 left-4 bg-white/90 backdrop-blur rounded-full px-3 py-1.5 text-[12px] text-ink/70 flex items-center gap-1.5">
              <span className="h-1.5 w-1.5 rounded-full bg-teal" /> Next available: Tuesday, 9–11am
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  INLINE QUOTE WIDGET (on-page, non-submitting)                       */
/* =================================================================== */

function QuoteWidget() {
  const { open } = useBooking();
  const [bedrooms, setBedrooms] = useState(2);
  const [frequency, setFrequency] = useState('biweekly');
  const [bathrooms, setBathrooms] = useState(1.5);

  const price = useMemo(() => {
    const base = { 1: 109, 2: 149, 3: 189, 4: 229, 5: 269 }[bedrooms] || 149;
    const bathAdj = (bathrooms - 1) * 10;
    const discount = frequency === 'weekly' ? 0.80 : frequency === 'biweekly' ? 0.88 : 1;
    return Math.round((base + bathAdj) * discount);
  }, [bedrooms, bathrooms, frequency]);

  const freqLabel = { once: 'One-time', biweekly: 'Every 2 weeks', weekly: 'Weekly' }[frequency];

  return (
    <section id="book" className="relative">
      <div className="max-w-[1200px] mx-auto px-6 pb-20 md:pb-28">
        <div className="grid grid-cols-1 lg:grid-cols-[1fr_1.1fr] gap-10 lg:gap-16 items-start">
          <div className="lg:sticky lg:top-28">
            <div className="text-[13px] uppercase tracking-wide text-ink/55 mb-4">01 — Booking</div>
            <h2 className="font-serif-r text-[40px] md:text-[48px] leading-[1.02] tracking-[-0.01em]">
              Get a real quote in <span className="font-serif-i">sixty seconds</span>.
            </h2>
            <p className="mt-5 text-[17px] text-ink/70 max-w-[460px]">
              Size your home, pick a rhythm, and we'll show your flat rate. No email required to see the price.
            </p>
            <ul className="mt-7 space-y-3 text-[15px] text-ink/75">
              {['Flat rate, shown upfront', 'Same cleaner each visit when you book recurring', 'Free reschedule up to 24h before'].map(t => (
                <li key={t} className="flex items-start gap-2.5">
                  <span className="mt-[3px] h-5 w-5 rounded-full bg-teal/25 grid place-items-center"><ICheck size={12} /></span>
                  {t}
                </li>
              ))}
            </ul>
          </div>

          <div className="relative">
            <div className="absolute -top-4 -left-4 h-24 w-24 rounded-full bg-sand/70 blur-xl" aria-hidden />
            <div className="relative bg-white rounded-[20px] border border-divider shadow-[0_1px_0_rgba(15,23,41,0.03),0_30px_60px_-30px_rgba(15,23,41,0.18)] overflow-hidden">
              <div className="px-6 pt-6 pb-2">
                <div className="text-[12px] uppercase tracking-wide text-ink/55 mb-2">Your home</div>
                <div className="font-serif-r text-[22px]">How many bedrooms?</div>
                <div className="flex flex-wrap gap-2.5 mt-4">
                  {[1,2,3,4,'5+'].map((n, i) => {
                    const val = typeof n === 'number' ? n : 5;
                    const active = bedrooms === val;
                    return (
                      <button key={i} onClick={() => setBedrooms(val)}
                        className={`h-11 min-w-[64px] px-5 rounded-full border text-[15px] transition
                          ${active ? 'bg-ink text-white border-ink' : 'bg-bg text-ink border-divider hover:border-ink/40'}`}>
                        {n} {typeof n === 'number' && (n === 1 ? 'bdrm' : 'bdrms')}
                      </button>
                    );
                  })}
                </div>

                <div className="mt-6">
                  <div className="text-[13px] text-ink/60 mb-2">Bathrooms</div>
                  <div className="flex gap-2 flex-wrap">
                    {[1, 1.5, 2, 2.5, 3].map(o => (
                      <button key={o} onClick={() => setBathrooms(o)}
                        className={`h-10 min-w-[54px] px-3 rounded-full border text-[14px]
                          ${bathrooms === o ? 'bg-ink text-white border-ink' : 'bg-bg border-divider text-ink/80 hover:border-ink/40'}`}>
                        {o}
                      </button>
                    ))}
                  </div>
                </div>

                <div className="mt-7">
                  <div className="text-[12px] uppercase tracking-wide text-ink/55 mb-2">Cadence</div>
                  <div className="font-serif-r text-[22px]">How often?</div>
                  <div className="mt-4 grid grid-cols-1 sm:grid-cols-3 gap-2.5">
                    {[
                      { id: 'once', label: 'One-time', note: 'Full price' },
                      { id: 'biweekly', label: 'Every 2 weeks', note: 'Save 12%', badge: 'Most popular' },
                      { id: 'weekly', label: 'Weekly', note: 'Save 20%' },
                    ].map(o => {
                      const active = frequency === o.id;
                      return (
                        <button key={o.id} onClick={() => setFrequency(o.id)}
                          className={`relative text-left rounded-2xl border p-4 transition
                            ${active ? 'border-ink bg-sand/40' : 'border-divider bg-bg hover:border-ink/30'}`}>
                          {o.badge && (
                            <span className="absolute -top-2 right-3 bg-teal text-ink text-[11px] font-medium px-2 py-0.5 rounded-full">
                              {o.badge}
                            </span>
                          )}
                          <div className="text-[15px] font-medium">{o.label}</div>
                          <div className="text-[13px] text-ink/60 mt-0.5">{o.note}</div>
                          <div className={`mt-3 h-4 w-4 rounded-full border-2 ${active ? 'border-ink bg-ink' : 'border-ink/25'}`} />
                        </button>
                      );
                    })}
                  </div>
                </div>
              </div>

              <div className="border-t border-divider px-6 py-5 flex items-center justify-between bg-bg/60 mt-6">
                <div>
                  <div className="text-[12px] uppercase tracking-wide text-ink/55">Your price</div>
                  <div className="flex items-baseline gap-1.5">
                    <span className="font-serif-r text-[40px] leading-none">${price}</span>
                    <span className="text-[14px] text-ink/60">per cleaning</span>
                  </div>
                  <div className="text-[12px] text-ink/55 mt-0.5">
                    {bedrooms === 5 ? '5+' : bedrooms} bdrm · {bathrooms} bath · {freqLabel}
                  </div>
                </div>
                <TealBtn onClick={() => open({ bedrooms, bathrooms, frequency, price })}>
                  Continue <IArrow size={16} sw={2} />
                </TealBtn>
              </div>
            </div>
            <div className="mt-3 text-[12px] text-ink/55 text-center">
              No card required to get a price · Cancel free up to 24h before
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  INCLUDED                                                            */
/* =================================================================== */

function Included() {
  const items = [
    ['Kitchen deep clean', 'Counters, stovetop, exterior of appliances'],
    ['Bathrooms sanitized', 'Tubs, tile, toilets, fixtures'],
    ['Floors mopped + vacuumed', 'Hard floors and all carpeted rooms'],
    ['Dusting, all surfaces', 'Shelves, sills, light fixtures'],
    ['Trash + recycling out', 'Bins relined and replaced'],
    ['Beds made', 'Linens straightened, pillows fluffed'],
    ['Appliances wiped', 'Microwave, toaster, coffee maker'],
    ['Mirrors + glass', 'Streak-free, every visit'],
    ['Baseboards', 'Hand-wiped during Standard + Deep'],
    ['Interior windows', 'On request', 'on request'],
    ['Laundry folded', 'Add-on', 'add-on'],
    ['Inside fridge', 'Add-on', 'add-on'],
  ];
  return (
    <section id="services" className="border-t border-divider bg-white">
      <div className="max-w-[1200px] mx-auto px-6 py-20 md:py-28">
        <div className="flex items-end justify-between gap-10 mb-12 flex-wrap">
          <div>
            <div className="text-[13px] uppercase tracking-wide text-ink/55 mb-3">02 — What's included</div>
            <h2 className="font-serif-r text-[40px] md:text-[56px] leading-[1] tracking-[-0.01em]">
              Every cleaning, <span className="font-serif-i">every time.</span>
            </h2>
          </div>
          <p className="max-w-[360px] text-[16px] text-ink/70">
            A fixed checklist your cleaner follows, inspected after every visit. Clear add-ons,
            no mystery line items.
          </p>
        </div>

        <div className="grid grid-cols-1 md:grid-cols-2 gap-x-16 gap-y-2">
          {items.map(([t, s, tag], i) => (
            <div key={i} className="flex items-start gap-4 py-4 border-b border-divider">
              <span className="mt-1 h-6 w-6 rounded-full bg-teal grid place-items-center flex-none">
                <ICheck size={13} />
              </span>
              <div className="flex-1">
                <div className="text-[17px]">{t}</div>
                <div className="text-[14px] text-ink/55">{s}</div>
              </div>
              {tag && (
                <span className="text-[11px] uppercase tracking-wide text-ink/50 bg-sand rounded-full px-2.5 py-1 mt-1">
                  {tag}
                </span>
              )}
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  CLEANERS                                                            */
/* =================================================================== */

function Cleaners() {
  const team = [
    { name: 'Maribel', years: 6, speaks: 'English, Spanish', tone: 'warm' },
    { name: 'Jordan', years: 3, speaks: 'English', tone: 'cool' },
    { name: 'Anika', years: 4, speaks: 'English, Hindi', tone: 'sage' },
    { name: 'Lena', years: 8, speaks: 'English, Polish', tone: 'slate' },
  ];
  return (
    <section className="border-t border-divider">
      <div className="max-w-[1200px] mx-auto px-6 py-20 md:py-28">
        <div className="mb-12 max-w-[640px]">
          <div className="text-[13px] uppercase tracking-wide text-ink/55 mb-3">03 — The team</div>
          <h2 className="font-serif-r text-[40px] md:text-[56px] leading-[1] tracking-[-0.01em]">
            No random gig workers. <span className="font-serif-i">Real employees.</span>
          </h2>
          <p className="mt-5 text-[16px] text-ink/70">
            Every Maidpilot cleaner is W-2, background-checked, and paid a living wage with benefits.
            Book recurring and you'll see the same face each visit.
          </p>
        </div>

        <div className="grid grid-cols-2 md:grid-cols-4 gap-5">
          {team.map((p, i) => (
            <figure key={i}>
              <div className="relative aspect-[4/5] rounded-2xl overflow-hidden">
                <PortraitArt tone={p.tone} seed={i} />
                <div className="absolute top-4 right-4 h-8 min-w-8 px-2 rounded-full bg-white/90 grid place-items-center text-[11px] font-medium">
                  {p.years}y
                </div>
              </div>
              <figcaption className="mt-4">
                <div className="flex items-baseline justify-between">
                  <div className="font-serif-r text-[22px]">{p.name}</div>
                  <div className="text-[13px] text-ink/55">{p.years} yrs</div>
                </div>
                <div className="mt-1.5 inline-flex items-center gap-1.5 text-[12px] text-ink/65 bg-sand rounded-full px-2.5 py-1">
                  Speaks: {p.speaks}
                </div>
              </figcaption>
            </figure>
          ))}
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  PRICING                                                             */
/* =================================================================== */

function Pricing() {
  const { open } = useBooking();
  const plans = [
    { name: 'Quick Tidy', price: 89, tag: 'Touch-up between deep cleans', home: 'Studios + 1 bdrm',
      feats: ['Kitchen + bath surface clean', 'Floors vacuumed', 'Trash out', 'Up to 90 minutes'] },
    { name: 'Standard Clean', price: 149, tag: 'Our most-booked plan', highlight: true, home: '2–3 bdrm homes',
      feats: ['Full checklist, top to bottom', 'Baseboards + fixtures', 'Beds made', 'Up to 3 hours'] },
    { name: 'Deep Clean', price: 249, tag: 'First visit or seasonal reset', home: '3+ bdrm or post-reno',
      feats: ['Everything in Standard', 'Inside oven + fridge', 'Grout + tile detail', 'Up to 5 hours'] },
  ];
  return (
    <section id="pricing" className="border-t border-divider bg-white">
      <div className="max-w-[1200px] mx-auto px-6 py-20 md:py-28">
        <div className="mb-14 flex items-end justify-between flex-wrap gap-6">
          <div>
            <div className="text-[13px] uppercase tracking-wide text-ink/55 mb-3">04 — Pricing</div>
            <h2 className="font-serif-r text-[40px] md:text-[56px] leading-[1] tracking-[-0.01em]">
              Flat rates. <span className="font-serif-i">No surprises.</span>
            </h2>
          </div>
          <p className="max-w-[380px] text-[16px] text-ink/70">
            Prices shown are for the average home. Your quote is finalized after the bedroom count —
            never after a phone call.
          </p>
        </div>

        <div className="grid grid-cols-1 md:grid-cols-3 gap-5">
          {plans.map((p, i) => {
            const hl = p.highlight;
            return (
              <article key={i}
                className={`rounded-[20px] p-7 flex flex-col
                  ${hl ? 'bg-sand border border-sand' : 'bg-bg border border-divider'}`}>
                <div className="flex items-center justify-between">
                  <h3 className="font-serif-r text-[26px]">{p.name}</h3>
                  {hl && <span className="text-[11px] uppercase tracking-wide bg-ink text-white rounded-full px-2.5 py-1">Most booked</span>}
                </div>
                <p className="text-[14px] text-ink/60 mt-1">{p.tag}</p>

                <div className="mt-7 flex items-baseline gap-1.5">
                  <span className="font-serif-r text-[64px] leading-none">${p.price}</span>
                  <span className="text-[14px] text-ink/60">per cleaning</span>
                </div>
                <div className="mt-2 text-[13px] text-ink/55 flex items-center gap-1.5">
                  <IHome size={14} /> Typical: {p.home}
                </div>

                <ul className="mt-7 space-y-2.5 text-[15px] flex-1">
                  {p.feats.map((f, j) => (
                    <li key={j} className="flex items-start gap-2.5">
                      <span className="mt-1 h-4 w-4 rounded-full bg-teal grid place-items-center flex-none"><ICheck size={10} /></span>
                      {f}
                    </li>
                  ))}
                </ul>

                <div className="mt-7">
                  {hl ? (
                    <TealBtn onClick={() => open({ plan: p.name, price: p.price })} className="w-full py-3.5">
                      Book Standard <IArrow size={15} sw={2} />
                    </TealBtn>
                  ) : (
                    <GhostBtn onClick={() => open({ plan: p.name, price: p.price })} className="w-full h-12">
                      Book {p.name}
                    </GhostBtn>
                  )}
                </div>
              </article>
            );
          })}
        </div>

        <div className="mt-8 text-[13px] text-ink/55 flex flex-wrap items-center gap-x-6 gap-y-2">
          <span className="flex items-center gap-1.5"><IShield size={14} /> Every plan includes insurance, bonded cleaners, and a re-clean guarantee.</span>
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  REVIEWS                                                             */
/* =================================================================== */

function Reviews() {
  const reviews = [
    { name: 'Sarah K.', hood: 'Wedgewood', stars: 5, text: "Came home to everything in its place and the kitchen smelling like fresh linen. Maribel even folded the throw blanket the way I never do. Booking took me two minutes." },
    { name: 'Daniel R.', hood: 'Magnolia', stars: 5, text: "Switched from a national chain after years of inconsistency. Same cleaner every two weeks, always on time. No more calling a dispatcher." },
    { name: 'Priya N.', hood: 'Ballard', stars: 5, text: "The deep clean for our move-in was worth every dollar. Baseboards, inside the oven, the weird ledge above the kitchen cabinets — all spotless." },
    { name: 'Mike T.', hood: 'Capitol Hill', stars: 4, text: "Honest pricing. I hate phone quotes and they just… didn't do that. The only half-star off is I wish they had a later time slot on Fridays." },
    { name: 'Elena V.', hood: 'Queen Anne', stars: 5, text: "We're a household of three kids and a shedding dog. They don't flinch. Lena is an absolute professional and genuinely kind." },
    { name: 'Josh B.', hood: 'Fremont', stars: 5, text: "Cancelled once with about 18 hours notice and they waived the fee without me asking. That's the kind of service I'll keep paying for." },
  ];
  return (
    <section id="reviews" className="border-t border-divider">
      <div className="max-w-[1200px] mx-auto px-6 py-20 md:py-28">
        <div className="flex items-end justify-between flex-wrap gap-6 mb-12">
          <div>
            <div className="text-[13px] uppercase tracking-wide text-ink/55 mb-3">05 — Reviews</div>
            <h2 className="font-serif-r text-[40px] md:text-[56px] leading-[1] tracking-[-0.01em]">
              <span className="font-serif-i">4.9</span> from 640+ neighbors.
            </h2>
          </div>
          <div className="flex items-center gap-3 text-[14px] text-ink/70">
            <div className="flex">{[0,1,2,3,4].map(i => <IStar key={i} size={16} />)}</div>
            <span>Verified customer reviews</span>
          </div>
        </div>

        <div className="masonry">
          {reviews.map((r, i) => (
            <article key={i} className="bg-white border border-divider rounded-2xl p-6">
              <div className="flex items-center gap-1">
                {Array.from({ length: r.stars }).map((_, j) => <IStar key={j} size={15} />)}
                {r.stars < 5 && Array.from({ length: 5 - r.stars }).map((_, j) => (
                  <svg key={'e'+j} width="15" height="15" viewBox="0 0 24 24" fill="#E7EAF0" stroke="#E7EAF0" strokeWidth="1" strokeLinejoin="round" aria-hidden="true">
                    <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
                  </svg>
                ))}
              </div>
              <p className="mt-4 text-[16.5px] leading-[1.55] text-ink/85">"{r.text}"</p>
              <div className="mt-5 pt-4 border-t border-divider flex items-center justify-between">
                <div className="flex items-center gap-3">
                  <div className="h-9 w-9 rounded-full bg-sand grid place-items-center font-serif-r text-[15px]">
                    {r.name[0]}
                  </div>
                  <div>
                    <div className="text-[14px] font-medium">{r.name}</div>
                    <div className="text-[12px] text-ink/55">{r.hood}</div>
                  </div>
                </div>
                <div className="text-[11px] uppercase tracking-wide text-ink/45">verified</div>
              </div>
            </article>
          ))}
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  AREAS                                                               */
/* =================================================================== */

function Areas() {
  const { open } = useBooking();
  const neighborhoods = [
    'Ballard','Capitol Hill','Fremont','Green Lake','Greenwood','Madison Park',
    'Magnolia','Montlake','Mount Baker','Phinney Ridge','Queen Anne','Ravenna',
    'Roosevelt','Seward Park','South Lake Union','Sunset Hill','View Ridge',
    'Wallingford','Wedgewood','West Seattle',
  ];
  return (
    <section id="areas" className="border-t border-divider bg-sand/35">
      <div className="max-w-[1200px] mx-auto px-6 py-20 md:py-28">
        <div className="flex items-end justify-between flex-wrap gap-6 mb-10">
          <h2 className="font-serif-r text-[40px] md:text-[56px] leading-[1] tracking-[-0.01em]">
            We serve these <span className="font-serif-i">neighborhoods.</span>
          </h2>
          <div className="text-[13px] uppercase tracking-wide text-ink/55">06 — Coverage</div>
        </div>

        <ul className="grid grid-cols-2 md:grid-cols-3 gap-x-10 gap-y-2">
          {neighborhoods.map(n => (
            <li key={n} className="flex items-center justify-between py-3 border-b border-ink/10">
              <span className="text-[17px]">{n}</span>
              <span className="text-[12px] text-ink/45">available</span>
            </li>
          ))}
        </ul>

        <p className="mt-8 text-[15px] text-ink/65">
          Don't see yours?{' '}
          <button onClick={() => open({ intent: 'area-check' })} className="underline underline-offset-4 decoration-ink/30 hover:decoration-ink">
            Check your zip
          </button>{' '}
          — we're adding new neighborhoods every month.
        </p>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  FAQ                                                                 */
/* =================================================================== */

function FAQ() {
  const qs = [
    { q: 'Are your cleaners background-checked?',
      a: "Yes — every Maidpilot cleaner passes a multi-state criminal background check, identity verification, and a reference call with two prior employers before their first shift. They're W-2 employees, not contractors." },
    { q: "What if I'm not happy with the cleaning?",
      a: "Message us within 24 hours and we'll send a cleaner back at no charge to re-do anything that missed the mark. If you're still not satisfied, we'll refund the visit. No back-and-forth." },
    { q: 'Do I need to be home?',
      a: "Most of our recurring clients aren't. You can leave a key, use a lockbox code, or buzz us in remotely. Every cleaner carries an ID badge and is insured + bonded." },
    { q: "What's the cancellation policy?",
      a: "Free reschedule or cancel up to 24 hours before your visit. Inside 24 hours it's a $40 fee, which covers your cleaner's reserved time. Emergencies are always waived — just let us know." },
    { q: 'Do you bring supplies?',
      a: "Yes. We bring eco-certified supplies and our own equipment (HEPA vacuums, microfiber for every surface). If you'd prefer we use products from your cabinet — allergies, pets, specific finishes — just note it when booking." },
    { q: 'How do I pay?',
      a: 'Card on file, charged the evening of each cleaning. We send a receipt via email. We never ask for a deposit and never charge a cancellation fee outside the 24-hour window.' },
  ];
  return (
    <section className="border-t border-divider bg-white">
      <div className="max-w-[960px] mx-auto px-6 py-20 md:py-28">
        <div className="mb-12">
          <div className="text-[13px] uppercase tracking-wide text-ink/55 mb-3">07 — FAQ</div>
          <h2 className="font-serif-r text-[40px] md:text-[56px] leading-[1] tracking-[-0.01em]">
            Questions, <span className="font-serif-i">answered.</span>
          </h2>
        </div>

        <div className="divide-y divide-divider border-y border-divider">
          {qs.map((it, i) => (
            <details key={i} className="group py-6">
              <summary className="flex items-center justify-between gap-6">
                <span className="text-[20px] md:text-[22px] font-serif-r pr-6">{it.q}</span>
                <span className="chev flex-none h-9 w-9 rounded-full border border-divider grid place-items-center">
                  <IPlus size={16} />
                </span>
              </summary>
              <p className="mt-4 text-[16px] text-ink/70 max-w-[720px]">{it.a}</p>
            </details>
          ))}
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  FINAL CTA                                                           */
/* =================================================================== */

function FinalCTA() {
  const { open } = useBooking();
  return (
    <section className="relative overflow-hidden bg-ink text-white">
      <div className="max-w-[1200px] mx-auto px-6 py-24 md:py-32 grid grid-cols-1 md:grid-cols-[1.4fr_1fr] gap-10 items-center">
        <div>
          <div className="text-[13px] uppercase tracking-wide text-white/60 mb-5">Ready when you are</div>
          <h2 className="font-serif-r text-[48px] md:text-[72px] leading-[1] tracking-[-0.01em]">
            Ready for a clean house <br className="hidden md:block" />
            <span className="font-serif-i text-teal">on Tuesday?</span>
          </h2>
          <p className="mt-6 max-w-[480px] text-[17px] text-white/70">
            Pick a time, we'll handle the rest. Your first visit has a 100% satisfaction re-clean on us.
          </p>
          <div className="mt-8 flex flex-wrap items-center gap-4">
            <TealBtn onClick={() => open()} className="px-7 py-4 text-[16px]">
              Book a cleaning <IArrow size={16} sw={2} />
            </TealBtn>
            <button onClick={() => open({ intent: 'contact' })}
                    className="text-[15px] text-white/80 hover:text-white underline underline-offset-4 decoration-white/30">
              or send us a message
            </button>
          </div>
        </div>

        <div className="relative aspect-[4/5] rounded-[18px] overflow-hidden">
          <InteriorArt variant="ink" />
        </div>
      </div>
    </section>
  );
}

/* =================================================================== */
/*  FOOTER                                                              */
/* =================================================================== */

function Footer() {
  const { open } = useBooking();
  return (
    <footer className="border-t border-divider">
      <div className="max-w-[1200px] mx-auto px-6 py-14 grid grid-cols-1 md:grid-cols-[1.3fr_1fr_1fr_1fr] gap-10">
        <div>
          <div className="flex items-center gap-2.5">
            <Broom />
            <span className="font-serif-r text-[22px]">Maidpilot</span>
          </div>
          <p className="mt-4 text-[14px] text-ink/60 max-w-[300px]">
            Residential cleaning for the greater Seattle metro. Locally owned, W-2 teams, flat-rate pricing.
          </p>
          <div className="mt-5">
            <TealBtn onClick={() => open()} className="px-4 py-2.5 text-[14px]">
              Book a cleaning <IArrow size={14} sw={2} />
            </TealBtn>
          </div>
        </div>
        <FooterCol title="Service">
          <li><a href="#services" className="hover:text-ink">What's included</a></li>
          <li><a href="#pricing" className="hover:text-ink">Pricing</a></li>
          <li><a href="#areas" className="hover:text-ink">Neighborhoods</a></li>
        </FooterCol>
        <FooterCol title="Company">
          <li><a href="#reviews" className="hover:text-ink">Reviews</a></li>
          <li><button onClick={() => open({ intent: 'contact' })} className="hover:text-ink text-left">Contact us</button></li>
          <li><button onClick={() => open({ intent: 'careers' })} className="hover:text-ink text-left">Careers</button></li>
        </FooterCol>
        <FooterCol title="Trust">
          <li className="flex items-center gap-1.5"><IShield size={14} /> Bonded + fully insured</li>
          <li>Background-checked staff</li>
          <li>Re-clean guarantee</li>
        </FooterCol>
      </div>
      <div className="border-t border-divider">
        <div className="max-w-[1200px] mx-auto px-6 py-6 flex flex-wrap items-center justify-between text-[12px] text-ink/50 gap-4">
          <div>© 2026 Maidpilot · All rights reserved</div>
          <div className="flex items-center gap-6">
            <a className="hover:text-ink cursor-pointer">Privacy</a>
            <a className="hover:text-ink cursor-pointer">Terms</a>
            <a className="hover:text-ink cursor-pointer">Accessibility</a>
          </div>
        </div>
      </div>
    </footer>
  );
}
const FooterCol = ({ title, children }) => (
  <div>
    <div className="text-[12px] uppercase tracking-wide text-ink/55 mb-3">{title}</div>
    <ul className="space-y-2 text-[14px] text-ink/80">{children}</ul>
  </div>
);

/* =================================================================== */
/*  BOOKING MODAL                                                       */
/* =================================================================== */

function BookingModal({ isOpen, onClose, presets }) {
  const intent = presets?.intent; // undefined | 'contact' | 'area-check' | 'careers'
  const [step, setStep] = useState(0); // 0 = form, 1 = success
  const [bedrooms, setBedrooms] = useState(presets?.bedrooms || 2);
  const [bathrooms, setBathrooms] = useState(presets?.bathrooms || 1.5);
  const [frequency, setFrequency] = useState(presets?.frequency || 'biweekly');
  const [date, setDate] = useState(null);
  const [name, setName] = useState('');
  const [email, setEmail] = useState('');
  const [zip, setZip] = useState('');
  const [notes, setNotes] = useState('');

  useEffect(() => {
    if (isOpen) {
      setStep(0);
      if (presets?.bedrooms) setBedrooms(presets.bedrooms);
      if (presets?.bathrooms) setBathrooms(presets.bathrooms);
      if (presets?.frequency) setFrequency(presets.frequency);
    }
  }, [isOpen, presets]);

  useEffect(() => {
    if (!isOpen) return;
    const onKey = (e) => { if (e.key === 'Escape') onClose(); };
    window.addEventListener('keydown', onKey);
    const prev = document.body.style.overflow;
    document.body.style.overflow = 'hidden';
    return () => { window.removeEventListener('keydown', onKey); document.body.style.overflow = prev; };
  }, [isOpen, onClose]);

  const price = useMemo(() => {
    if (presets?.price) return presets.price;
    const base = { 1: 109, 2: 149, 3: 189, 4: 229, 5: 269 }[bedrooms] || 149;
    const bathAdj = (bathrooms - 1) * 10;
    const discount = frequency === 'weekly' ? 0.80 : frequency === 'biweekly' ? 0.88 : 1;
    return Math.round((base + bathAdj) * discount);
  }, [bedrooms, bathrooms, frequency, presets]);

  if (!isOpen) return null;

  const valid = name.trim().length > 1 && /.+@.+\..+/.test(email) && zip.trim().length >= 3;

  const handleSubmit = (e) => {
    e.preventDefault();
    if (!valid) return;
    // No real submission — just show success
    setStep(1);
  };

  const title = intent === 'contact' ? 'Send us a message'
              : intent === 'area-check' ? 'Check your neighborhood'
              : intent === 'careers' ? 'Join the team'
              : presets?.plan ? `Book ${presets.plan}`
              : 'Book your cleaning';

  const subtitle = intent === 'contact' ? "We'll reply within a few hours during business days."
                 : intent === 'area-check' ? "Drop your zip — if we're there we'll confirm on the spot."
                 : intent === 'careers' ? "W-2, benefits, living wage. Tell us about yourself."
                 : "Takes about a minute. No card required.";

  return (
    <div className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-6" role="dialog" aria-modal="true">
      <div className="absolute inset-0 bg-ink/40 backdrop-blur-sm" onClick={onClose} aria-hidden="true" />
      <div className="relative w-full sm:max-w-[560px] bg-white rounded-t-[24px] sm:rounded-[24px] shadow-[0_30px_80px_-20px_rgba(15,23,41,0.4)] overflow-hidden max-h-[92vh] flex flex-col">
        <div className="flex items-start justify-between px-7 pt-6 pb-4 border-b border-divider">
          <div>
            <div className="text-[12px] uppercase tracking-wide text-ink/55">Maidpilot</div>
            <h3 className="font-serif-r text-[28px] leading-tight mt-0.5">{title}</h3>
            <p className="text-[14px] text-ink/60 mt-1">{subtitle}</p>
          </div>
          <button onClick={onClose} aria-label="Close"
            className="h-9 w-9 rounded-full grid place-items-center text-ink/70 hover:bg-divider/60">
            <IX size={18} />
          </button>
        </div>

        {step === 0 ? (
          <form onSubmit={handleSubmit} className="flex-1 overflow-y-auto px-7 py-6 no-scrollbar">
            {!intent && (
              <div className="rounded-2xl bg-bg border border-divider p-4 mb-5">
                <div className="flex items-center justify-between">
                  <div>
                    <div className="text-[12px] uppercase tracking-wide text-ink/55">Your quote</div>
                    <div className="font-serif-r text-[36px] leading-none mt-1">${price}<span className="text-[14px] text-ink/60 font-sans"> / cleaning</span></div>
                  </div>
                  <div className="text-right text-[12px] text-ink/60 leading-5">
                    <div>{bedrooms === 5 ? '5+' : bedrooms} bdrm · {bathrooms} bath</div>
                    <div>{presets?.plan || { once: 'One-time', biweekly: 'Every 2 weeks', weekly: 'Weekly' }[frequency]}</div>
                  </div>
                </div>

                {!presets?.plan && (
                  <div className="mt-4 grid grid-cols-3 gap-1.5">
                    {[
                      { id: 'once', label: 'One-time' },
                      { id: 'biweekly', label: 'Every 2 wks' },
                      { id: 'weekly', label: 'Weekly' },
                    ].map(o => (
                      <button type="button" key={o.id} onClick={() => setFrequency(o.id)}
                        className={`h-10 rounded-full text-[13px] border transition
                          ${frequency === o.id ? 'bg-ink text-white border-ink' : 'bg-white border-divider hover:border-ink/40'}`}>
                        {o.label}
                      </button>
                    ))}
                  </div>
                )}
              </div>
            )}

            <div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
              <Field label="Your name">
                <input value={name} onChange={e => setName(e.target.value)} required
                  className="w-full h-12 rounded-xl border border-divider bg-bg px-4 text-[15px] focus:outline-none focus:border-ink/50" />
              </Field>
              <Field label="Email">
                <input type="email" value={email} onChange={e => setEmail(e.target.value)} required
                  className="w-full h-12 rounded-xl border border-divider bg-bg px-4 text-[15px] focus:outline-none focus:border-ink/50" />
              </Field>
              <Field label="Zip code">
                <input value={zip} onChange={e => setZip(e.target.value)} required
                  inputMode="numeric" maxLength={5}
                  className="w-full h-12 rounded-xl border border-divider bg-bg px-4 text-[15px] focus:outline-none focus:border-ink/50" />
              </Field>
              {!intent && (
                <Field label="Preferred start date">
                  <input type="date" value={date || ''} onChange={e => setDate(e.target.value)}
                    className="w-full h-12 rounded-xl border border-divider bg-bg px-4 text-[15px] focus:outline-none focus:border-ink/50" />
                </Field>
              )}
            </div>

            <div className="mt-4">
              <Field label={intent === 'contact' ? 'How can we help?' : intent === 'careers' ? 'Tell us about yourself' : 'Anything we should know?'}>
                <textarea value={notes} onChange={e => setNotes(e.target.value)} rows={3}
                  placeholder={intent === 'careers' ? 'Cleaning experience, availability, neighborhood…' : 'Pets, preferred products, parking, gate codes…'}
                  className="w-full rounded-xl border border-divider bg-bg px-4 py-3 text-[15px] focus:outline-none focus:border-ink/50 resize-none" />
              </Field>
            </div>

            <p className="mt-4 text-[12px] text-ink/55 flex items-start gap-2">
              <IShield size={14} /> We never share your details. By continuing you agree to our Terms &amp; Privacy policy.
            </p>

            <div className="mt-5 flex items-center justify-end gap-3">
              <GhostBtn type="button" onClick={onClose}>Cancel</GhostBtn>
              <TealBtn type="submit" disabled={!valid}
                className={`${!valid ? 'opacity-50 cursor-not-allowed' : ''}`}>
                {intent === 'contact' ? 'Send message' : intent === 'area-check' ? 'Check my zip' : intent === 'careers' ? 'Apply' : 'Confirm booking'}
                <IArrow size={16} sw={2} />
              </TealBtn>
            </div>
          </form>
        ) : (
          <div className="flex-1 overflow-y-auto px-7 py-10 text-center">
            <div className="mx-auto h-16 w-16 rounded-full bg-teal/20 grid place-items-center">
              <div className="h-11 w-11 rounded-full bg-teal grid place-items-center">
                <ICheck size={22} color="#0F1729" />
              </div>
            </div>
            <h3 className="mt-6 font-serif-r text-[34px] leading-tight">
              {intent === 'contact' ? 'Message received.' : intent === 'area-check' ? "You're in range." : intent === 'careers' ? 'Application received.' : "You're booked."}
            </h3>
            <p className="mt-3 text-[16px] text-ink/70 max-w-[380px] mx-auto">
              {intent === 'contact' && "Thanks — we have your message and will follow up within a few hours on business days."}
              {intent === 'area-check' && "Thanks for checking in. If service is available in your area, we'll confirm the details when we reply."}
              {intent === 'careers' && "Thanks for applying. If your profile looks like a fit we'll reach out within a week."}
              {!intent && (
                <>Your booking request is saved. We'll follow up to confirm timing
                {date ? <> for <b className="text-ink">{date}</b></> : ''} and the details you shared — typically same-day on business days.</>
              )}
            </p>
            {!intent && (
              <div className="mt-7 mx-auto max-w-[360px] rounded-2xl border border-divider bg-bg p-4 text-left">
                <div className="flex items-center justify-between text-[13px] text-ink/60">
                  <span className="flex items-center gap-1.5"><ICal size={14} /> First visit</span>
                  <span>{date || 'To be confirmed'}</span>
                </div>
                <div className="flex items-center justify-between text-[13px] text-ink/60 mt-2">
                  <span className="flex items-center gap-1.5"><IHome size={14} /> Home</span>
                  <span>{bedrooms === 5 ? '5+' : bedrooms} bdrm · {bathrooms} bath</span>
                </div>
                <div className="flex items-center justify-between text-[13px] text-ink/60 mt-2">
                  <span className="flex items-center gap-1.5"><IMail size={14} /> Follow-up</span>
                  <span>Queued</span>
                </div>
                <div className="mt-3 pt-3 border-t border-divider flex items-center justify-between">
                  <span className="text-[13px] text-ink/60">Price</span>
                  <span className="font-serif-r text-[22px]">${price}</span>
                </div>
              </div>
            )}
            <div className="mt-8">
              <TealBtn onClick={onClose} className="px-6">Close</TealBtn>
            </div>
            <p className="mt-5 text-[12px] text-ink/50">
              You can close this window anytime. Need changes? Start a new request from the homepage.
            </p>
          </div>
        )}
      </div>
    </div>
  );
}

const Field = ({ label, children }) => (
  <label className="block">
    <div className="text-[12px] uppercase tracking-wide text-ink/55 mb-1.5">{label}</div>
    {children}
  </label>
);

/* =================================================================== */
/*  APP                                                                 */
/* =================================================================== */

function App() {
  const [modal, setModal] = useState({ isOpen: false, presets: null });
  const api = useMemo(() => ({
    open: (presets) => setModal({ isOpen: true, presets: presets || null }),
    close: () => setModal(m => ({ ...m, isOpen: false })),
  }), []);

  return (
    <BookingCtx.Provider value={api}>
      <div className="bg-bg text-ink min-h-screen">
        <Header />
        <Hero />
        <QuoteWidget />
        <Included />
        <Cleaners />
        <Pricing />
        <Reviews />
        <Areas />
        <FAQ />
        <FinalCTA />
        <Footer />
      </div>
      <BookingModal isOpen={modal.isOpen} onClose={api.close} presets={modal.presets} />
    </BookingCtx.Provider>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(<App />);
