/* ============================================================
   icons.jsx — minimal geometric line icons (gold stroke)
   ============================================================ */

function Icon({ children, size = 48, stroke = 'currentColor', sw = 1.5 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 48 48" fill="none"
      stroke={stroke} strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
      {children}
    </svg>
  );
}

/* ---- Problem icons ---- */
const IconCommute = (p) => (   /* 出社して押印 — building + arrow */
  <Icon {...p}>
    <rect x="9" y="10" width="18" height="29" rx="1" />
    <path d="M14 16h2M20 16h2M14 22h2M20 22h2M14 28h2M20 28h2" />
    <path d="M27 22h11M27 22l-4-4M27 22l-4 4" />
    <path d="M9 39h30" />
  </Icon>
);
const IconScan = (p) => (      /* 撮って貼って — camera/scan frame */
  <Icon {...p}>
    <path d="M8 16v-3a3 3 0 0 1 3-3h3M40 16v-3a3 3 0 0 0-3-3h-3M8 32v3a3 3 0 0 0 3 3h3M40 32v3a3 3 0 0 0-3 3h-3" />
    <circle cx="24" cy="24" r="7" />
    <path d="M24 21v6M21 24h6" opacity="0" />
    <circle cx="24" cy="24" r="2.4" />
  </Icon>
);
const IconRisk = (p) => (      /* 紛失・偽造リスク — broken shield / warning */
  <Icon {...p}>
    <path d="M24 7l13 5v9c0 8.5-5.5 14-13 16.5C16.5 35 11 29.5 11 21v-9l13-5z" />
    <path d="M24 18v8" />
    <circle cx="24" cy="31" r=".4" />
    <path d="M24 31h0" strokeWidth={p.sw ? p.sw + 1 : 2.5} />
  </Icon>
);

/* ---- Trust icons ---- */
const IconLaw = (p) => (       /* 電子署名法 — balance/scale */
  <Icon {...p}>
    <path d="M24 7v33" />
    <path d="M14 40h20" />
    <path d="M11 14h26" />
    <path d="M24 11a1.6 1.6 0 1 0 0-.1" />
    <path d="M11 14l-5 11h10l-5-11zM6 25a5 5 0 0 0 10 0" />
    <path d="M37 14l-5 11h10l-5-11zM32 25a5 5 0 0 0 10 0" />
  </Icon>
);
const IconTimestamp = (p) => ( /* タイムスタンプ — clock + check */
  <Icon {...p}>
    <circle cx="22" cy="22" r="14" />
    <path d="M22 14v8l5 3" />
    <circle cx="36" cy="36" r="7" fill="none" />
    <path d="M33 36l2 2 4-4" />
  </Icon>
);
const IconLock = (p) => (      /* 暗号化・監査ログ — lock + key dots */
  <Icon {...p}>
    <rect x="11" y="21" width="26" height="18" rx="2" />
    <path d="M16 21v-5a8 8 0 0 1 16 0v5" />
    <circle cx="24" cy="29" r="2.4" />
    <path d="M24 31.4V34" />
  </Icon>
);
const IconShield = (p) => (    /* セキュリティ — shield + check */
  <Icon {...p}>
    <path d="M24 6l15 6v9c0 9.5-6.2 16-15 19-8.8-3-15-9.5-15-19v-9l15-6z" />
    <path d="M17 23l5 5 9-10" />
  </Icon>
);
const IconCloud = (p) => (
  <Icon {...p}>
    <path d="M15 34a8 8 0 0 1-.6-16 11 11 0 0 1 21 3 7 7 0 0 1-1.4 13H15z" />
    <path d="M24 30v-9M24 21l-3 3M24 21l3 3" />
  </Icon>
);

/* ---- small UI glyphs ---- */
const IconCheck = (p) => (<Icon {...p}><path d="M10 25l8 8 20-22" /></Icon>);
const IconArrowR = (p) => (<Icon {...p}><path d="M9 24h30M28 13l11 11-11 11" /></Icon>);
const IconHistory = (p) => (
  <Icon {...p}>
    <path d="M9 24a15 15 0 1 1 4.4 10.6" />
    <path d="M9 34v-7h7" />
    <path d="M24 16v8l6 4" />
  </Icon>
);

Object.assign(window, {
  Icon, IconCommute, IconScan, IconRisk,
  IconLaw, IconTimestamp, IconLock, IconShield, IconCloud,
  IconCheck, IconArrowR, IconHistory,
});
