// ─────────────────────────────────────────────
//  K-Trust · 보험 계약 구조 · 과세와 비과세를 가르는 자리
//  · 계약자·피보험자·수익자 3자 관계에 따른 4가지 구조 매트릭스
//  · 실질과세 원칙 안내 + K-Trust 정통 방식 + 함정 케이스
// ─────────────────────────────────────────────
const Insurance = () => {
  const structures = [
    {
      n: '01',
      label: 'STRUCTURE 01',
      title: '피상속인 = 계약자 · 피보험자',
      contractor: '피상속인 (부모)',
      insured: '피상속인 (부모)',
      beneficiary: '상속인 (자녀/배우자)',
      status: 'taxable',       // taxable · exempt · gift · risk
      statusLabel: '상속세 과세',
      reason: '피상속인의 자금으로 형성된 재산이 상속인에게 이전 · 간주상속재산 포함',
    },
    {
      n: '02',
      label: 'STRUCTURE 02 · 최적',
      title: '자력 있는 계약자 = 수익자',
      contractor: '수익자 본인 (자녀/배우자 · 자력 소득 입증)',
      insured: '피상속인 (부모)',
      beneficiary: '계약자와 동일',
      status: 'exempt',
      statusLabel: '비과세',
      reason: '본인이 납입한 보험료를 본인이 수령 · 상속세 및 증여세 모두 비과세',
      isBest: true,
    },
    {
      n: '03',
      label: 'STRUCTURE 03',
      title: '납입자 ≠ 수령자 · 타인을 위한 보험',
      contractor: '부모 (A)',
      insured: '부모 (A)',
      beneficiary: '자녀 (B)',
      status: 'gift',
      statusLabel: '증여세 부과',
      reason: '납입자와 수령자가 다른 타인을 위한 보험 구조 · 보험금 수령 시점 증여의제',
    },
    {
      n: '04',
      label: 'STRUCTURE 04',
      title: '자녀 명의만 계약자 · 실질은 부모',
      contractor: '소득 없는 자녀 (명의만)',
      insured: '부모',
      beneficiary: '자녀',
      status: 'risk',
      statusLabel: '과세 대상 · 세금 리스크',
      reason: '자녀에게 소득원천이 없어 실질은 부모 납입으로 판정 시 상속·증여세 재판단',
    },
  ];

  return (
    <section className="insurance-section paper-2" id="insurance">
      <div className="container">
        <div className="section-head reveal">
          <div className="eyebrow">Insurance Structure · Tax Design</div>
          <h2 className="section-title">
            보험 계약 구조 ·<br/>
            <span style={{color: 'var(--gold-soft)'}}>과세와 비과세를 가르는 자리</span>
          </h2>
          <p className="section-desc">
            같은 보험금이라도 <strong>계약자·피보험자·수익자</strong>의 관계에 따라
            상속세·증여세·비과세가 완전히 달라집니다.
            부동산 자산가에게 <em>세금을 지키는 마지막 방어선</em>이 이 구조 설계입니다.
          </p>
        </div>

        {/* ─── 4구조 매트릭스 ─── */}
        <div className="struct-grid reveal">
          {structures.map((s, i) => (
            <article key={s.n} className={`struct-card struct-${s.status} ${s.isBest ? 'is-best' : ''}`}>
              {s.isBest && (
                <div className="struct-best">✦ 최적의 절세 구조</div>
              )}
              <div className="struct-lbl mono">{s.label}</div>
              <h3 className="struct-title serif">{s.title}</h3>

              <div className="struct-body">
                <div className="struct-row">
                  <span className="struct-role mono">계약자</span>
                  <span className="struct-name">{s.contractor}</span>
                </div>
                <div className="struct-row">
                  <span className="struct-role mono">피보험자</span>
                  <span className="struct-name">{s.insured}</span>
                </div>
                <div className="struct-row">
                  <span className="struct-role mono">수익자</span>
                  <span className="struct-name">{s.beneficiary}</span>
                </div>
              </div>

              <div className={`struct-status status-${s.status}`}>
                {s.statusLabel}
              </div>
              <p className="struct-reason">{s.reason}</p>
            </article>
          ))}
        </div>

        {/* ⚠️ 3원칙 인사이트 카드 · 삭제 (교수님 지시 2026-08-21)
             이유: 사례 섹션의 "국세청 조사에도 흔들리지 않는 3원칙"과 중복
             필요시 아래 주석만 해제하면 부활 가능
        <div className="insurance-principles reveal">
          <div className="ip-header">
            <div className="ip-eyebrow mono">K-Trust Advisory · 3 Principles</div>
            <div className="ip-title serif">
              자문의 격은 <em>구조를 정돈하는 힘</em>에서 나옵니다
            </div>
          </div>
          ... (원칙 1·2·3 카드)
        </div>
        */}

        {/* ─── CTA ─── */}
        <div className="insurance-cta reveal">
          <p className="ic-quote serif">
            "K-Trust는<br/>
            <em>자산 구조와 보험 계약 구조</em>를<br/>
            함께 정돈해,<br/>
            <strong>세금이 새어나가지 않도록 설계</strong>합니다."
          </p>
          <a href="diagnose.html" className="btn btn-primary">
            내 자산 구조 진단받기 <span className="arrow">→</span>
          </a>
        </div>
      </div>
    </section>
  );
};

Object.assign(window, { Insurance });
