// screens-onboarding.jsx — Welcome, Privacy, Setup, Views overview

// Reusable image holder — shows a real photo when `src` is given, else a striped placeholder
function Placeholder({ label, src, h = '100%', radius = 0, dark = false, pos = 'center' }) {
  if (src) {
    return (
      <div style={{ width: '100%', height: h, borderRadius: radius, overflow: 'hidden', background: '#e7e0d0' }}>
        <img src={src} alt={label || ''} loading="lazy"
          style={{ width: '100%', height: '100%', objectFit: 'cover', objectPosition: pos, display: 'block' }} />
      </div>
    );
  }
  const base = dark ? '#202b22' : '#e7e0d0';
  const stripe = dark ? 'rgba(138,122,90,.16)' : 'rgba(138,122,90,.14)';
  return (
    <div style={{
      width: '100%', height: h, borderRadius: radius, overflow: 'hidden', position: 'relative',
      background: `repeating-linear-gradient(135deg, ${base} 0 11px, ${stripe} 11px 22px)`,
      display: 'flex', alignItems: 'center', justifyContent: 'center',
    }}>
      <span style={{
        fontFamily: 'ui-monospace, "SF Mono", Menlo, monospace', fontSize: 11,
        letterSpacing: '.04em', color: dark ? 'var(--on-dark-mute)' : 'var(--ink-mute)',
        background: dark ? 'rgba(22,32,26,.6)' : 'rgba(250,248,242,.72)',
        padding: '5px 10px', borderRadius: 6, backdropFilter: 'blur(2px)',
      }}>{label}</span>
    </div>
  );
}

function WelcomeScreen({ ctx }) {
  const warm = ctx.tone === 'warm';
  return (
    <div className="scr scr--light">
      <div style={{ height: '47%', position: 'relative', flex: '0 0 auto' }}>
        {window.BRAND.hero_url
          ? <Placeholder src={window.BRAND.hero_url} label="Atelier shelf" pos="center 30%" />
          : <div style={{ height: '100%', background: 'linear-gradient(160deg, var(--paper-2) 0%, var(--beige) 60%, var(--hairline) 100%)' }} />}
        {/* Fade into the screen background, fully at the bottom edge: at 97%
            a dark photo showed through as a thin line where it ended (Marit 2026-11-12). */}
        <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(180deg, color-mix(in srgb, var(--ink) 12%, transparent) 0%, transparent 38%, color-mix(in srgb, var(--beige) 90%, transparent) 88%, var(--beige) 100%)' }} />
        <div style={{ position: 'absolute', top: 22, left: 26 }}>
          {window.BRAND.logo_url
            ? <div style={{ background: 'color-mix(in srgb, var(--paper) 88%, transparent)', borderRadius: 10, padding: '6px 10px', display: 'inline-block' }}>
                <img src={window.BRAND.logo_url} alt={window.BRAND.merknaam} style={{ height: 34, maxWidth: 170, objectFit: 'contain', display: 'block' }} />
              </div>
            : <span className="eyebrow" style={{ color: 'var(--paper)', mixBlendMode: 'difference' }}>{window.BRAND.merknaam}</span>}
        </div>
      </div>
      <div className="pad flex1 col" style={{ justifyContent: 'space-between', marginTop: -28 }}>
        <div>
          {/* The studio can write her own welcome in the GWP customer portal (Marit 2026-11-12). */}
          <h1 className="display">{window.BRAND.welkom_titel || 'What a special moment to capture.'}</h1>
          <p className="lede" style={{ marginTop: 14, whiteSpace: 'pre-line' }}>
            {window.BRAND.welkom_tekst || (warm
              ? "Let's preserve the shape of this chapter, gently, in your own home. We'll guide you through every photo, one calm step at a time."
              : "Capture your pregnancy in a few photos at home. We'll guide each shot, then craft it in bronze.")}
          </p>
        </div>
        <div className="btn-row" style={{ marginTop: 18 }}>
          <button className="btn btn--primary" onClick={() => ctx.go('choose')}>
            Begin <IcArrow size={19} />
          </button>
          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 9, flexWrap: 'wrap', marginTop: 2 }}>
            {[
              heeft('collectie')          && <button className="linkbtn" onClick={() => ctx.go('atelier')}>The Collection</button>,
              heeft('poses')              && <button className="linkbtn" onClick={() => ctx.go('poses')}>Poses</button>,
              heeft('achter_de_schermen') && <button className="linkbtn" onClick={() => ctx.go('bts')}>Behind the scenes</button>,
              <button className="linkbtn" onClick={() => ctx.onHelp()}>Talk to {window.BRAND.team_naam}</button>,
            ].filter(Boolean).map((el, i) => (
              <React.Fragment key={i}>
                {i > 0 && <span style={{ color: 'var(--hairline)' }}>·</span>}
                {el}
              </React.Fragment>
            ))}
          </div>
        </div>
      </div>
    </div>
  );
}

function PrivacyScreen({ ctx }) {
  // Real consent: the customer ticks the box before she can continue, and the
  // app sends it along with the scan (upload-init refuses a scan without it).
  //
  // Layout like SetupScreen: the text scrolls, the tick box and Continue sit
  // in a fixed bar at the bottom. Before (2026-11-11) the box and button fell
  // below the bottom of a normal phone screen, which could not scroll, so
  // Continue looked dead (Marit).
  const [agreed, setAgreed] = React.useState(!!(ctx && ctx.capture && ctx.capture.consent));
  const [hint, setHint] = React.useState(false);
  return (
    <div className="scr scr--paper">
      <div style={{ flex: '0 0 auto' }}>
        <TopBar onBack={() => ctx.back()} step={0} total={3} onHelp={ctx.onHelp} />
      </div>
      <div style={{ flex: 1, minHeight: 0, overflowY: 'auto' }}>
        <div className="pad" style={{ paddingBottom: 12 }}>
          <div className="center" style={{
            width: 64, height: 64, borderRadius: 999, marginBottom: 20,
            background: 'color-mix(in oklch, var(--gold), transparent 86%)', color: 'var(--gold)',
          }}>
            <IcShield size={30} />
          </div>
          <span className="eyebrow">Before we begin</span>
          <h1 className="title" style={{ marginTop: 8 }}>Your photos, handled with care.</h1>
          <p className="lede" style={{ marginTop: 12 }}>
            Honesty matters to us. Here's exactly what happens with what you capture.
          </p>

          <div style={{ marginTop: 18 }}>
            {[
              [<IcEye size={19} />,  'Private by default', `Your photos are kept in private, encrypted storage. Only our ${window.BRAND.team_generiek} sees them. Nothing is public, sold or shared.`],
              [<IcLeaf size={19} />, 'Used only to make your model', 'A specialised 3D service turns your photos into a model. It processes them outside the EU, for that purpose only.'],
              [<IcDrop size={19} />, 'Deleted after 14 days', `Your original photos are deleted automatically 14 days after your scan, or at most 60 days while our ${window.BRAND.team_generiek} is still working on your model. Your 3D model is kept for one year for your order. One message removes everything sooner.`],
            ].map((r, i) => (
              <div className="checkrow" key={i}>
                <div className="chk">{r[0]}</div>
                <div><h4>{r[1]}</h4><p>{r[2]}</p></div>
              </div>
            ))}
          </div>
        </div>
      </div>
      <div style={{ flex: '0 0 auto', padding: '12px 20px 14px', borderTop: '1px solid var(--hairline)', background: 'var(--paper)' }}>
        <label style={{ display: 'flex', gap: 12, alignItems: 'flex-start', cursor: 'pointer', marginBottom: 12 }}>
          <input type="checkbox" checked={agreed} onChange={e => { setAgreed(e.target.checked); setHint(false); }}
            style={{ width: 22, height: 22, marginTop: 0, flex: '0 0 auto', accentColor: 'var(--ink)' }} />
          <span style={{ fontSize: 14, lineHeight: 1.45, color: 'var(--ink)' }}>
            I agree my photos are processed as described above.
          </span>
        </label>
        {hint && (
          <p style={{ margin: '0 0 10px', fontSize: 13, color: 'var(--rose-deep)' }}>
            Please tick the box above to continue.
          </p>
        )}
        <button className="btn btn--primary" style={{ opacity: agreed ? 1 : 0.55 }}
          onClick={() => {
            if (!agreed) { setHint(true); return; }
            if (ctx && ctx.capture) ctx.capture.consent = true;
            ctx.go('setup');
          }}>
          Continue
        </button>
      </div>
    </div>
  );
}

function SetupScreen({ ctx }) {
  const items = [
    [<IcWear size={20} />, 'What you wear is your choice', 'Nude usually gives the purest, most beautiful result, and it is completely up to you. If you would rather keep something on, a seamless thong works best: it does not cut into the skin, so it keeps your natural shape, and we can edit it away entirely. A bra is harder to remove but still possible. Some mothers choose a flowing dress or blouse instead. Whatever you wear, you decide whether it stays part of the final sculpture.'],
    [<IcSun size={20} />,  'Even, indirect daylight', 'A few steps back from any bright window, never with direct sunlight on one side of her body. Strong side-light casts hard shadows that our AI reads as missing geometry. Overcast diffused daylight or two soft lamps balanced left and right work best.'],
    [<IcWall size={20} />, 'A calm, uniform wall', 'Any uniform colour is fine, white, cream, beige, soft grey. What matters is that there is no pattern or geometry directly behind her: no framed art, no window frames in the shot, no plants, no curtains with vertical stripes. The wall should sit within 1 metre and fill the background calmly.'],
    [<IcRing size={20} />, 'Her posture makes or breaks it', 'Both feet flat on the floor, weight evenly on both sides, not leaning. Shoulders gently back and down, so she stands tall. Fingers closed together, thumb relaxed away from the rest. Hands rest softly on the belly. Breathing slowly.'],
    [<IcSparkle size={20} />, 'Mirrors out of frame', 'Mirrors and other reflective surfaces confuse our AI. Jewellery you would like to keep in your sculpture, like a wedding ring, can stay on.'],
  ];
  return (
    <div className="scr scr--light">
      <div style={{ flex: '0 0 auto' }}>
        <TopBar onBack={() => ctx.back()} step={1} total={3} onHelp={ctx.onHelp} />
      </div>
      <div style={{ flex: 1, minHeight: 0, overflowY: 'auto' }}>
        <div className="pad" style={{ paddingBottom: 12 }}>
          <span className="eyebrow">Set the scene</span>
          <h1 className="title" style={{ marginTop: 8 }}>Five small things for a beautiful result.</h1>
          <div className="card" style={{ marginTop: 18, padding: '2px 16px' }}>
            {items.map((r, i) => (
              <div className="checkrow" key={i}>
                <div className="chk">{r[0]}</div>
                <div><h4>{r[1]}</h4><p>{r[2]}</p></div>
              </div>
            ))}
          </div>
        </div>
      </div>
      <div style={{ flex: '0 0 auto', padding: '12px 20px 14px', borderTop: '1px solid var(--hairline)', background: 'var(--beige)' }}>
        <HelpBar prominence={ctx.help} onHelp={ctx.onHelp} />
        <button className="btn btn--primary" style={{ marginTop: 12 }} onClick={() => ctx.go('overview')}>
          The scene is ready <IcArrow size={19} />
        </button>
      </div>
    </div>
  );
}

// Per-mode copy table. CaptureScreen + RotationOverlay both read from this
// via window.SCAN_MODE_COPY to stay in sync with what the OverviewScreen
// promised the customer.
//
// Important UX choice: ALL copy in this table is written in named roles
// ("she" = the pregnant subject, "the partner with the phone" = the
// photographer) and avoids "you" entirely. Reason: during capture the
// person reading the screen is the photographer, not the subject, so the
// previous "you turn" / "you stay still" copy read as instructions to
// THEMSELVES instead of to their partner.

// Per-arm-pose copy override. The customer picks one on OverviewScreen.
// 'belly' = classic, hands cradle the bump, arms visible in the sculpture.
// 'back'  = hands rest on the back of the head, elbows pulled back as far as
//           comfortable so the AI can read a clean belly contour and Laila
//           can sculpt the piece without arms.
//
// Each pose replaces the body-angle hints + the overall callout. The 2 hand
// close-ups are captured for the 'belly' pose (hands on the bump, so the AI
// needs finger reference) but SKIPPED for the 'back' pose, where the piece
// is sculpted without arms so the hands are not part of the sculpture.
const ARM_POSE_COPY = {
  belly: {
    label: 'With arms, hands on belly',
    sub:   'Classic pose, arms visible in the sculpture',
    // The lower hand must stay on the belly, never below it near the pubic area (Marit 2026-11-12).
    callout: 'Both hands rest on her belly with fingers closed together and the thumb relaxed. The lower hand stays on the belly, never below it.',
    angleSuffix: 'Hands on her belly, fingers closed together, thumb relaxed. The lower hand stays on the belly, never below it.',
  },
  back: {
    label: 'No arms in the sculpture',
    sub:   'Hands behind the head, elbows pulled back',
    callout: 'Both hands rest on the back of her head. Pull the elbows back as far as comfortable so the belly silhouette stays clean and the arms are out of the side profile.',
    angleSuffix: 'Hands on the back of her head, elbows pulled back as far as comfortable.',
  },
};
if (typeof window !== 'undefined') window.ARM_POSE_COPY = ARM_POSE_COPY;

const SCAN_MODE_COPY = {
  standing: {
    label: 'Standing scan',
    sub:   'She turns, partner with phone stays put',
    lede:  "She stands in one spot in front of the wall and gently turns between each photo. The partner with the phone stays still. We frame every angle and count down.",
    // Body-positioning callout. The arm-pose specific sentence is appended
    // at runtime from ARM_POSE_COPY[armPose].callout so the same SCAN_MODE_COPY
    // entry serves both 'arms on belly' and 'arms behind head' customers.
    callout: 'the partner with the phone stands about 1.5 metres away, two big steps, and stays on that spot for all four photos. The phone is held straight upright at her hip height, just below her belly, never tilted up or down: sitting on a chair makes this easy. Only she turns. Every photo shows her whole body, head to feet, with a little room around her. Both feet stay flat on the floor throughout, weight evenly distributed.',
    angles: {
      front:        { label: 'Front',            hint: 'She faces the camera. Her whole body in the photo, head to feet. Both feet flat on the floor, weight even.', next: 'She turns a quarter to her right. You stay where you are' },
      right:        { label: 'Right side',       hint: 'She is turned a quarter to her right. Her whole body in the photo, head to feet.',                  next: 'She turns to face the wall. You stay where you are' },
      back:         { label: 'Back',             hint: 'She faces the wall. Her whole body in the photo, head to feet.', next: 'She turns a quarter further, to her left. You stay where you are' },
      left:         { label: 'Left side',        hint: 'She is turned a quarter to her left. Her whole body in the photo, head to feet.',                   next: 'Now two close-ups of her hands. She keeps them exactly where they are' },
      hand_left:    { label: 'Her left hand',    hint: 'She keeps her hands exactly where they were. Come close, about 30 cm: her left hand fills the frame, all fingers in, sharp.', next: 'Now her right hand, just as close' },
      hand_right:   { label: 'Her right hand',   hint: 'Hands still in the same place. Come close: her right hand fills the frame, all fingers in, sharp.', next: 'Lovely, that is everything' },
    },
  },
  seated: {
    label: 'Seated or special pose',
    sub:   'She stays still, partner with phone walks around her',
    lede:  "She holds her pose, comfortably seated or however feels right. The partner with the phone walks around her, stopping at each of the four sides we frame.",
    callout: 'she stays still in her pose. The partner with the phone walks around her, always about 1.5 metres away (two big steps), holding the phone straight upright at the height of her middle, never tilted up or down. Every photo shows her whole body, head to feet, with a little room around her. Both feet stay flat on the floor throughout.',
    angles: {
      front:        { label: 'Front',            hint: 'Partner stands in front of her, about 1.5 metres away. Her whole body in the photo, head to feet. Both feet flat on the floor, weight even.', next: 'Partner walks to her right side, same distance' },
      right:        { label: 'Right side',       hint: 'Partner is on her right side, about 1.5 metres away. Her whole body in the photo, head to feet.',                                    next: 'Partner walks around behind her, same distance' },
      back:         { label: 'Back',             hint: 'Partner stands directly behind her, about 1.5 metres away. Her whole body in the photo, head to feet.', next: 'Partner walks around to her left side, same distance' },
      left:         { label: 'Left side',        hint: 'Partner is on her left side, about 1.5 metres away. Her whole body in the photo, head to feet.',                                     next: 'Now two close-ups of her hands. She keeps them exactly where they are' },
      hand_left:    { label: 'Her left hand',    hint: 'She keeps her hands exactly where they were. Come close, about 30 cm: her left hand fills the frame, all fingers in, sharp.', next: 'Now her right hand, just as close' },
      hand_right:   { label: 'Her right hand',   hint: 'Hands still in the same place. Come close: her right hand fills the frame, all fingers in, sharp.', next: 'Lovely, that is everything' },
    },
  },
};
if (typeof window !== 'undefined') window.SCAN_MODE_COPY = SCAN_MODE_COPY;

function OverviewScreen({ ctx }) {
  const initialMode = window.BRAND.complexe_scans === false ? 'standing' : ((ctx && ctx.capture && ctx.capture.scanMode) || 'standing');
  const initialArm  = (ctx && ctx.capture && ctx.capture.armPose)  || 'belly';
  const [mode, setMode] = React.useState(initialMode);
  const [armPose, setArmPose] = React.useState(initialArm);
  const copy    = SCAN_MODE_COPY[mode];
  const armCopy = ARM_POSE_COPY[armPose];

  // Stash both choices on the capture store so CaptureScreen + the upload
  // helper see them without having to thread them through props.
  const pickMode = (m) => {
    setMode(m);
    if (ctx && ctx.capture) ctx.capture.scanMode = m;
  };
  const pickArm = (a) => {
    setArmPose(a);
    if (ctx && ctx.capture) ctx.capture.armPose = a;
  };

  return (
    <div className="scr scr--paper">
      <div style={{ flex: '0 0 auto' }}>
        <TopBar onBack={() => ctx.back()} step={2} total={3} onHelp={ctx.onHelp} />
      </div>

      {/* Scrollable main column so the sticky CTA stays reachable. */}
      <div style={{ flex: 1, minHeight: 0, overflowY: 'auto' }}>
        <div className="pad" style={{ paddingBottom: 12 }}>
          <span className="eyebrow">The capture</span>
          <h1 className="title" style={{ marginTop: 8 }}>
            Five photos. A couple of minutes.
          </h1>

          {/* Mode picker. Standing is the default and usually gives the
              cleanest mesh, but seated pose is supported for asymmetric or
              comfort poses. */}
          {/* Other studios start with standard scans only: one person, standing
              (Marit 2026-11-12: "in het begin geen ingewikkelder scans"). With
              one option left there is nothing to choose, so no picker. */}
          {window.BRAND.complexe_scans !== false && (
          <div style={{ marginTop: 16, display: 'flex', flexDirection: 'column', gap: 10 }}>
            {[
              ['standing', SCAN_MODE_COPY.standing.label, SCAN_MODE_COPY.standing.sub],
              ['seated',   SCAN_MODE_COPY.seated.label,   SCAN_MODE_COPY.seated.sub],
            ].map(([k, label, sub]) => {
              const active = mode === k;
              return (
                <button key={k} onClick={() => pickMode(k)} style={{
                  textAlign: 'left', cursor: 'pointer',
                  border: active ? '2px solid var(--gold)' : '1.5px solid var(--hairline)',
                  background: active ? 'color-mix(in oklch, var(--gold), transparent 92%)' : 'var(--paper)',
                  borderRadius: 14, padding: '12px 14px',
                  display: 'flex', alignItems: 'center', gap: 12,
                }}>
                  <span style={{
                    width: 22, height: 22, borderRadius: 999, flex: '0 0 auto',
                    border: active ? '6px solid var(--gold)' : '2px solid var(--hairline)',
                    background: active ? 'var(--gold)' : 'transparent',
                    boxShadow: active ? 'inset 0 0 0 3px var(--paper)' : 'none',
                    transition: 'all .2s',
                  }} />
                  <div>
                    <div style={{ fontWeight: 700, fontSize: 15, color: 'var(--ink)' }}>{label}</div>
                    <div style={{ fontSize: 12.5, color: 'var(--ink-mute)' }}>{sub}</div>
                  </div>
                </button>
              );
            })}
          </div>
          )}

          {/* Arm-pose picker. Some customers want the sculpture with arms
              visible (classic, hands cradling the belly); others want a clean
              belly silhouette without arms (hands behind the head, elbows
              tucked back). Either pose is supported. */}
          <div style={{ marginTop: 18 }}>
            <span className="eyebrow">Arms in the sculpture</span>
          </div>
          <div style={{ marginTop: 8, display: 'flex', flexDirection: 'column', gap: 10 }}>
            {[
              ['belly', ARM_POSE_COPY.belly.label, ARM_POSE_COPY.belly.sub],
              ['back',  ARM_POSE_COPY.back.label,  ARM_POSE_COPY.back.sub],
            ].map(([k, label, sub]) => {
              const active = armPose === k;
              return (
                <button key={k} onClick={() => pickArm(k)} style={{
                  textAlign: 'left', cursor: 'pointer',
                  border: active ? '2px solid var(--gold)' : '1.5px solid var(--hairline)',
                  background: active ? 'color-mix(in oklch, var(--gold), transparent 92%)' : 'var(--paper)',
                  borderRadius: 14, padding: '12px 14px',
                  display: 'flex', alignItems: 'center', gap: 12,
                }}>
                  <span style={{
                    width: 22, height: 22, borderRadius: 999, flex: '0 0 auto',
                    border: active ? '6px solid var(--gold)' : '2px solid var(--hairline)',
                    background: active ? 'var(--gold)' : 'transparent',
                    boxShadow: active ? 'inset 0 0 0 3px var(--paper)' : 'none',
                    transition: 'all .2s',
                  }} />
                  <div>
                    <div style={{ fontWeight: 700, fontSize: 15, color: 'var(--ink)' }}>{label}</div>
                    <div style={{ fontSize: 12.5, color: 'var(--ink-mute)' }}>{sub}</div>
                  </div>
                </button>
              );
            })}
          </div>

          <p className="lede" style={{ marginTop: 16 }}>{copy.lede}</p>

          <div style={{ display: 'flex', gap: 10, marginTop: 14, alignItems: 'flex-start', padding: '12px 14px', borderRadius: 12, background: 'color-mix(in oklch, var(--rose), transparent 86%)', border: '1px solid color-mix(in oklch, var(--rose), transparent 64%)' }}>
            <span style={{ color: 'var(--rose-deep)', flex: '0 0 auto', marginTop: 1 }}><IcInfo size={17} /></span>
            <p style={{ margin: 0, fontSize: 13, lineHeight: 1.5, color: 'var(--ink-soft)' }}>
              <b>Why this matters</b>, {copy.callout} {armCopy.callout}
            </p>
          </div>

          <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10, marginTop: 20 }}>
            {['front', 'right', 'back', 'left'].map((k, i) => {
              const a = copy.angles[k];
              return (
                <div className="card" key={k} style={{ padding: 14 }}>
                  <div className="serif-num" style={{ fontSize: 26, color: 'var(--gold)' }}>{String(i + 1).padStart(2, '0')}</div>
                  <div style={{ fontWeight: 700, fontSize: 15, marginTop: 4 }}>{a.label}</div>
                  <div style={{ fontSize: 12.5, color: 'var(--ink-mute)', marginTop: 2 }}>{a.hint}</div>
                </div>
              );
            })}
          </div>
          {/* Two close-ups of her hands instead of the photo from under the
              belly (Marit 2026-11-12): detail for the digital team. Not with
              hands behind her head: those come off with the head. */}
          {copy.angles.hand_left && armPose !== 'back' && (
            <div className="card" style={{ padding: 14, marginTop: 10 }}>
              <div className="serif-num" style={{ fontSize: 26, color: 'var(--gold)' }}>05 · 06</div>
              <div style={{ fontWeight: 700, fontSize: 15, marginTop: 4 }}>Close-ups of her hands</div>
              <div style={{ fontSize: 12.5, color: 'var(--ink-mute)', marginTop: 2 }}>
                She keeps her hands exactly where they are. Come close, first her left hand, then her right, each filling the frame.
              </div>
            </div>
          )}
          <div style={{ display: 'flex', gap: 10, marginTop: 16, alignItems: 'flex-start', padding: '12px 14px', borderRadius: 12, background: 'var(--paper-2)', border: '1px solid var(--hairline)' }}>
            <span style={{ color: 'var(--gold)', flex: '0 0 auto', marginTop: 1 }}><IcSparkle size={17} /></span>
            <p style={{ margin: 0, fontSize: 13, lineHeight: 1.5, color: 'var(--ink-soft)' }}>
              Afterwards you can add optional <b>detail shots</b>, like a wedding ring, a tattoo, or a scar you'd like to keep.
            </p>
          </div>
        </div>
      </div>

      {/* Sticky footer so Start capturing is always reachable. */}
      <div style={{ flex: '0 0 auto', borderTop: '1px solid var(--hairline)', background: 'var(--paper)' }}>
        {/* Quick posture check — last thing they read before pressing Start. */}
        <div style={{ padding: '12px 20px 0' }}>
          <p style={{ margin: '0 0 7px', fontSize: 11.5, fontWeight: 700, letterSpacing: '.07em', textTransform: 'uppercase', color: 'var(--ink-mute)' }}>Before you start</p>
          {[
            'Partner: two big steps away (about 1.5 m), phone upright at her hip height',
            'Both feet flat on the floor, weight even on both sides',
            'Shoulders back and down, standing tall',
          ].map((txt, i) => (
            <div key={i} style={{ display: 'flex', alignItems: 'flex-start', gap: 8, marginBottom: 5 }}>
              <span style={{ color: 'var(--gold)', fontSize: 13, lineHeight: 1, marginTop: 2, flex: '0 0 auto' }}>✓</span>
              <span style={{ fontSize: 13, color: 'var(--ink-soft)', lineHeight: 1.4 }}>{txt}</span>
            </div>
          ))}
        </div>
        <div style={{ padding: '10px 20px 14px' }}>
        <button className="btn btn--accent" onClick={() => ctx.go('capture')}>
          <IcCamera size={19} /> Start capturing
        </button>
        {heeft('poses') && (
          <button className="btn btn--ghost" style={{ marginTop: 10 }} onClick={() => ctx.go('poses')}>
            <IcSparkle size={18} /> See pose inspiration
          </button>
        )}
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { Placeholder, WelcomeScreen, PrivacyScreen, SetupScreen, OverviewScreen });
