// Portal screens — hand-built React mocks that mirror the real
// portal.acmedia.cloud UI as closely as possible. Reference screenshots
// of the live product live in ../screenshots/ for comparison.
//
// Design tokens used throughout (mirroring Portal's Tailwind palette):
//   ink            #0f172a / #111
//   text gray      #6b7280 (gray-500)
//   light gray     #9ca3af (gray-400)
//   hairline       rgba(0,0,0,0.06)
//   surface tint   #fafaf8 (cards) / #fef3c7 amber-50 banner / #eff6ff blue-50
//   page bg        #ffffff

/* ── Shared atoms specific to Portal screens ───────────────────────── */

// Real status pills (CONFIRMED green, AWAITING REVIEW amber, COMPLETED indigo, etc.)
const STATUS_PILL = {
  Confirmed:        { bg: "#dcfce7", fg: "#166534" },
  "Awaiting Review":{ bg: "#fef3c7", fg: "#92400e" },
  "Action Needed":  { bg: "#fef3c7", fg: "#92400e" },
  Completed:        { bg: "#e0e7ff", fg: "#3730a3" },
  Cancelled:        { bg: "#fee2e2", fg: "#991b1b" },
};
const StatusBadge = ({ s }) => {
  const c = STATUS_PILL[s] || STATUS_PILL.Confirmed;
  return (
    <span style={{
      display: "inline-block",
      padding: "3px 8px",
      borderRadius: 4,
      background: c.bg, color: c.fg,
      fontSize: 10, fontWeight: 700, letterSpacing: "0.06em", textTransform: "uppercase",
      lineHeight: 1.2,
    }}>{s}</span>
  );
};

// Production stage chip (used inside Check Status panel)
const STAGE_PILL = {
  "To Shoot":            { bg: "#f3f4f6", fg: "#6b7280", fill: "linear-gradient(90deg,#d1d5db,#9ca3af)" },
  "In Queue":            { bg: "#fffbeb", fg: "#b45309", fill: "linear-gradient(90deg,#fcd34d,#f59e0b)" },
  "Editing":             { bg: "#eff6ff", fg: "#2563eb", fill: "linear-gradient(90deg,#60a5fa,#2563eb)" },
  "Delivered":           { bg: "#f0fdf4", fg: "#15803d", fill: "linear-gradient(90deg,#4ade80,#16a34a)" },
  "Ready for Invoicing": { bg: "#ecfdf5", fg: "#047857", fill: "linear-gradient(90deg,#10b981,#059669)" },
};
const StageChip = ({ s }) => {
  const c = STAGE_PILL[s];
  return (
    <span style={{
      padding: "3px 9px", borderRadius: 4,
      background: c.bg, color: c.fg,
      fontSize: 10, fontWeight: 700, letterSpacing: "0.06em", textTransform: "uppercase",
      lineHeight: 1.2,
    }}>{s}</span>
  );
};

const ServiceProgress = ({ service, stage, pct, eta }) => {
  const c = STAGE_PILL[stage];
  return (
    <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
      <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
        <span style={{ fontSize: 14, fontWeight: 500, color: "#1f2937", display: "inline-flex", alignItems: "center", gap: 8 }}>
          <span style={{ fontSize: 14 }}>{service === "Film" ? "🎬" : "📸"}</span>
          {service}
        </span>
        <StageChip s={stage} />
      </div>
      <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
        <div style={{ flex: 1, height: 6, background: "rgba(0,0,0,0.06)", borderRadius: 999, overflow: "hidden" }}>
          <div style={{ width: pct + "%", height: "100%", background: c.fill, borderRadius: 999 }} />
        </div>
        <span className="tabular" style={{ fontSize: 11, fontWeight: 500, color: "#4b5563", minWidth: 32, textAlign: "right" }}>{pct}%</span>
      </div>
      {eta && <div style={{ fontSize: 11, color: "var(--g400)", paddingLeft: 22 }}>ETA: {eta}</div>}
    </div>
  );
};

// Sidebar — minimal vertical icon rail (matches real /bookings layout)
const Rail = ({ active = "bookings" }) => {
  const Icon = ({ name, on }) => {
    const paths = {
      logo: <path d="M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z" strokeLinejoin="round" />,
      list: <><rect x="4" y="4" width="16" height="16" rx="2" /><path d="M8 9h8M8 13h8M8 17h5" strokeLinecap="round" /></>,
      help: <><circle cx="12" cy="12" r="9" /><path d="M9.5 9.5a2.5 2.5 0 015 0c0 1.7-2.5 1.7-2.5 3.5" strokeLinecap="round" /><circle cx="12" cy="17" r="0.6" fill="currentColor" /></>,
      gear: <><circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.7 1.7 0 00.3 1.8l.1.1a2 2 0 11-2.8 2.8l-.1-.1a1.7 1.7 0 00-1.8-.3 1.7 1.7 0 00-1 1.5V21a2 2 0 11-4 0v-.1a1.7 1.7 0 00-1-1.5 1.7 1.7 0 00-1.8.3l-.1.1a2 2 0 11-2.8-2.8l.1-.1a1.7 1.7 0 00.3-1.8 1.7 1.7 0 00-1.5-1H3a2 2 0 110-4h.1a1.7 1.7 0 001.5-1 1.7 1.7 0 00-.3-1.8l-.1-.1a2 2 0 112.8-2.8l.1.1a1.7 1.7 0 001.8.3h0a1.7 1.7 0 001-1.5V3a2 2 0 114 0v.1a1.7 1.7 0 001 1.5 1.7 1.7 0 001.8-.3l.1-.1a2 2 0 112.8 2.8l-.1.1a1.7 1.7 0 00-.3 1.8v0a1.7 1.7 0 001.5 1H21a2 2 0 110 4h-.1a1.7 1.7 0 00-1.5 1z" /></>,
      out: <><path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9" strokeLinecap="round" strokeLinejoin="round" /></>,
    };
    return (
      <div style={{
        width: 36, height: 36, borderRadius: 6,
        display: "flex", alignItems: "center", justifyContent: "center",
        background: on ? "rgba(0,0,0,0.04)" : "transparent",
        color: on ? "#111" : "#9ca3af",
      }}>
        <svg width={16} height={16} fill="none" stroke="currentColor" strokeWidth={1.5} viewBox="0 0 24 24">{paths[name]}</svg>
      </div>
    );
  };
  return (
    <div style={{
      width: 56, flexShrink: 0,
      display: "flex", flexDirection: "column", alignItems: "center",
      padding: "16px 0", gap: 8, background: "#fff",
    }}>
      <img src="./logo.png" alt="AC Media" width={28} height={28} style={{ display: "block", marginBottom: 12 }} />
      <Icon name="list" on={active === "bookings"} />
      <Icon name="help" on={active === "help"} />
      <div style={{ flex: 1 }} />
      <div style={{
        width: 28, height: 28, borderRadius: "50%",
        background: "#f3f4f6", color: "#6b7280",
        display: "flex", alignItems: "center", justifyContent: "center",
        fontSize: 10, fontWeight: 600, marginBottom: 4,
      }}>AT</div>
      <Icon name="gear" />
      <Icon name="out" />
    </div>
  );
};

/* ── Helpers ──────────────────────────────────────────────────────── */
const formatPrice = (n) => "$" + Number(n).toLocaleString("en-AU");

/* ── 1. DASHBOARD — bookings list with mixed statuses ──────────── */

const DASH_BOOKINGS = [
  {
    id: "AC-2041", status: "Confirmed", price: 4200,
    address: "14 Grange Rd, Toorak VIC 3142",
    sub: "Bundle 2: Luxe · 24 Apr at 10:00",
    actions: ["check", "reschedule", "cancel"],
  },
  {
    id: "AC-2042", status: "Confirmed", price: 2800,
    address: "3 Kooyong Rd, Armadale VIC 3143",
    sub: "Bundle 1: Premium · 28 Apr at 09:30",
    actions: ["check", "reschedule", "cancel"],
  },
  {
    id: "AC-2044", status: "Awaiting Review", price: 1450,
    address: "12 Esplanade, Brighton VIC 3186",
    sub: "Film 2: Cinematic · 30 Apr at 11:00",
    banner: "We're reviewing your request. You'll hear from us within 2 hours during business hours.",
    actions: ["check", "brief", "withdraw"],
  },
];

const Action = ({ kind, primary }) => {
  const labels = { check: "Check Status", reschedule: "Reschedule", cancel: "Cancel", brief: "Complete Brief", withdraw: "Withdraw" };
  const isPrimary = primary;
  const isMuted = kind === "cancel" || kind === "withdraw";
  return (
    <button style={{
      display: "inline-flex", alignItems: "center", gap: 6,
      padding: "7px 12px", borderRadius: 6,
      fontSize: 11, fontWeight: 600,
      background: isPrimary ? "#0f172a" : "#fff",
      color: isPrimary ? "#fff" : (isMuted ? "#9ca3af" : "#111"),
      border: isPrimary ? "1px solid #0f172a" : "1px solid rgba(0,0,0,0.1)",
      cursor: "pointer",
    }}>
      {kind === "check" && <svg width={11} height={11} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24"><circle cx="11" cy="11" r="7" /><path strokeLinecap="round" d="M21 21l-4.3-4.3" /></svg>}
      {kind === "reschedule" && <svg width={11} height={11} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24"><rect x="3" y="5" width="18" height="16" rx="2" /><path strokeLinecap="round" d="M16 3v4M8 3v4M3 11h18" /></svg>}
      {kind === "brief" && <svg width={11} height={11} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M11 5H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2v-5m-1.4-9.4a2 2 0 112.8 2.8L11.8 15.6 8 16.5l.9-3.8 9.7-9.7z" /></svg>}
      {labels[kind]}
    </button>
  );
};

const BookingCard = ({ b }) => (
  <div style={{ padding: "20px 0", borderBottom: "0.5px solid var(--hair)" }}>
    <div style={{ marginBottom: 8 }}>
      <StatusBadge s={b.status} />
    </div>
    <h3 style={{
      margin: "4px 0 2px", fontSize: 17, fontWeight: 500, letterSpacing: "-0.01em", color: "#0f172a",
    }}>{b.address}</h3>
    <p style={{ margin: 0, fontSize: 12, color: "var(--g400)" }}>{b.sub}</p>
    {b.banner && (
      <div style={{
        marginTop: 14, padding: "12px 14px",
        background: "#fafaf8", border: "0.5px solid rgba(0,0,0,0.06)", borderRadius: 8,
        fontSize: 12, color: "#4b5563", lineHeight: 1.5,
      }}>{b.banner}</div>
    )}
    <div style={{ display: "flex", gap: 8, marginTop: 14 }}>
      {b.actions.map((a, i) => <Action key={a} kind={a} primary={i === 0} />)}
    </div>
  </div>
);

const DashboardMock = () => (
  <div style={{ display: "flex", background: "#fff", minHeight: 540 }}>
    <Rail active="bookings" />
    <div style={{ flex: 1, padding: "28px 32px 24px" }}>
      <div className="label" style={{ fontSize: 10, color: "var(--g400)", marginBottom: 6 }}>Your Schedule</div>
      <div style={{ display: "flex", alignItems: "center", gap: 16, marginBottom: 22 }}>
        <h1 style={{ margin: 0, fontSize: 24, fontWeight: 600, letterSpacing: "-0.02em", color: "#0f172a" }}>My Bookings</h1>
        <button style={{
          padding: "6px 12px", borderRadius: 6,
          background: "#0f172a", color: "#fff",
          fontSize: 10, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase",
          border: "none", cursor: "pointer",
        }}>+ New Booking</button>
      </div>
      {DASH_BOOKINGS.map((b) => <BookingCard key={b.id} b={b} />)}
      <div style={{ marginTop: 24, padding: "16px 0 8px" }}>
        <div className="label" style={{ fontSize: 10, color: "var(--g400)", marginBottom: 12 }}>Archive</div>
        <div>
          <StatusBadge s="Completed" />
          <h4 style={{ margin: "6px 0 2px", fontSize: 15, fontWeight: 500, color: "#0f172a" }}>7/221 Chapel St, South Yarra VIC 3141</h4>
          <p style={{ margin: 0, fontSize: 11, color: "var(--g400)" }}>Photography 2: Studio · 23 Apr</p>
        </div>
      </div>
    </div>
  </div>
);

/* ── 2. WIZARD STEP 1 — package picker + Bundle 2: Luxe expanded ── */

const PKG_ROWS = [
  { name: "Bundle 1: Premium", sub: "Film: 1× Master Film (60s) + 1× Social Film (45s). Photography: 15 edited images.", details: "Daylight only · Drone", price: 2800 },
  { name: "Bundle 2: Luxe",    sub: "Film: 1× Master Film (90s) + 1× Social Film (45s) + 1× Teaser (15s). Photography: 30 edited images.", details: "Daylight into dusk · Drone", price: 4200, selected: true },
  { name: "Bundle 3: Epic",    sub: "Film: 1× Master Film (90s) + 2× Social Films (45s each) + 1× Teaser (15s). Photography: 40 edited photos.", details: "Daylight + choice of dawn OR dusk · Drone", price: 5750 },
];

const PackageRow = ({ p }) => (
  <div style={{
    display: "grid", gridTemplateColumns: "minmax(0, 1fr) 180px",
    gap: 16, alignItems: "center",
    padding: "14px 18px",
    borderLeft: p.selected ? "2px solid #0f172a" : "2px solid transparent",
    background: p.selected ? "#fafaf8" : "transparent",
  }}>
    <div>
      <div style={{ fontSize: 14, fontWeight: 600, color: "#0f172a", marginBottom: 2 }}>{p.name}</div>
      <div style={{ fontSize: 11, color: "var(--g400)", lineHeight: 1.5 }}>{p.sub}</div>
    </div>
    <div style={{ fontSize: 12, color: "#6b7280" }}>{p.details}</div>
  </div>
);

const ExtraPill = ({ children }) => (
  <span style={{
    display: "inline-flex", alignItems: "center", gap: 6,
    padding: "5px 12px", borderRadius: 999,
    background: "#4b5563", color: "#fff",
    fontSize: 11, fontWeight: 500,
  }}>
    <svg width={9} height={9} fill="none" stroke="currentColor" strokeWidth={2.5} viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M12 5v14m-7-7h14" /></svg>
    {children}
  </span>
);

const WizardMock = () => (
  <div style={{ display: "flex", background: "#fff", minHeight: 540 }}>
    <Rail active="bookings" />
    <div style={{ flex: 1, padding: "26px 32px" }}>
      {/* Header */}
      <div className="label" style={{ fontSize: 10, color: "var(--g400)", marginBottom: 6 }}>New Commission</div>
      <h1 style={{ margin: 0, fontSize: 24, fontWeight: 600, letterSpacing: "-0.02em", color: "#0f172a" }}>Book a Shoot</h1>
      {/* 3-step progress */}
      <div style={{ display: "flex", alignItems: "center", gap: 10, margin: "18px 0 22px", paddingBottom: 18, borderBottom: "0.5px solid var(--hair)" }}>
        {["Service", "Details", "Review"].map((s, i) => (
          <React.Fragment key={s}>
            <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
              <div style={{
                width: 22, height: 22, borderRadius: "50%",
                background: i === 0 ? "#0f172a" : "#f3f4f6",
                color: i === 0 ? "#fff" : "#9ca3af",
                fontSize: 10, fontWeight: 700,
                display: "flex", alignItems: "center", justifyContent: "center",
              }}>{i + 1}</div>
              <span style={{
                fontSize: 11, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase",
                color: i === 0 ? "#0f172a" : "var(--g300)",
              }}>{s}</span>
            </div>
            {i < 2 && <div style={{ flex: 1, height: 1, background: "#f3f4f6" }} />}
          </React.Fragment>
        ))}
      </div>
      {/* Step heading */}
      <div className="label" style={{ fontSize: 10, color: "var(--g300)", marginBottom: 6 }}>Step 1 — Select your service</div>
      <h2 style={{ margin: 0, fontSize: 22, fontWeight: 600, letterSpacing: "-0.02em", color: "#0f172a" }}>What are you after?</h2>
      <p style={{ margin: "6px 0 18px", fontSize: 12, color: "var(--g400)", lineHeight: 1.5 }}>
        Choose your medium and we'll show you the right collections. Each package is tailored to a specific production scope.
      </p>
      {/* Tabs */}
      <div style={{ display: "flex", gap: 8, marginBottom: 18 }}>
        {["Photography only", "Film only", "Both"].map((t, i) => (
          <button key={t} style={{
            padding: "9px 16px", borderRadius: 4,
            fontSize: 11, fontWeight: 700, letterSpacing: "0.06em", textTransform: "uppercase",
            background: i === 2 ? "#0f172a" : "transparent",
            color: i === 2 ? "#fff" : "#9ca3af",
            border: i === 2 ? "1px solid #0f172a" : "0.5px solid rgba(0,0,0,0.12)",
            cursor: "pointer",
          }}>{t}</button>
        ))}
      </div>
      {/* Package list with column headers */}
      <div style={{
        display: "grid", gridTemplateColumns: "minmax(0, 1fr) 180px",
        gap: 16, padding: "0 18px 8px",
      }}>
        <span className="label" style={{ fontSize: 9, color: "var(--g300)" }}>Bundle</span>
        <span className="label" style={{ fontSize: 9, color: "var(--g300)" }}>Details</span>
      </div>
      <div style={{ border: "0.5px solid rgba(0,0,0,0.06)", borderRadius: 8, overflow: "hidden" }}>
        {PKG_ROWS.map((p, i) => (
          <React.Fragment key={p.name}>
            <PackageRow p={p} />
            {p.selected && (
              <div style={{ borderLeft: "2px solid #0f172a", background: "#fafaf8" }}>
                <div style={{ padding: "16px 18px 18px" }}>
                  {/* Title row + SELECTED pill */}
                  <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: 14 }}>
                    <div>
                      <div style={{ fontSize: 14, fontWeight: 600, color: "#0f172a" }}>Bundle 2: Luxe</div>
                      <div style={{ fontSize: 11, color: "var(--g400)", marginTop: 2 }}>10% bundle discount already applied. Includes drone.</div>
                    </div>
                    <span style={{
                      display: "inline-flex", alignItems: "center", gap: 5,
                      padding: "4px 11px", borderRadius: 999,
                      background: "#0f172a", color: "#fff",
                      fontSize: 9, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase",
                    }}>
                      <svg width={9} height={9} fill="none" stroke="currentColor" strokeWidth={3} viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" /></svg>
                      Selected
                    </span>
                  </div>
                  {/* 2-column grid */}
                  <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 24, paddingTop: 12, borderTop: "0.5px solid rgba(0,0,0,0.06)" }}>
                    <div>
                      <div className="label" style={{ fontSize: 9, color: "var(--g300)", marginBottom: 6 }}>What you get</div>
                      <div style={{ fontSize: 12, color: "#4b5563", lineHeight: 1.5 }}>1× Master Film (90s), 1× Social Film (45s), 1× Teaser (15s). 30 edited images. Includes drone.</div>
                    </div>
                    <div>
                      <div className="label" style={{ fontSize: 9, color: "var(--g300)", marginBottom: 6 }}>On the day</div>
                      <div style={{ fontSize: 12, color: "#4b5563", lineHeight: 1.5, marginBottom: 8 }}>6-hour shoot — daylight into dusk.</div>
                      <div style={{ display: "flex", gap: 6, flexWrap: "wrap" }}>
                        <span style={{ fontSize: 10, padding: "3px 10px", borderRadius: 999, background: "rgba(0,0,0,0.04)", border: "0.5px solid rgba(0,0,0,0.08)", color: "#6b7280" }}>Daylight into dusk</span>
                        <span style={{ fontSize: 10, padding: "3px 10px", borderRadius: 999, background: "rgba(0,0,0,0.04)", border: "0.5px solid rgba(0,0,0,0.08)", color: "#6b7280" }}>Drone included</span>
                      </div>
                    </div>
                  </div>
                  {/* Extras pills */}
                  <div style={{ display: "flex", gap: 6, flexWrap: "wrap", marginTop: 16 }}>
                    <ExtraPill>Add Floor Plan / Site Plan</ExtraPill>
                    <ExtraPill>Add Social Reel</ExtraPill>
                    <ExtraPill>Add FPV Drone</ExtraPill>
                    <ExtraPill>Add Express Edit</ExtraPill>
                  </div>
                </div>
              </div>
            )}
          </React.Fragment>
        ))}
      </div>
    </div>
  </div>
);

/* ── 3. SHOOT BRIEF — film brief, partly filled ──────────────── */

const FieldLabel = ({ children, required }) => (
  <label style={{ display: "block", fontSize: 13, fontWeight: 500, color: "#374151", marginBottom: 6 }}>
    {children}{required && <span style={{ color: "#dc2626", marginLeft: 3 }}>*</span>}
  </label>
);
const FieldBox = ({ children, multiline }) => (
  <div style={{
    background: "#fafaf8", border: "0.5px solid rgba(0,0,0,0.08)", borderRadius: 8,
    padding: multiline ? "12px 14px" : "10px 14px",
    fontSize: 13, color: "#1f2937", lineHeight: 1.5,
  }}>{children}</div>
);
const Select = ({ value }) => (
  <div style={{
    display: "flex", justifyContent: "space-between", alignItems: "center",
    background: "#fafaf8", border: "0.5px solid rgba(0,0,0,0.08)", borderRadius: 8,
    padding: "10px 14px",
    fontSize: 13, color: "#1f2937",
  }}>
    {value}
    <svg width={11} height={11} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M6 9l6 6 6-6" /></svg>
  </div>
);

const BriefMock = () => (
  <div style={{ background: "#fff", padding: "30px 36px 24px", minHeight: 540 }}>
    <h1 style={{ margin: 0, fontSize: 22, fontWeight: 600, letterSpacing: "-0.02em", color: "#0f172a" }}>Shoot Brief</h1>
    <p style={{ margin: "4px 0 18px", fontSize: 12, color: "var(--g400)" }}>Help us prepare for your shoot by providing a few details.</p>
    {/* Property card */}
    <div style={{ padding: "12px 14px", border: "0.5px solid rgba(0,0,0,0.06)", borderRadius: 8, marginBottom: 22 }}>
      <div style={{ fontSize: 13, fontWeight: 500, color: "#0f172a" }}>12 Esplanade, Brighton VIC 3186</div>
      <div style={{ fontSize: 11, color: "var(--g400)", marginTop: 2 }}>Film 2: Cinematic · 30 Apr 2026</div>
    </div>
    {/* Section label */}
    <div className="label" style={{ fontSize: 10, color: "var(--g300)", marginBottom: 14 }}>Videography</div>
    <div style={{ display: "flex", flexDirection: "column", gap: 16 }}>
      <div>
        <FieldLabel required>Access instructions for the videographer</FieldLabel>
        <FieldBox multiline>Vendor will be on site from 10am. Park in the driveway.</FieldBox>
      </div>
      <div>
        <FieldLabel required>How will the videographer access the property?</FieldLabel>
        <Select value="Vendor on-site" />
        <div style={{ marginTop: 8 }}>
          <FieldBox>Sarah Beckett — 0411 234 567</FieldBox>
        </div>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
        <div>
          <FieldLabel required>Will a Piece to Camera be required?</FieldLabel>
          <Select value="No" />
        </div>
        <div>
          <FieldLabel required>Music preference</FieldLabel>
          <Select value="Elegant & cinematic" />
        </div>
      </div>
      <div>
        <FieldLabel required>Key selling points to emphasise in the video</FieldLabel>
        <FieldBox multiline>North-facing aspect with bay views. Newly renovated marble kitchen. Internal lift to all four levels.</FieldBox>
      </div>
    </div>
  </div>
);

/* ── 4. ALTERNATIVE SLOTS — Pick a new time confirmation page ─── */

const ConfirmMock = () => {
  const opts = [
    { d: "Tuesday 28 April 2026", t: "at 10am", selected: true },
    { d: "Wednesday 29 April 2026", t: "at 2:30pm" },
    { d: "Friday 1 May 2026", t: "at 9am" },
    { d: "Monday 4 May 2026", t: "at 11:30am" },
  ];
  return (
    <div style={{ background: "#fff", padding: "32px 36px 28px", minHeight: 540, maxWidth: 540, margin: "0 auto" }}>
      <div className="label" style={{ fontSize: 10, color: "#dc2626", marginBottom: 8 }}>Action Required</div>
      <h1 style={{ margin: 0, fontSize: 26, fontWeight: 600, letterSpacing: "-0.02em", color: "#0f172a" }}>Pick a new time</h1>
      <p style={{ margin: "12px 0 4px", fontSize: 13, color: "#374151", lineHeight: 1.5 }}>
        Hi Amelia Thornton — unfortunately we can't fit your original request for <strong>12 Esplanade</strong>.
      </p>
      <p style={{ margin: 0, fontSize: 11, color: "var(--g400)" }}>Originally requested: Thursday 30 April 2026 at 11am</p>
      {/* From the team box */}
      <div style={{
        marginTop: 18, padding: "14px 16px",
        borderLeft: "3px solid #2563eb", background: "#eff6ff", borderRadius: 6,
      }}>
        <div className="label" style={{ fontSize: 10, color: "#2563eb", marginBottom: 4 }}>From the Team</div>
        <p style={{ margin: 0, fontSize: 12, color: "#1e3a8a", lineHeight: 1.5 }}>
          Our usual Brighton crew has a conflict that morning — here are some other options that work for us.
        </p>
      </div>
      {/* Option cards */}
      <div style={{ marginTop: 16, display: "flex", flexDirection: "column", gap: 8 }}>
        {opts.map((o, i) => (
          <div key={i} style={{
            padding: "12px 16px",
            border: o.selected ? "1.5px solid #0f172a" : "0.5px solid rgba(0,0,0,0.1)",
            borderRadius: 8,
            background: "#fff",
          }}>
            <div className="label" style={{ fontSize: 9, color: "var(--g400)" }}>Option {i + 1}</div>
            <div style={{ fontSize: 13, fontWeight: 600, color: "#0f172a", marginTop: 3 }}>{o.d}</div>
            <div style={{ fontSize: 11, color: "var(--g400)", marginTop: 1 }}>{o.t}</div>
          </div>
        ))}
      </div>
      {/* Confirm button */}
      <button style={{
        marginTop: 18, width: "100%",
        background: "#0f172a", color: "#fff", border: "none",
        padding: "12px", borderRadius: 6,
        fontSize: 11, fontWeight: 700, letterSpacing: "0.1em", textTransform: "uppercase",
      }}>Confirm This Time</button>
      <div style={{ marginTop: 14, textAlign: "center" }}>
        <div className="label" style={{ fontSize: 10, color: "#6b7280" }}>Neither works — propose a new time</div>
      </div>
    </div>
  );
};

/* ── 5. REGISTER — Create Account form ───────────────────────── */

const UnderlineLabel = ({ children }) => (
  <div className="label" style={{ fontSize: 10, color: "var(--g400)", marginBottom: 8 }}>{children}</div>
);
const UnderlineField = ({ value, placeholder, right }) => (
  <div style={{
    display: "flex", justifyContent: "space-between", alignItems: "center",
    paddingBottom: 9, borderBottom: "0.5px solid rgba(0,0,0,0.15)",
    fontSize: 14, color: value ? "#0f172a" : "var(--g300)",
  }}>
    <span>{value || placeholder}</span>
    {right}
  </div>
);

const RegisterMock = () => (
  <div style={{ background: "#fff", padding: "36px 40px", minHeight: 540, maxWidth: 460, margin: "0 auto" }}>
    {/* Logo */}
    <img src="./logo.png" alt="AC Media" width={32} height={32} style={{ display: "block", marginBottom: 18 }} />
    <h1 style={{ margin: 0, fontSize: 36, fontWeight: 600, letterSpacing: "-0.03em", color: "#0f172a", lineHeight: 1.05 }}>Create<br/>Account.</h1>
    <p style={{ margin: "12px 0 26px", fontSize: 13, color: "var(--g400)" }}>Set up your AC Media workspace to start booking.</p>
    <div style={{ display: "flex", flexDirection: "column", gap: 18 }}>
      <div>
        <UnderlineLabel>Invite code</UnderlineLabel>
        <UnderlineField value="ATLAS-TK-2026" right={
          <span style={{ display: "inline-flex", alignItems: "center", gap: 4, fontSize: 10, fontWeight: 700, color: "#15803d", letterSpacing: "0.06em", textTransform: "uppercase" }}>
            <svg width={10} height={10} fill="none" stroke="currentColor" strokeWidth={3} viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" /></svg>
            Atlas · Toorak
          </span>
        } />
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
        <div>
          <UnderlineLabel>First name</UnderlineLabel>
          <UnderlineField value="Amelia" />
        </div>
        <div>
          <UnderlineLabel>Last name</UnderlineLabel>
          <UnderlineField value="Thornton" />
        </div>
      </div>
      <div>
        <UnderlineLabel>Work email</UnderlineLabel>
        <UnderlineField value="amelia@atlasrealty.com.au" />
      </div>
      <div>
        <UnderlineLabel>Password</UnderlineLabel>
        <UnderlineField value="••••••••" />
      </div>
    </div>
  </div>
);

/* ── 6. HELP CENTRE — accordion sections with icons ─────────── */

const HelpRow = ({ icon, title, sub, open }) => (
  <div style={{
    border: "0.5px solid rgba(0,0,0,0.08)", borderRadius: 12,
    padding: "16px 18px",
    background: open ? "#fff" : "#fff",
  }}>
    <div style={{ display: "flex", alignItems: "center", gap: 14 }}>
      <div style={{
        width: 36, height: 36, borderRadius: 8,
        background: "#fafaf8", color: "#9ca3af",
        display: "flex", alignItems: "center", justifyContent: "center",
      }}>
        <svg width={16} height={16} fill="none" stroke="currentColor" strokeWidth={1.5} viewBox="0 0 24 24">{icon}</svg>
      </div>
      <div style={{ flex: 1 }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: "#0f172a" }}>{title}</div>
        <div style={{ fontSize: 11, color: "var(--g400)", marginTop: 2 }}>{sub}</div>
      </div>
      <svg width={12} height={12} fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24" style={{ color: "#d1d5db", transform: open ? "rotate(180deg)" : undefined }}>
        <path strokeLinecap="round" strokeLinejoin="round" d="M6 9l6 6 6-6" />
      </svg>
    </div>
    {open && (
      <div style={{ marginTop: 14, paddingTop: 14, borderTop: "0.5px solid rgba(0,0,0,0.06)" }}>
        <div className="label" style={{ fontSize: 9, color: "var(--g300)", marginBottom: 6 }}>Signing in</div>
        <p style={{ margin: 0, fontSize: 12, color: "#4b5563", lineHeight: 1.6 }}>
          When your agency is set up on AC Media Portal, you'll receive an invite link via email.
          Click the link to create your account with your name, email, phone number, and a password.
        </p>
      </div>
    )}
  </div>
);

const HelpMock = () => (
  <div style={{ background: "#fff", padding: "30px 36px 24px", minHeight: 540 }}>
    <div className="label" style={{ fontSize: 10, color: "var(--g400)", marginBottom: 6 }}>Documentation</div>
    <h1 style={{ margin: 0, fontSize: 22, fontWeight: 600, letterSpacing: "-0.02em", color: "#0f172a" }}>Help Centre</h1>
    <p style={{ margin: "4px 0 16px", fontSize: 12, color: "var(--g400)", maxWidth: 360 }}>
      Everything you need to know about booking and managing real estate shoots through AC Media Portal.
    </p>
    <div style={{ display: "flex", gap: 8, marginBottom: 22 }}>
      <button style={{
        padding: "7px 14px", borderRadius: 6,
        background: "#0f172a", color: "#fff",
        fontSize: 10, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase",
        border: "none",
      }}>+ New Booking</button>
      <button style={{
        padding: "7px 14px", borderRadius: 6,
        background: "#fff", color: "#374151",
        fontSize: 10, fontWeight: 700, letterSpacing: "0.08em", textTransform: "uppercase",
        border: "0.5px solid rgba(0,0,0,0.12)",
      }}>My Bookings</button>
    </div>
    <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
      <HelpRow open
        icon={<><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09zM12 15l-3-3a22 22 0 012-3.95A12.88 12.88 0 0122 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 01-4 2zM9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" strokeLinecap="round" strokeLinejoin="round" /></>}
        title="Getting Started" sub="Signing in, navigating the portal" />
      <HelpRow icon={<><path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z" /><circle cx="12" cy="13" r="4" /></>}
        title="Booking a Shoot" sub="Choose a service, add extras, submit your request" />
      <HelpRow icon={<><rect x="3" y="4" width="18" height="18" rx="2" /><path strokeLinecap="round" d="M16 2v4M8 2v4M3 10h18" /></>}
        title="Managing Your Bookings" sub="View, track, reschedule, or cancel" />
      <HelpRow icon={<><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.12 2.12 0 013 3L12 15l-4 1 1-4 9.5-9.5z" strokeLinecap="round" strokeLinejoin="round" /></>}
        title="Completing the Shoot Brief" sub="Give us everything we need before the shoot" />
    </div>
  </div>
);

/* ── 7. LIVE STATUS — Check status panel expanded ────────────── */

const LiveStatusMock = () => (
  <div style={{ background: "#fff", padding: "30px 36px 26px", minHeight: 540 }}>
    {/* Booking header */}
    <div style={{ paddingBottom: 16, borderBottom: "0.5px solid var(--hair)" }}>
      <div style={{ marginBottom: 8 }}>
        <StatusBadge s="Confirmed" />
      </div>
      <h2 style={{ margin: "4px 0 2px", fontSize: 18, fontWeight: 500, color: "#0f172a", letterSpacing: "-0.01em" }}>14 Grange Rd, Toorak VIC 3142</h2>
      <p style={{ margin: 0, fontSize: 12, color: "var(--g400)" }}>Bundle 2: Luxe · 24 Apr at 10:00</p>
      <div style={{ display: "flex", gap: 8, marginTop: 14 }}>
        <Action kind="check" primary />
        <Action kind="reschedule" />
      </div>
    </div>
    {/* Production panel */}
    <div style={{
      marginTop: 16, padding: "18px 20px",
      background: "#fafaf8", border: "0.5px solid rgba(0,0,0,0.06)", borderRadius: 10,
    }}>
      <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 10 }}>
        <span className="label" style={{ fontSize: 10, color: "var(--g400)" }}>Overall Progress</span>
        <span className="tabular" style={{ fontSize: 14, fontWeight: 600, color: "#0f172a" }}>54%</span>
      </div>
      <div style={{ height: 6, background: "rgba(0,0,0,0.06)", borderRadius: 999, overflow: "hidden", marginBottom: 18 }}>
        <div style={{ width: "54%", height: "100%", background: "linear-gradient(90deg,#374151,#0f172a)", borderRadius: 999 }} />
      </div>
      <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>
        <ServiceProgress service="Photography" stage="Editing" pct={68} eta="Wed 29 Apr · in 9 days" />
        <ServiceProgress service="Film" stage="In Queue" pct={40} eta="Fri 1 May · in 11 days" />
      </div>
    </div>
  </div>
);

Object.assign(window, {
  DashboardMock, WizardMock, BriefMock, ConfirmMock, RegisterMock, HelpMock, LiveStatusMock,
});
