// PC HOMEPAGE — desktop-scale design for 株式会社IMPACT

function PCPage() {
  const K = window.KB;
  return (
    <div style={{ background: K.navy900, color: K.ink, fontFamily: K.fontSans }} data-screen-label="PC Homepage">
      <PCTopBar />
      <PCHeader />
      <PCHero />
      <PCMethods />
      <PCCategories />
      <PCPrinciples />
      <PCStats />
      <PCForm />
      <PCFooter />
      <KBModals isPC />
    </div>
  );
}

// ── Top utility bar ─────────────────────────────────────
function PCTopBar() {
  const K = window.KB;
  const { Pin, Clock } = window.KBIcon;
  return (
    <div style={{
      background: K.navy900,
      borderBottom: `1px solid rgba(201,169,97,0.12)`,
      padding: '8px 48px',
      display: 'flex', justifyContent: 'space-between', alignItems: 'center',
      fontFamily: K.fontMono, fontSize: 11, letterSpacing: '0.15em',
      color: K.inkMute,
    }}>
      <div style={{ display: 'flex', gap: 24 }}>
        <span style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
          <Pin size={12} color={K.gold} /> 〒544-0002 大阪市生野区小路1-9-20 N-04
        </span>
        <span style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
          <Clock size={12} color={K.gold} /> LINE査定・電話 月〜金（土日・祝日休）
        </span>
      </div>
      <div>大阪府公安委員会許可 · <span style={{ color: K.goldLight }}>第 621118R072427 号</span></div>
    </div>
  );
}

// ── Header ─────────────────────────────────────────────
function PCHeader() {
  const K = window.KB;
  const { Phone, Line } = window.KBIcon;
  const nav = [
    { label: '買取方法', href: '#methods' },
    { label: '対応品目', href: '#categories' },
    { label: 'こだわり', href: '#principles' },
    { label: '会社概要', href: '#form' },
  ];
  return (
    <header style={{
      background: `linear-gradient(180deg, ${K.navy900}, ${K.navy800})`,
      borderBottom: `1px solid rgba(201,169,97,0.2)`,
      padding: '18px 48px',
      display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      position: 'sticky', top: 0, zIndex: 50,
      backdropFilter: 'blur(12px)',
    }}>
      <PCLogo />
      <nav style={{ display: 'flex', gap: 36 }}>
        {nav.map(n => (
          <a key={n.label} href={n.href} style={{
            fontFamily: K.fontSerif, fontWeight: 600, fontSize: 14,
            color: K.ink, textDecoration: 'none', letterSpacing: '0.08em',
            position: 'relative',
          }}>{n.label}</a>
        ))}
      </nav>
      <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
        <div style={{ textAlign: 'right' }}>
          <div style={{
            fontFamily: K.fontMono, fontSize: 9, letterSpacing: '0.22em', color: K.inkMute,
          }}>TEL · 10-18H</div>
          <a href="tel:0644008382" style={{
            fontFamily: K.fontLatin, fontWeight: 500, fontSize: 22,
            color: K.goldLight, letterSpacing: '0.04em', lineHeight: 1,
            whiteSpace: 'nowrap', textDecoration: 'none',
          }}>06-4400-8382</a>
        </div>
        <button onClick={() => window.__openLineQR && window.__openLineQR()} style={{
          height: 48, padding: '0 22px', border: 'none', borderRadius: 2,
          background: '#06C755', color: '#fff',
          fontFamily: K.fontSans, fontWeight: 800, fontSize: 14,
          display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer',
        }}>
          <Line size={18} color="#fff" /> LINE査定
        </button>
        <a href="#form" style={{
          height: 48, padding: '0 22px', border: 'none', borderRadius: 2,
          background: `linear-gradient(180deg, ${K.goldLight}, ${K.gold} 50%, ${K.goldDeep})`,
          color: K.navy900, textDecoration: 'none',
          fontFamily: K.fontSans, fontWeight: 900, fontSize: 14,
          letterSpacing: '0.06em', cursor: 'pointer',
          display: 'flex', alignItems: 'center',
        }}>無料査定</a>
      </div>
    </header>
  );
}

function PCLogo() {
  const K = window.KB;
  return (
    <div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
      <div style={{
        width: 62, height: 62, borderRadius: 4, overflow: 'hidden',
        background: '#0A0F1C',
        border: `1px solid ${K.gold}70`,
        boxShadow: `0 0 18px rgba(201,169,97,0.12)`,
      }}>
        <img src="/legacy/assets/impact-logo.jpg" alt="IMPACT" style={{
          width: '115%', height: '115%', objectFit: 'cover',
          filter: 'contrast(1.08) brightness(1.12)',
          marginLeft: '-7.5%', marginTop: '-7.5%',
        }} />
      </div>
      <div>
        <div style={{
          fontFamily: K.fontSerif, fontWeight: 700, fontSize: 20,
          letterSpacing: '0.1em', color: K.ink, lineHeight: 1,
        }}>買取バンク</div>
        <div style={{
          marginTop: 6,
          fontFamily: K.fontMono, fontSize: 15, letterSpacing: '0.32em', color: K.gold,
          fontWeight: 500,
        }}>IMPACT</div>
      </div>
    </div>
  );
}

// ── Hero ───────────────────────────────────────────────
function PCHero() {
  const K = window.KB;
  const { Sparkle, ArrowRight, Phone, Line } = window.KBIcon;
  const [ripples, setRipples] = React.useState([]);
  const rippleFrameRef = React.useRef(null);

  React.useEffect(() => {
    const cleanupTimer = setInterval(() => {
      const cutoff = Date.now() - 1200;
      setRipples(prev => {
        const next = prev.filter(r => r.createdAt >= cutoff);
        return next.length === prev.length ? prev : next;
      });
    }, 200);

    return () => {
      clearInterval(cleanupTimer);
      if (rippleFrameRef.current !== null) {
        cancelAnimationFrame(rippleFrameRef.current);
      }
    };
  }, []);

  const handleMouseMove = React.useCallback((e) => {
    const rect = e.currentTarget.getBoundingClientRect();
    const x = e.clientX - rect.left;
    const y = e.clientY - rect.top;
    const createdAt = Date.now();
    const id = createdAt + Math.random();

    if (rippleFrameRef.current !== null) {
      cancelAnimationFrame(rippleFrameRef.current);
    }
    rippleFrameRef.current = requestAnimationFrame(() => {
      rippleFrameRef.current = null;
      setRipples(prev => [...prev.slice(-8), { id, x, y, createdAt }]);
    });
  }, []);

  return (
    <section
      onMouseMove={handleMouseMove}
      style={{
        position: 'relative',
        minHeight: 720,
        background: `
          radial-gradient(ellipse 60% 70% at 30% 40%, rgba(201,169,97,0.22), transparent 55%),
          radial-gradient(circle at 85% 70%, rgba(201,169,97,0.12), transparent 40%),
          linear-gradient(180deg, #050B18 0%, #0A1628 70%, #111F36 100%)
        `,
        overflow: 'hidden',
        padding: '80px 80px 80px',
        display: 'grid', gridTemplateColumns: '1.15fr 1fr', gap: 60,
        alignItems: 'center',
      }}>
      {/* ripple layer */}
      {ripples.map(r => (
        <div
          key={r.id}
          style={{
            position: 'absolute',
            left: r.x,
            top: r.y,
            transform: 'translate(-50%, -50%)',
            width: 0,
            height: 0,
            borderRadius: '50%',
            border: '1px solid rgba(201,169,97,0.5)',
            background: 'rgba(201,169,97,0.06)',
            animation: 'kb-ripple 1.2s ease-out forwards',
            pointerEvents: 'none',
            zIndex: 1,
          }}
        />
      ))}
      {/* pinstripe overlay */}
      <div style={{
        position: 'absolute', inset: 0,
        backgroundImage: 'repeating-linear-gradient(90deg, rgba(201,169,97,0.015) 0, rgba(201,169,97,0.015) 1px, transparent 1px, transparent 5px)',
        pointerEvents: 'none',
      }} />
      {/* inner gold frame */}
      <div style={{
        position: 'absolute', top: 36, left: 36, right: 36, bottom: 36,
        border: `1px solid rgba(201,169,97,0.18)`,
        pointerEvents: 'none',
      }}>
        {[[0,0],[1,0],[0,1],[1,1]].map(([x,y], i) => (
          <div key={i} style={{
            position: 'absolute',
            [x ? 'right' : 'left']: -5, [y ? 'bottom' : 'top']: -5,
            width: 10, height: 10, background: K.gold,
          }} />
        ))}
      </div>

      {/* Left */}
      <div style={{ position: 'relative', zIndex: 2 }}>
        <div style={{
          display: 'inline-flex', alignItems: 'center', gap: 10,
          padding: '8px 18px',
          border: `1px solid ${K.gold}40`, borderRadius: 999,
          fontFamily: K.fontMono, fontSize: 10.5,
          letterSpacing: '0.3em', color: K.goldLight,
        }}>
          <span style={{ width: 5, height: 5, background: K.gold, borderRadius: '50%' }} />
          OSAKA · KANSAI · AREA
          <span style={{ width: 5, height: 5, background: K.gold, borderRadius: '50%' }} />
        </div>

        <div className="shimmer-gold" style={{
          marginTop: 24,
          fontFamily: K.fontSerif, fontWeight: 700,
          fontSize: 38, letterSpacing: '0.2em', lineHeight: 1,
        }}>買取バンク IMPACT</div>

        <h1 style={{
          margin: '24px 0 0',
          fontFamily: K.fontSerif, fontWeight: 600,
          fontSize: 80, lineHeight: 1.1, letterSpacing: '0.03em',
          color: K.ink,
        }}>
          お近くの会場で、<br/>
          <span className="shimmer-gold">最高の買取</span>を、<br/>
          その場で。
        </h1>

        <div style={{
          marginTop: 32, display: 'flex', alignItems: 'center', gap: 16,
        }}>
          <div style={{ width: 60, height: 1, background: `linear-gradient(90deg, transparent, ${K.gold})` }} />
          <div style={{ width: 10, height: 10, transform: 'rotate(45deg)', background: K.gold }} />
          <div style={{ width: 60, height: 1, background: `linear-gradient(270deg, ${K.gold}, transparent)` }} />
        </div>

        <p style={{
          marginTop: 28, maxWidth: 520,
          fontFamily: K.fontSerif, fontWeight: 500, fontSize: 17, lineHeight: 2.1,
          letterSpacing: '0.08em', color: 'rgba(232,230,224,0.78)',
        }}>
          スーパー前・ショッピングモール・お祭り会場へ<br/>
          鑑定士がお伺いします。通りがかりに、お気軽にどうぞ。<br/>
          ご自宅への出張買取・LINE査定も承ります。
        </p>

        <div style={{ display: 'flex', gap: 14, marginTop: 36 }}>
          <a href="#form" style={{
            height: 64, padding: '0 32px', border: 'none', borderRadius: 2,
            background: `linear-gradient(180deg, ${K.goldLight}, ${K.gold} 50%, ${K.goldDeep})`,
            color: K.navy900, textDecoration: 'none',
            fontFamily: K.fontSans, fontWeight: 900, fontSize: 16,
            letterSpacing: '0.14em',
            display: 'flex', alignItems: 'center', gap: 12, cursor: 'pointer',
            boxShadow: '0 20px 40px rgba(201,169,97,0.25)',
          }}>
            <Sparkle size={15} color={K.navy900} /> 無料査定をはじめる
            <ArrowRight size={18} color={K.navy900} />
          </a>
          <a href="tel:0644008382" style={{
            height: 64, padding: '0 28px', border: `1px solid ${K.gold}`, borderRadius: 2,
            background: 'rgba(255,255,255,0.02)',
            color: K.goldLight,
            fontFamily: K.fontSans, fontWeight: 800, fontSize: 15,
            display: 'flex', alignItems: 'center', gap: 10, cursor: 'pointer',
            textDecoration: 'none',
          }}>
            <Phone size={16} color={K.goldLight} /> 06-4400-8382
          </a>
        </div>

        {/* Credentials strip */}
        <div style={{
          marginTop: 48, paddingTop: 28,
          borderTop: `1px solid rgba(201,169,97,0.18)`,
          display: 'flex', gap: 48,
        }}>
          {[['査定料','無料'],['出張費','0円'],['営業','月〜金'],['年間査定','12,480点']].map(([k,v]) => (
            <div key={k}>
              <div style={{
                fontFamily: K.fontMono, fontSize: 9.5,
                letterSpacing: '0.22em', color: K.inkMute,
              }}>{k}</div>
              <div style={{
                marginTop: 6,
                fontFamily: K.fontSerif, fontWeight: 700, fontSize: 24,
                color: K.goldLight,
              }}>{v}</div>
            </div>
          ))}
        </div>
      </div>

      {/* Right — LINE QR card */}
      <div style={{ position: 'relative', zIndex: 2, display: 'grid', placeItems: 'center' }}>
        <div style={{
          position: 'relative',
          padding: 40,
          background: `linear-gradient(160deg, ${K.navy700} 0%, ${K.navy800} 100%)`,
          border: `1px solid ${K.gold}50`,
          boxShadow: '0 40px 80px rgba(0,0,0,0.4)',
          maxWidth: 420,
        }}>
          {/* corner dots */}
          {[[0,0],[1,0],[0,1],[1,1]].map(([x,y], i) => (
            <div key={i} style={{
              position: 'absolute',
              [x ? 'right' : 'left']: -4, [y ? 'bottom' : 'top']: -4,
              width: 8, height: 8, background: K.gold,
            }} />
          ))}
          <div style={{ textAlign: 'center' }}>
            <div style={{
              fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.3em', color: '#06C755',
            }}>— LINE · QUICK QUOTE —</div>
            <div style={{
              marginTop: 14,
              fontFamily: K.fontSerif, fontWeight: 700, fontSize: 26,
              color: K.ink, letterSpacing: '0.05em',
            }}>写真を送るだけで、<br/>査定完了。</div>
            <div style={{
              marginTop: 10,
              fontFamily: K.fontSans, fontSize: 12.5,
              color: K.inkDim, letterSpacing: '0.04em',
            }}>査定料無料 · 24時間受付</div>
          </div>

          <div style={{
            marginTop: 24, padding: 16, background: '#fff',
            display: 'grid', placeItems: 'center', position: 'relative',
          }}>
            <img src="/legacy/assets/line-qr.jpg" alt="LINE QR" style={{
              width: 280, height: 280, display: 'block',
            }} />
            {/* gold corners on QR */}
            {[[0,0],[1,0],[0,1],[1,1]].map(([x,y], i) => (
              <div key={i} style={{
                position: 'absolute',
                [x ? 'right' : 'left']: 8, [y ? 'bottom' : 'top']: 8,
                width: 20, height: 20,
                borderTop: y ? 'none' : `2px solid ${K.gold}`,
                borderBottom: y ? `2px solid ${K.gold}` : 'none',
                borderLeft: x ? 'none' : `2px solid ${K.gold}`,
                borderRight: x ? `2px solid ${K.gold}` : 'none',
              }} />
            ))}
          </div>

          <button type="button" onClick={() => window.__openLineQR && window.__openLineQR()} style={{
            marginTop: 20, width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
            padding: '14px 0', border: 'none',
            background: '#06C755', borderRadius: 2,
            fontFamily: K.fontSans, fontWeight: 800, fontSize: 14,
            color: '#fff', cursor: 'pointer',
          }}>
            <Line size={20} color="#fff" /> LINEで友だち追加
          </button>
        </div>
      </div>
    </section>
  );
}

// ── Methods (4 cards in a row) ─────────────────────────
function PCMethods() {
  const K = window.KB;
  const { Chat, Truck, Store, ArrowRight } = window.KBIcon;
  const methods = [
    { n: '01', ja: 'イベント出店買取', en: 'POP-UP EVENT', desc: 'スーパー前・ショッピングモール・お祭り会場などへ鑑定士が出店。ご予約不要、通りがかりでお気軽に。鑑定はその場で完了、ご成約時は現金でお支払いいたします。',         time: '通りがかりOK', badge: 'メイン', Icon: Store, accent: K.gold },
    { n: '02', ja: '出張買取',         en: 'HOME VISIT',   desc: 'ご自宅や指定の場所へ鑑定士がお伺いします。出張費・査定料は完全無料。大量のお品物や、簡易包装のままでもその場でお取り扱い可能です。',          time: '出張費0円',     badge: 'お気軽に', Icon: Truck, accent: K.gold },
    { n: '03', ja: 'LINE査定・申込',   en: 'LINE',         desc: 'LINEの友だち追加後、お品物の写真を送るだけで概算査定をご提示。出店会場のご確認や、出張のご予約もご利用いただけます。',  time: '24時間受付',     badge: '友だち追加', Icon: Chat, accent: '#06C755' },
  ];
  return (
    <section id="methods" style={{ background: K.navy800, padding: '120px 80px 100px' }}>
      <PCSectionHeader kicker="03 METHODS" title="選べる、3つのご利用方法" note="どのご利用方法でも、査定額は同一水準。" />
      <div style={{
        marginTop: 64,
        display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24,
      }}>
        {methods.map((m, i) => {
          const isLine = m.en === 'LINE';
          const featured = i === 0;
          return (
          <article key={m.n} style={{
            position: 'relative',
            padding: '36px 28px 28px',
            background: `linear-gradient(160deg, ${K.navy700}, ${K.navy600})`,
            border: `1px solid ${featured ? K.gold + '80' : 'rgba(201,169,97,0.15)'}`,
            overflow: 'hidden',
            minHeight: 340,
            display: 'flex', flexDirection: 'column',
            boxShadow: featured ? '0 24px 48px rgba(0,0,0,0.35)' : 'none',
          }}>
            <div style={{
              position: 'absolute', top: 14, right: 18,
              fontFamily: K.fontLatin, fontWeight: 400, fontStyle: 'italic',
              fontSize: 92, lineHeight: 1,
              color: 'rgba(201,169,97,0.08)',
            }}>{m.n}</div>

            <div style={{
              position: 'absolute', top: 0, left: 0,
              padding: '6px 14px', background: m.accent, color: featured ? K.navy900 : '#fff',
              fontFamily: K.fontSans, fontSize: 10.5, fontWeight: 800, letterSpacing: '0.14em',
            }}>{m.badge}</div>

            <div style={{
              width: 72, height: 72,
              display: 'grid', placeItems: 'center',
              background: isLine ? 'rgba(6,199,85,0.1)' : 'rgba(201,169,97,0.08)',
              border: `1px solid ${isLine ? '#06C75540' : K.gold + '30'}`,
              marginBottom: 24,
            }}>
              <m.Icon size={34} color={isLine ? '#06C755' : K.gold} />
            </div>

            <div style={{
              fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.22em', color: K.inkMute,
            }}>{m.en}</div>
            <h3 style={{
              margin: '8px 0 0',
              fontFamily: K.fontSerif, fontWeight: 700, fontSize: 28,
              color: K.ink, letterSpacing: '0.04em',
            }}>{m.ja}</h3>
            <p style={{
              margin: '14px 0 0',
              fontFamily: K.fontSans, fontSize: 13.5, lineHeight: 1.85, color: K.inkDim,
            }}>{m.desc}</p>

            <div style={{ flex: 1 }} />

            <div style={{
              marginTop: 20, paddingTop: 18,
              borderTop: '1px dashed rgba(201,169,97,0.2)',
              display: 'flex', alignItems: 'center', justifyContent: 'space-between',
            }}>
              <div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
                <span style={{
                  width: 5, height: 5, borderRadius: '50%', background: m.accent,
                  boxShadow: `0 0 6px ${m.accent}`,
                }} />
                <span style={{
                  fontFamily: K.fontSans, fontSize: 12, fontWeight: 700, letterSpacing: '0.1em',
                  color: isLine ? m.accent : K.goldLight,
                }}>{m.time}</span>
              </div>
              <a href="#form" style={{
                display: 'flex', alignItems: 'center', gap: 6,
                fontFamily: K.fontSans, fontSize: 12, fontWeight: 700, color: K.goldLight,
                textDecoration: 'none',
              }}>
                申込む <ArrowRight size={14} color={K.goldLight} />
              </a>
            </div>
          </article>
          );
        })}
      </div>
    </section>
  );
}

// ── Schedule (event calendar) ──────────────────────────
function PCScheduleSection() {
  const K = window.KB;
  const { Pin, ArrowRight } = window.KBIcon;
  const events = window.KBSchedule;
  const upcoming = events.slice(0, 6);
  const next = events[0];
  return (
    <section style={{
      background: `linear-gradient(180deg, ${K.navy900} 0%, ${K.navy800} 100%)`,
      padding: '120px 80px 100px',
      position: 'relative',
    }}>
      <PCSectionHeader
        kicker="SCHEDULE · MAY 2026"
        title="出店スケジュール"
        note="お近くの会場でお待ちしております。会場でのご査定は完全無料・予約不要。"
      />

      <div style={{
        marginTop: 56,
        display: 'grid', gridTemplateColumns: '1.05fr 1fr', gap: 32,
      }}>
        {/* Left: NEXT event hero card */}
        <article style={{
          position: 'relative',
          padding: '44px 40px',
          background: `
            radial-gradient(ellipse 70% 90% at 20% 30%, rgba(201,169,97,0.22), transparent 60%),
            linear-gradient(160deg, ${K.navy700}, ${K.navy600})`,
          border: `1px solid ${K.gold}80`,
          boxShadow: '0 30px 60px rgba(0,0,0,0.35)',
          display: 'flex', flexDirection: 'column',
        }}>
          {/* corner dots */}
          {[[0,0],[1,0],[0,1],[1,1]].map(([x,y], i) => (
            <div key={i} style={{
              position: 'absolute',
              [x ? 'right' : 'left']: -4, [y ? 'bottom' : 'top']: -4,
              width: 8, height: 8, background: K.gold,
            }} />
          ))}

          <div style={{
            display: 'inline-flex', alignItems: 'center', gap: 10,
            padding: '6px 14px',
            background: '#06C755', color: '#fff', alignSelf: 'flex-start',
            fontFamily: K.fontMono, fontSize: 10, fontWeight: 700, letterSpacing: '0.2em',
          }}>
            <span style={{ width: 6, height: 6, borderRadius: '50%', background: '#fff' }} />
            NEXT POP-UP
          </div>

          <div style={{ marginTop: 28, display: 'flex', alignItems: 'flex-end', gap: 20 }}>
            <div style={{
              fontFamily: K.fontLatin, fontWeight: 300, fontStyle: 'italic',
              fontSize: 140, lineHeight: 0.9, letterSpacing: '-0.04em',
              background: `linear-gradient(180deg, ${K.goldLight}, ${K.gold} 60%, ${K.goldDeep})`,
              WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent',
              backgroundClip: 'text',
            }}>{next.date.split('/')[1]}</div>
            <div style={{ paddingBottom: 18 }}>
              <div style={{
                fontFamily: K.fontMono, fontSize: 11, letterSpacing: '0.3em', color: K.goldLight,
              }}>MAY {next.date.split('/')[0].padStart(2,'0')} · {next.day}曜日</div>
              <div style={{
                marginTop: 8,
                fontFamily: K.fontMono, fontSize: 12, letterSpacing: '0.12em', color: K.inkDim,
              }}>{next.hours}</div>
            </div>
          </div>

          <h3 style={{
            margin: '32px 0 0',
            fontFamily: K.fontSerif, fontWeight: 700, fontSize: 36,
            color: K.ink, letterSpacing: '0.04em', lineHeight: 1.25,
          }}>{next.venue}</h3>
          <div style={{
            marginTop: 10, display: 'flex', alignItems: 'center', gap: 8,
            fontFamily: K.fontSans, fontSize: 15, color: K.inkDim,
          }}>
            <Pin size={14} color={K.gold} />{next.city}
          </div>

          <div style={{ flex: 1 }} />

          <div style={{
            marginTop: 36, paddingTop: 24,
            borderTop: `1px solid ${K.gold}30`,
            display: 'flex', alignItems: 'center', justifyContent: 'space-between',
          }}>
            <div style={{ display: 'flex', gap: 24 }}>
              {[['査定料','無料'],['出張費','0円'],['現金払い','即対応']].map(([k,v]) => (
                <div key={k}>
                  <div style={{
                    fontFamily: K.fontMono, fontSize: 9, letterSpacing: '0.2em', color: K.inkMute,
                  }}>{k}</div>
                  <div style={{
                    marginTop: 4,
                    fontFamily: K.fontSerif, fontWeight: 700, fontSize: 17,
                    color: K.goldLight,
                  }}>{v}</div>
                </div>
              ))}
            </div>
            <button style={{
              height: 48, padding: '0 22px', border: 'none', borderRadius: 2,
              background: `linear-gradient(180deg, ${K.goldLight}, ${K.gold}, ${K.goldDeep})`,
              color: K.navy900,
              fontFamily: K.fontSans, fontWeight: 900, fontSize: 13,
              letterSpacing: '0.12em',
              display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer',
            }}>
              会場地図を見る <ArrowRight size={14} color={K.navy900} />
            </button>
          </div>
        </article>

        {/* Right: upcoming list */}
        <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
          {upcoming.slice(1).map((e, i) => (
            <article key={i} style={{
              display: 'flex', alignItems: 'stretch',
              background: K.navy700,
              border: `1px solid rgba(201,169,97,0.15)`,
              overflow: 'hidden',
              transition: `all 0.25s ${K.ease}`,
              cursor: 'pointer',
            }}
            onMouseEnter={e2 => { e2.currentTarget.style.borderColor = K.gold + '60'; }}
            onMouseLeave={e2 => { e2.currentTarget.style.borderColor = 'rgba(201,169,97,0.15)'; }}
            >
              <div style={{
                flexShrink: 0, width: 96, padding: '16px 0',
                display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
                background: 'rgba(0,0,0,0.2)',
                borderRight: `1px solid rgba(201,169,97,0.18)`,
              }}>
                <div style={{
                  fontFamily: K.fontMono, fontSize: 9, letterSpacing: '0.22em', color: K.inkMute,
                }}>MAY</div>
                <div style={{
                  marginTop: 4,
                  fontFamily: K.fontSerif, fontWeight: 700, fontSize: 30,
                  color: K.ink, lineHeight: 1,
                }}>{e.date.split('/')[1]}</div>
                <div style={{
                  marginTop: 4,
                  fontFamily: K.fontSans, fontSize: 11, color: K.inkDim, letterSpacing: '0.08em',
                }}>({e.day})</div>
              </div>
              <div style={{ flex: 1, padding: '18px 22px', display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
                <div style={{
                  fontFamily: K.fontSerif, fontWeight: 700, fontSize: 17,
                  color: K.ink, letterSpacing: '0.03em',
                }}>{e.venue}</div>
                <div style={{
                  marginTop: 6, display: 'flex', gap: 16, alignItems: 'center',
                  fontFamily: K.fontSans, fontSize: 12, color: K.inkDim,
                }}>
                  <span style={{ display: 'flex', alignItems: 'center', gap: 5 }}>
                    <Pin size={11} color={K.gold} />{e.city}
                  </span>
                  <span style={{ fontFamily: K.fontMono, letterSpacing: '0.1em' }}>{e.hours}</span>
                </div>
              </div>
              <div style={{
                flexShrink: 0, alignSelf: 'center', padding: '0 22px',
                fontFamily: K.fontSans, fontSize: 12, fontWeight: 700, color: K.goldLight,
                display: 'flex', alignItems: 'center', gap: 6,
              }}>
                詳細 <ArrowRight size={13} color={K.goldLight} />
              </div>
            </article>
          ))}
          <div style={{
            marginTop: 6, padding: '18px 20px',
            border: `1px dashed ${K.gold}40`,
            display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10,
            fontFamily: K.fontSans, fontSize: 13, color: K.goldLight, letterSpacing: '0.06em',
          }}>
            全スケジュールを見る <ArrowRight size={14} color={K.goldLight} />
          </div>
        </div>
      </div>
    </section>
  );
}

// ── Categories ─────────────────────────────────────────
function PCCategories() {
  const K = window.KB;
  const cats = (window.KBCATEGORIES || []);
  return (
    <section id="categories" style={{ background: K.navy900, padding: '120px 80px 100px' }}>
      <PCSectionHeader kicker="CATEGORIES" title="幅広く、全て本気で。" note="金貨一枚から、数千万のロレックスまで。" />
      <div style={{
        marginTop: 56,
        display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 18,
      }}>
        {cats.map((c, i) => <PCCatCard key={c.en} c={c} i={i} />)}
      </div>
      <div style={{
        marginTop: 24,
        display: 'flex', justifyContent: 'center', flexWrap: 'wrap', gap: 8,
      }}>
        {[
          { ja: '切手', en: 'Stamp' },
          { ja: '骨董品', en: 'Antique' },
          { ja: '洋酒', en: 'Spirits' },
          { ja: '記念品', en: 'Collectible' },
          { ja: '楽器', en: 'Instrument' },
          { ja: '贈答品', en: 'Gift' },
          { ja: '食器', en: 'Tableware' },
        ].map(({ ja, en }) => (
          <button key={ja} type="button"
            onClick={() => window.__openCategory && window.__openCategory(en)}
            style={{
              padding: '8px 16px',
              border: `0.5px solid ${K.gold}30`,
              fontFamily: K.fontSans, fontSize: 12, color: K.inkDim,
              background: 'transparent', cursor: 'pointer',
            }}>{ja}</button>
        ))}
      </div>
    </section>
  );
}

function PCCatCard({ c, i }) {
  const K = window.KB;
  const open = () => window.__openCategory && window.__openCategory(c.en);
  return (
    <article onClick={open} style={{
      position: 'relative',
      height: 220,
      padding: 28,
      background: `linear-gradient(135deg, ${K.navy600}, ${K.navy700})`,
      border: `1px solid rgba(201,169,97,0.15)`,
      overflow: 'hidden',
      cursor: 'pointer',
      transition: `all 0.3s ${K.ease}`,
      display: 'flex', flexDirection: 'column', justifyContent: 'space-between',
    }}
    onMouseEnter={e => { e.currentTarget.style.borderColor = K.gold + '80'; e.currentTarget.style.transform = 'translateY(-4px)'; }}
    onMouseLeave={e => { e.currentTarget.style.borderColor = 'rgba(201,169,97,0.15)'; e.currentTarget.style.transform = 'translateY(0)'; }}
    >
      <PCMotif kind={c.motif || c.m} color={K.gold} />
      <div style={{ position: 'relative', zIndex: 2 }}>
        <div style={{
          fontFamily: K.fontLatin, fontWeight: 400, fontStyle: 'italic',
          fontSize: 24, color: K.gold, letterSpacing: '0.1em',
        }}>{String(i+1).padStart(2,'0')}</div>
      </div>
      <div style={{ position: 'relative', zIndex: 2 }}>
        <div style={{
          fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.22em', color: K.goldLight,
          textTransform: 'uppercase',
        }}>{c.en}</div>
        <div style={{
          marginTop: 6,
          fontFamily: K.fontSerif, fontWeight: 700, fontSize: 26,
          color: K.ink, letterSpacing: '0.04em',
        }}>{c.ja}</div>
        {c.sub && <div style={{
          marginTop: 6,
          fontFamily: K.fontSans, fontSize: 12, color: K.inkDim, letterSpacing: '0.02em',
        }}>{c.sub}</div>}
      </div>
    </article>
  );
}

function PCMotif({ kind, color }) {
  const common = { position: 'absolute', right: 20, top: 20, opacity: 0.5 };
  const s = 140;
  const motifs = {
    watch:  <svg width={s} height={s} viewBox="0 0 140 140" style={common}><circle cx="70" cy="70" r="42" fill="none" stroke={color} strokeWidth="1.4"/><circle cx="70" cy="70" r="28" fill="none" stroke={color} strokeWidth="0.8" opacity="0.5"/><line x1="70" y1="45" x2="70" y2="70" stroke={color} strokeWidth="1.5"/><line x1="70" y1="70" x2="90" y2="75" stroke={color} strokeWidth="1.5"/></svg>,
    watch2: <svg width={s} height={s} viewBox="0 0 140 140" style={common}><rect x="45" y="30" width="50" height="80" rx="6" fill="none" stroke={color} strokeWidth="1.4"/><circle cx="70" cy="70" r="3" fill={color}/></svg>,
    bar:    <svg width={s} height={s} viewBox="0 0 140 140" style={common}><polygon points="30,50 110,50 120,90 20,90" fill="none" stroke={color} strokeWidth="1.4"/><text x="70" y="77" textAnchor="middle" fontFamily="serif" fontSize="12" fontStyle="italic" fill={color}>999.9</text></svg>,
    gem:    <svg width={s} height={s} viewBox="0 0 140 140" style={common}><polygon points="70,25 110,55 95,105 45,105 30,55" fill="none" stroke={color} strokeWidth="1.4"/><line x1="30" y1="55" x2="110" y2="55" stroke={color} strokeWidth="0.8" opacity="0.5"/><line x1="70" y1="25" x2="70" y2="105" stroke={color} strokeWidth="0.8" opacity="0.5"/></svg>,
    bag:    <svg width={s} height={s} viewBox="0 0 140 140" style={common}><path d="M30 55 Q30 35 55 35 L85 35 Q110 35 110 55 L110 110 L30 110 Z" fill="none" stroke={color} strokeWidth="1.4"/><path d="M50 50 Q50 25 70 25 Q90 25 90 50" fill="none" stroke={color} strokeWidth="1"/></svg>,
    cam:    <svg width={s} height={s} viewBox="0 0 140 140" style={common}><rect x="25" y="50" width="90" height="60" rx="4" fill="none" stroke={color} strokeWidth="1.4"/><circle cx="70" cy="80" r="20" fill="none" stroke={color} strokeWidth="1.2"/><circle cx="70" cy="80" r="10" fill="none" stroke={color} strokeWidth="0.8"/></svg>,
    card:   <svg width={s} height={s} viewBox="0 0 140 140" style={common}><rect x="30" y="45" width="80" height="50" rx="3" fill="none" stroke={color} strokeWidth="1.4" transform="rotate(-5 70 70)"/></svg>,
    coin:   <svg width={s} height={s} viewBox="0 0 140 140" style={common}><circle cx="55" cy="75" r="28" fill="none" stroke={color} strokeWidth="1.4"/><circle cx="85" cy="55" r="22" fill="none" stroke={color} strokeWidth="1.2"/><text x="55" y="80" textAnchor="middle" fontFamily="serif" fontSize="16" fontWeight="700" fill={color}>圓</text></svg>,
    kimono: <svg width={s} height={s} viewBox="0 0 140 140" style={common}><path d="M70 25 L35 60 L35 115 L70 110 L105 115 L105 60 Z" fill="none" stroke={color} strokeWidth="1.4"/><line x1="70" y1="25" x2="70" y2="110" stroke={color} strokeWidth="1"/></svg>,
  };
  return motifs[kind] || null;
}

// ── Principles (3) ─────────────────────────────────────
function PCPrinciples() {
  const K = window.KB;
  const { Shield, Scale, Bolt } = window.KBIcon;
  const ps = [
    { num: '壱', icon: Shield, title: '信頼 · 安心 · 安全', en: 'TRUST & SAFETY',
      body: '株式会社として法人登記。大阪府公安委員会許可のもと、お客様の大切なお品物を安全・安心にお預かりいたします。' },
    { num: '弐', icon: Scale, title: '透明な鑑定', en: 'TRANSPARENT',
      body: '査定根拠を一点ずつご説明。市場相場・状態・希少性。全て開示した上で、納得いただける査定額を。' },
    { num: '参', icon: Bolt, title: '最高の買取額', en: 'BEST OFFER',
      body: '他社査定書お持込で必ず上回る額を。仲介を挟まない直買取だからこそ実現できる価格設定です。' },
  ];
  return (
    <section id="principles" style={{ background: K.navy800, padding: '120px 80px' }}>
      <PCSectionHeader kicker="OUR PRINCIPLES" title="三つの、こだわり。" note="株式会社IMPACTが選ばれる理由。" />
      <div style={{
        marginTop: 72,
        display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 28,
      }}>
        {ps.map((p, i) => (
          <article key={p.num} style={{
            position: 'relative',
            padding: '44px 36px 36px',
            background: i === 1
              ? `linear-gradient(135deg, rgba(201,169,97,0.08), rgba(201,169,97,0.02))`
              : K.navy700,
            border: `1px solid ${i === 1 ? K.gold + '60' : 'rgba(201,169,97,0.15)'}`,
          }}>
            <div style={{
              position: 'absolute', top: -18, left: 36,
              padding: '6px 18px',
              background: K.navy900, border: `1px solid ${K.gold}`,
              fontFamily: K.fontSerif, fontWeight: 700, fontSize: 17,
              color: K.gold, letterSpacing: '0.12em',
            }}>其の {p.num}</div>
            <div style={{
              width: 76, height: 76, display: 'grid', placeItems: 'center',
              background: 'rgba(201,169,97,0.06)',
              border: `1px solid ${K.gold}30`,
              marginBottom: 24,
            }}>
              <p.icon size={40} color={K.gold} />
            </div>
            <div style={{ fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.25em', color: K.goldLight }}>{p.en}</div>
            <h3 style={{
              margin: '8px 0 14px',
              fontFamily: K.fontSerif, fontWeight: 700, fontSize: 28,
              color: K.ink, letterSpacing: '0.04em',
            }}>{p.title}</h3>
            <p style={{
              margin: 0,
              fontFamily: K.fontSans, fontSize: 14, lineHeight: 1.95, color: K.inkDim,
            }}>{p.body}</p>
          </article>
        ))}
      </div>
    </section>
  );
}

// ── Stats ──────────────────────────────────────────────
function PCStats() {
  const K = window.KB;
  const stats = [
    { num: '12,480', unit: '点', label: '年間査定実績', en: 'APPRAISED / YR' },
    { num: '98.2', unit: '%', label: 'ご成約率', en: 'CONVERSION' },
    { num: '261', unit: '日', label: '年間営業日数', en: 'BUSINESS DAYS' },
    { num: '¥0', unit: '',  label: '出張・査定料', en: 'NO FEES' },
  ];
  return (
    <section style={{
      position: 'relative', padding: '100px 80px',
      background: `radial-gradient(ellipse 80% 50% at 50% 50%, rgba(201,169,97,0.15), transparent 60%), #050B18`,
    }}>
      <div style={{ position: 'absolute', top: 36, left: 36, right: 36, bottom: 36, border: `1px solid ${K.gold}30`, pointerEvents: 'none' }} />
      <div style={{ position: 'relative', textAlign: 'center' }}>
        <div style={{ fontFamily: K.fontMono, fontSize: 10.5, letterSpacing: '0.3em', color: K.gold }}>— THE NUMBERS —</div>
        <h2 style={{ margin: '14px 0 0', fontFamily: K.fontSerif, fontWeight: 700, fontSize: 42, color: K.ink, letterSpacing: '0.06em' }}>
          数字が、証明する。
        </h2>
      </div>
      <div style={{ position: 'relative', marginTop: 64, display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 40 }}>
        {stats.map(s => (
          <div key={s.label} style={{ textAlign: 'center' }}>
            <div style={{
              fontFamily: K.fontLatin, fontWeight: 500, fontStyle: 'italic',
              fontSize: 10, color: K.inkMute, letterSpacing: '0.32em',
            }}>{s.en}</div>
            <div style={{
              marginTop: 10,
              display: 'flex', alignItems: 'baseline', justifyContent: 'center', gap: 6,
              fontFamily: K.fontLatin, fontWeight: 500,
              background: `linear-gradient(180deg, ${K.goldLight}, ${K.gold})`,
              WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent', backgroundClip: 'text',
            }}>
              <span style={{ fontSize: 84, lineHeight: 1 }}>{s.num}</span>
              <span style={{ fontSize: 28, fontFamily: K.fontSerif }}>{s.unit}</span>
            </div>
            <div style={{
              marginTop: 10,
              fontFamily: K.fontSans, fontSize: 13, fontWeight: 700, color: K.ink, letterSpacing: '0.12em',
            }}>{s.label}</div>
          </div>
        ))}
      </div>
    </section>
  );
}

// ── Form ───────────────────────────────────────────────
function PCForm() {
  const K = window.KB;
  const { Sparkle, ArrowRight, Line, Check } = window.KBIcon;
  const MAIL_TO = 'impact.value.japan@gmail.com';
  const [cats, setCats] = React.useState(['ロレックス']);
  const [name, setName] = React.useState('');
  const [tel, setTel] = React.useState('');
  const [detail, setDetail] = React.useState('');
  const [agreed, setAgreed] = React.useState(false);
  const [submitError, setSubmitError] = React.useState('');
  const [isSubmitting, setIsSubmitting] = React.useState(false);
  const [cur, setCur] = React.useState({ x: -200, y: -200, visible: false });
  const onCursorMove = React.useCallback((e) => setCur({ x: e.clientX, y: e.clientY, visible: true }), []);
  const onCursorLeave = React.useCallback(() => setCur(p => ({ ...p, visible: false })), []);
  const CATS = ['ロレックス','高級時計','金・貴金属','宝飾品','ブランドバッグ','カメラ','テレカ','古銭','着物','洋酒','骨董品','その他'];
  const toggleCat = (c) => setCats(prev => prev.includes(c) ? prev.filter(x => x !== c) : [...prev, c]);
  const submit = async (e) => {
    e.preventDefault();
    setSubmitError('');
    setIsSubmitting(true);

    try {
      const response = await fetch('/api/inquiries', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          name,
          phone: tel,
          category: cats.join('、') || undefined,
          message: detail || '（特記なし）',
        }),
      });

      if (!response.ok) {
        const data = await response.json().catch(() => null);
        setSubmitError(data?.error || '送信に失敗しました。時間をおいて再度お試しください。');
        return;
      }

      window.location.href = '/inquiry-complete';
    } catch {
      setSubmitError('送信に失敗しました。通信環境をご確認ください。');
    } finally {
      setIsSubmitting(false);
    }
  };
  const canSubmit = agreed && !isSubmitting;

  const inp = {
    width: '100%', height: 56, padding: '0 18px', marginTop: 10,
    background: '#fff', border: '1px solid rgba(26,26,26,0.12)', borderRadius: 2,
    fontFamily: K.fontSans, fontSize: 15, color: K.charcoal, outline: 'none', boxSizing: 'border-box',
  };
  const lbl = { fontFamily: K.fontSans, fontSize: 13, fontWeight: 700, color: K.charcoal, letterSpacing: '0.04em', display: 'flex', alignItems: 'center', gap: 8 };
  const req = <span style={{ padding: '2px 7px', background: K.gold, color: K.navy900, fontFamily: K.fontMono, fontSize: 9, fontWeight: 700, letterSpacing: '0.1em' }}>必須</span>;

  return (
    <section id="form" style={{ background: K.bone, color: K.charcoal, padding: '0', position: 'relative', cursor: 'none' }}
      onMouseMove={onCursorMove} onMouseLeave={onCursorLeave}>
      {cur.visible && (
        <div style={{ position: 'fixed', left: cur.x, top: cur.y, transform: 'translate(-50%,-50%)', pointerEvents: 'none', zIndex: 9999 }}>
          <div style={{ position: 'absolute', width: 22, height: 22, borderRadius: '50%', border: '1.5px solid rgba(80,80,80,0.5)', transform: 'translate(-50%,-50%)' }} />
          <div style={{ position: 'absolute', width: 6, height: 6, borderRadius: '50%', background: '#1A1A1A', transform: 'translate(-50%,-50%)' }} />
        </div>
      )}
      <div style={{ height: 8, background: `linear-gradient(90deg, ${K.gold}, ${K.goldLight}, ${K.gold})` }} />
      <div style={{ padding: '100px 80px', display: 'grid', gridTemplateColumns: '1fr 1.2fr', gap: 80, alignItems: 'start' }}>
        {/* Left — copy + QR */}
        <div>
          <div style={{ fontFamily: K.fontMono, fontSize: 10.5, letterSpacing: '0.3em', color: K.goldDeep }}>— FREE APPRAISAL —</div>
          <h2 style={{ margin: '14px 0 0', fontFamily: K.fontSerif, fontWeight: 700, fontSize: 48, color: K.charcoal, letterSpacing: '0.04em', lineHeight: 1.3 }}>
            無料査定、<br/>承ります。
          </h2>
          <p style={{ marginTop: 16, fontFamily: K.fontSans, fontSize: 14, color: 'rgba(26,26,26,0.6)', lineHeight: 1.9 }}>
            30秒でかんたん入力。<br/>
            LINEなら、写真を送るだけで査定完了です。
          </p>

          <div style={{
            marginTop: 36, padding: 24,
            background: '#fff', border: `1px solid ${K.gold}50`,
            display: 'flex', gap: 20, alignItems: 'center',
          }}>
            <img src="/legacy/assets/line-qr.jpg" alt="LINE QR" style={{ width: 140, height: 140, objectFit: 'cover', flexShrink: 0 }} />
            <div>
              <div style={{ fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.22em', color: '#06C755' }}>SCAN TO CHAT</div>
              <div style={{ marginTop: 6, fontFamily: K.fontSerif, fontWeight: 700, fontSize: 20, color: K.charcoal, letterSpacing: '0.04em' }}>LINEで友だち追加</div>
              <div style={{ marginTop: 8, fontFamily: K.fontSans, fontSize: 12, lineHeight: 1.7, color: 'rgba(26,26,26,0.6)' }}>
                QRコードを読み取って、<br/>写真を送るだけで査定いたします。
              </div>
            </div>
          </div>

          <div style={{
            marginTop: 24, padding: '20px 24px',
            background: K.navy900, color: K.ink,
          }}>
            <div style={{ fontFamily: K.fontMono, fontSize: 9.5, letterSpacing: '0.25em', color: K.goldLight }}>TEL · 10:00 - 18:00</div>
            <a href="tel:0644008382" style={{ marginTop: 6, fontFamily: K.fontLatin, fontWeight: 500, fontSize: 34, color: K.goldLight, letterSpacing: '0.04em', lineHeight: 1, textDecoration: 'none', display: 'block' }}>
              06-4400-8382
            </a>
          </div>
        </div>

        {/* Right — form */}
        <form onSubmit={submit}>
          <div>
            <div style={lbl}>お品物カテゴリ
              <span style={{ padding: '2px 7px', background: 'rgba(201,169,97,0.15)', color: K.goldDeep, fontFamily: K.fontMono, fontSize: 9, fontWeight: 700, letterSpacing: '0.08em', border: `1px solid ${K.gold}40` }}>複数選択可</span>
            </div>
            <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 12 }}>
              {CATS.map(c => {
                const on = cats.includes(c);
                return (
                  <button type="button" key={c} onClick={() => toggleCat(c)} style={{
                    padding: '12px 18px', border: 'none',
                    background: on ? K.navy900 : '#fff',
                    color: on ? K.goldLight : K.charcoal,
                    fontFamily: K.fontSans, fontSize: 13, fontWeight: on ? 700 : 500,
                    letterSpacing: '0.04em', borderRadius: 2, cursor: 'pointer',
                    boxShadow: on ? 'none' : 'inset 0 0 0 1px rgba(26,26,26,0.12)',
                    display: 'inline-flex', alignItems: 'center', gap: 6,
                  }}>
                    {on && <Check size={11} color={K.goldLight} />}
                    {c}
                  </button>
                );
              })}
            </div>
          </div>

          <div style={{ marginTop: 28, display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
            <div>
              <div style={lbl}>お名前 {req}</div>
              <input required value={name} onChange={e => setName(e.target.value)} style={inp} placeholder="山田 太郎" />
            </div>
            <div>
              <div style={lbl}>お電話番号 {req}</div>
              <input required value={tel} onChange={e => setTel(e.target.value)} inputMode="tel" style={inp} placeholder="090-0000-0000" />
            </div>
          </div>

          <div style={{ marginTop: 16 }}>
            <div style={lbl}>お品物について（任意）</div>
            <textarea rows={4} value={detail} onChange={e => setDetail(e.target.value)} placeholder="メーカー・型番・ご購入時期など、わかる範囲でご記入ください。" style={{ ...inp, height: 'auto', padding: '16px 18px', resize: 'none', fontFamily: K.fontSans }} />
          </div>

          <label style={{
            marginTop: 20, display: 'flex', alignItems: 'flex-start', gap: 12,
            padding: '16px 18px', cursor: 'pointer',
            background: 'rgba(201,169,97,0.08)', border: `1px solid ${K.gold}50`,
          }}>
            <input type="checkbox" checked={agreed} onChange={e => setAgreed(e.target.checked)}
              style={{ position: 'absolute', opacity: 0, width: 1, height: 1, margin: -1 }} />
            <div aria-hidden="true" style={{ flexShrink: 0, width: 20, height: 20, marginTop: 1, background: agreed ? K.navy900 : 'transparent', border: agreed ? 'none' : `2px solid ${K.gold}80`, display: 'grid', placeItems: 'center' }}>
              {agreed && <Check size={13} color={K.goldLight} />}
            </div>
            <div style={{ fontFamily: K.fontSans, fontSize: 12.5, lineHeight: 1.75, color: 'rgba(26,26,26,0.72)' }}>
              <a href="/legal/privacy" target="_blank" rel="noopener noreferrer" onClick={e => e.stopPropagation()} style={{ color: K.goldLight, textDecoration: 'underline' }}>プライバシーポリシー</a>に同意します。入力情報は査定の目的以外には使用いたしません。
            </div>
          </label>

          <button type="submit" disabled={!canSubmit} style={{
            marginTop: 24, width: '100%', height: 68, border: 'none', borderRadius: 2,
            background: `linear-gradient(180deg, ${K.navy700}, ${K.navy900})`,
            color: K.goldLight,
            fontFamily: K.fontSans, fontWeight: 900, fontSize: 16, letterSpacing: '0.14em',
            display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 12,
            cursor: canSubmit ? 'pointer' : 'not-allowed', opacity: canSubmit ? 1 : 0.45,
            boxShadow: canSubmit ? '0 20px 40px rgba(10,22,40,0.25)' : 'none',
          }}>
            <Sparkle size={15} color={K.goldLight} /> {isSubmitting ? '送信中...' : '無料査定を依頼する'} <ArrowRight size={18} color={K.goldLight} />
          </button>
          {submitError && (
            <div role="alert" style={{
              marginTop: 14, textAlign: 'center',
              fontFamily: K.fontSans, fontSize: 13, fontWeight: 700,
              color: '#9b1c1c', lineHeight: 1.6,
            }}>
              {submitError}
            </div>
          )}
          <div style={{ marginTop: 12, textAlign: 'center', fontFamily: K.fontMono, fontSize: 10, color: 'rgba(26,26,26,0.5)', letterSpacing: '0.18em' }}>
            送信先 · {MAIL_TO}
          </div>
        </form>
      </div>
    </section>
  );
}

// ── Footer ─────────────────────────────────────────────
function PCFooter() {
  const K = window.KB;
  return (
    <footer style={{ background: K.navy900, padding: '80px 80px 36px', color: K.inkDim }}>
      <div style={{ display: 'grid', gridTemplateColumns: '1.3fr 1fr 1fr 1fr', gap: 60 }}>
        <div>
          <PCLogo />
          <p style={{ marginTop: 22, fontFamily: K.fontSans, fontSize: 12.5, lineHeight: 1.95, color: K.inkDim }}>
            時計・宝飾品商として大阪府公安委員会許可のもと、<br/>
            法令遵守で営業する、高価買取の専門会社です。
          </p>
        </div>
        <FooterCol title="ご利用方法" links={[
          { label: 'イベント出店買取', href: '#methods' },
          { label: '出張買取', href: '#methods' },
          { label: 'LINE査定・申込', onClick: () => window.__openLineQR && window.__openLineQR() },
        ]} />
        <FooterCol title="対応品目" links={[
          { label: 'ロレックス', onClick: () => window.__openCategory && window.__openCategory('Rolex') },
          { label: '高級時計', onClick: () => window.__openCategory && window.__openCategory('Luxury Watch') },
          { label: '金・貴金属', onClick: () => window.__openCategory && window.__openCategory('Gold · Metal') },
          { label: '宝飾品', onClick: () => window.__openCategory && window.__openCategory('Jewelry') },
          { label: 'ブランドバッグ', onClick: () => window.__openCategory && window.__openCategory('Designer Bag') },
          { label: 'カメラ', onClick: () => window.__openCategory && window.__openCategory('Camera') },
          { label: '古銭', onClick: () => window.__openCategory && window.__openCategory('Old Coin') },
          { label: '着物', onClick: () => window.__openCategory && window.__openCategory('Kimono') },
        ]} />
        <div>
          <div style={{ fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.25em', color: K.goldLight }}>HEAD OFFICE</div>
          <div style={{ marginTop: 16, fontFamily: K.fontSans, fontSize: 12.5, lineHeight: 2, color: K.ink }}>
            〒544-0002 大阪府大阪市生野区<br/>小路一丁目9番20号 N-04<br/>
            <a href="tel:0644008382" style={{ fontFamily: K.fontLatin, fontSize: 18, color: K.goldLight, letterSpacing: '0.03em', textDecoration: 'none' }}>06-4400-8382</a><br/>
            LINE査定・申込 24時間受付<br/>電話受付 月〜金 10:00〜18:00<br/>土日・祝日・GW・盆休み・年末年始休業
          </div>
        </div>
      </div>
      <div style={{
        marginTop: 48, padding: '18px 0',
        borderTop: `1px solid rgba(201,169,97,0.15)`,
        display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.22em', color: K.inkMute,
      }}>
        <span>© 2026 IMPACT CO.,LTD · ALL RIGHTS RESERVED</span>
        <span style={{ display: 'flex', gap: 20, alignItems: 'center' }}>
          <a href="/legal/tokusho" target="_blank" rel="noopener noreferrer" style={{ color: K.inkMute, textDecoration: 'none' }}>特定商取引法に基づく表示</a>
          <span style={{ opacity: 0.3 }}>|</span>
          <a href="/legal/privacy" target="_blank" rel="noopener noreferrer" style={{ color: K.inkMute, textDecoration: 'none' }}>プライバシーポリシー</a>
          <span style={{ opacity: 0.3 }}>|</span>
          <span>大阪府公安委員会許可 · 第 621118R072427 号</span>
        </span>
      </div>
    </footer>
  );
}

function FooterCol({ title, links }) {
  const K = window.KB;
  const itemStyle = {
    display: 'block', width: '100%', padding: '8px 0',
    fontFamily: K.fontSerif, fontSize: 13.5, color: K.ink,
    textDecoration: 'none', background: 'none',
    border: 'none', borderBottom: '1px solid rgba(201,169,97,0.08)',
    textAlign: 'left', cursor: 'pointer',
  };
  return (
    <div>
      <div style={{ fontFamily: K.fontMono, fontSize: 10, letterSpacing: '0.25em', color: K.goldLight }}>{title.toUpperCase()}</div>
      <div style={{ marginTop: 16 }}>
        {links.map(link => link.onClick
          ? <button key={link.label} type="button" onClick={link.onClick} style={itemStyle}>{link.label}</button>
          : <a key={link.label} href={link.href} style={itemStyle}>{link.label}</a>
        )}
      </div>
    </div>
  );
}

// ── Shared ─────────────────────────────────────────────
function PCSectionHeader({ kicker, title, note }) {
  const K = window.KB;
  return (
    <div style={{ textAlign: 'center' }}>
      <div style={{
        display: 'inline-flex', alignItems: 'center', gap: 10,
        fontFamily: K.fontMono, fontSize: 10.5, letterSpacing: '0.3em', color: K.gold,
      }}>
        <span style={{ width: 24, height: 1, background: K.gold }} />
        {kicker}
        <span style={{ width: 24, height: 1, background: K.gold }} />
      </div>
      <h2 style={{
        margin: '20px 0 0',
        fontFamily: K.fontSerif, fontWeight: 700, fontSize: 48,
        lineHeight: 1.3, color: K.ink, letterSpacing: '0.04em',
      }}>{title}</h2>
      {note && (
        <div style={{ marginTop: 14, fontFamily: K.fontSans, fontSize: 15, color: K.inkDim }}>{note}</div>
      )}
    </div>
  );
}

window.PCPage = PCPage;
