/* Fyscal Website UI Kit — icons.
   Semantic icons render the official Fyscal BRAND icon set (two-tone SVGs in
   assets/icons/). Directional / UI glyphs (arrows, chevrons, close, check,
   hamburger, dots) stay as inline strokes so they tint and rotate. */
const SIcon = ({ size = 24, sw = 1.75, children, fill = 'none', ...rest }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill} stroke="currentColor"
       strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" {...rest}>{children}</svg>
);
/* Brand-icon factory: renders assets/icons/icon-NN.svg. Auto-inverts to white
   when a light color is requested via stroke/color (for dark/coloured panels). */
const BIcon = (num) => {
  const id = String(num).padStart(2, '0');
  return ({ size = 24, stroke, color, style, sw, fill, ...rest }) => {
    const c = String(stroke || color || '');
    const light = /#fff\b|#ffffff|white|255,\s*255,\s*255|rgba\(\s*255/i.test(c);
    return (
      <img src={"assets/icons/icon-" + id + ".svg"} width={size} height={size} alt="" aria-hidden="true"
        style={{ display: 'inline-block', verticalAlign: 'middle', objectFit: 'contain',
          ...(light ? { filter: 'brightness(0) invert(1)' } : {}), ...style }} {...rest} />
    );
  };
};
const SIcons = {
  /* ── Brand icons (official Fyscal set) ── */
  bolt:    BIcon(29),  // lightning — speed / rapid deployment
  shield:  BIcon(21),  // shield check — compliance / security
  globe:   BIcon(57),  // globe — scale / global
  card:    BIcon(13),  // card — digital banking / payments
  swap:    BIcon(30),  // exchange arrows — integration / flexibility
  chart:   BIcon(24),  // growth chart — growth / scale
  lock:    BIcon(22),  // lock — privacy / AML
  users:   BIcon(43),  // people — team / customers
  api:     BIcon(65),  // code brackets — API / integration
  star:    BIcon(56),  // star — featured / differentiation
  home:    BIcon(47),  // house — banks / home
  refresh: BIcon(53),  // wrench/support — managed services / always-on
  grid:    BIcon(41),  // layers — modular / composable
  mail:    BIcon(61),  // message — get in touch
  calendar:BIcon(45),  // time — book a call
  phone:   BIcon(50),  // support
  doc:     BIcon(51),  // document
  gear:    BIcon(53),  // settings / ops
  bell:    BIcon(61),  // notifications
  /* ── UI / directional glyphs (inline strokes) ── */
  check:   (p) => <SIcon {...p}><path d="M4 12l5 5L20 6"/></SIcon>,
  arrowR:  (p) => <SIcon {...p}><path d="M5 12h14M13 6l6 6-6 6"/></SIcon>,
  menu:    (p) => <SIcon {...p}><path d="M3 6h18M3 12h18M3 18h18"/></SIcon>,
  x:       (p) => <SIcon {...p}><path d="M6 6l12 12M18 6L6 18"/></SIcon>,
  chevD:   (p) => <SIcon {...p}><path d="M6 9l6 6 6-6"/></SIcon>,
  chevR:   (p) => <SIcon {...p}><path d="M9 6l6 6-6 6"/></SIcon>,
  naira:   (p) => <SIcon {...p}><path d="M6 4v16M18 4v16M5 9h14M5 15h14M7 4l10 16"/></SIcon>,
  filter:  (p) => <SIcon {...p}><path d="M3 5h18l-7 8v6l-4-2v-4z"/></SIcon>,
  sort:    (p) => <SIcon {...p}><path d="M7 4v16M7 4l-3 4M7 4l3 4M17 20V4M17 20l-3-4M17 20l3-4"/></SIcon>,
  play:    (p) => <SIcon {...p}><path d="M7 4l13 8-13 8z"/></SIcon>,
  drag:    (p) => <SIcon {...p}><circle cx="9" cy="6" r="1.4"/><circle cx="9" cy="12" r="1.4"/><circle cx="9" cy="18" r="1.4"/><circle cx="15" cy="6" r="1.4"/><circle cx="15" cy="12" r="1.4"/><circle cx="15" cy="18" r="1.4"/></SIcon>,
  dots:    (p) => <SIcon {...p}><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></SIcon>,
};

/* Real Fyscal logo (blue F mark + wordmark). variant: 'blue' | 'white' (full knockout) */
const FyscalLogo = ({ height = 24, variant = 'blue' }) => {
  const wordFill = variant === 'white' ? '#ffffff' : '#000000';
  const markFill = variant === 'white' ? '#ffffff' : '#352EFF';
  return (
    <svg height={height} viewBox="0 0 253 43" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ display: 'block' }}>
      <path d="M58.6363 0L56.4009 13.0744H5.15625L7.40816 0H58.6363Z" fill={markFill}/>
      <path d="M43.5695 42.9998H29.7661L34.2408 16.8239H48.0539L43.5695 42.9998Z" fill={markFill}/>
      <path d="M27.6972 29.9672L4.37739 29.9072L15.7168 31.8338L13.8034 43H0L4.51065 16.824L29.9491 16.7959L27.6972 29.9672Z" fill={markFill}/>
      <path d="M69.9214 16.8929L72.5129 0H82.0056L81.4107 3.87719H76.3052L75.8675 6.65771H80.6477L80.0757 10.3037H75.3184L74.3086 16.8918H69.9214V16.8929Z" fill={wordFill}/>
      <path d="M84.9938 16.8908L86.1821 9.35685L81.4299 0H86.4592L88.305 4.3158C88.4053 4.5388 88.5065 4.79043 88.6108 5.07174C88.7151 5.35305 88.8163 5.65073 88.9166 5.96579C89.1242 5.48092 89.2919 5.10652 89.4187 4.84056C89.5455 4.57562 89.6478 4.38433 89.7245 4.26976L92.7238 0.00102394H97.9259L90.7164 9.40494L89.5404 16.8929H84.9958L84.9938 16.8908Z" fill={wordFill}/>
      <path d="M97.8394 10.9506C98.5088 11.6761 99.1471 12.203 99.7536 12.5321C100.361 12.8613 100.988 13.0268 101.636 13.0268C102.174 13.0268 102.603 12.8953 102.923 12.6314C103.243 12.3675 103.403 12.0199 103.403 11.5885C103.403 11.0022 102.756 10.3693 101.461 9.68856C101.337 9.62234 101.239 9.57169 101.167 9.53469C99.9083 8.87541 99.0466 8.24242 98.5813 7.63476C98.1161 7.0271 97.883 6.287 97.883 5.41543C97.883 3.82615 98.4159 2.52707 99.4808 1.51625C100.546 0.50542 101.919 0 103.599 0C104.486 0 105.339 0.157769 106.158 0.472313C106.976 0.786857 107.749 1.25234 108.476 1.86682L106.643 5.04147C106.069 4.54385 105.545 4.1738 105.072 3.93229C104.599 3.69078 104.163 3.57003 103.763 3.57003C103.327 3.57003 102.963 3.69663 102.672 3.94885C102.381 4.20107 102.235 4.51075 102.235 4.8769C102.235 5.3307 102.781 5.84001 103.872 6.40385C104.257 6.60153 104.556 6.7632 104.767 6.88687C105.887 7.50914 106.665 8.14407 107.102 8.79263C107.538 9.4412 107.756 10.2514 107.756 11.2252C107.756 12.946 107.163 14.321 105.978 15.3494C104.792 16.3787 103.181 16.8929 101.144 16.8929C100.076 16.8929 99.0756 16.664 98.1441 16.2063C97.2127 15.7487 96.3731 15.0689 95.6245 14.1691L97.8394 10.9506Z" fill={wordFill}/>
      <path d="M124.204 1.14374L123.488 5.58708C122.88 5.05177 122.218 4.64712 121.501 4.37216C120.785 4.09719 120.039 3.95971 119.265 3.95971C117.947 3.95971 116.862 4.42578 116.008 5.35599C115.154 6.28717 114.727 7.47479 114.727 8.91885C114.727 10.2245 115.085 11.2336 115.802 11.9484C116.518 12.6631 117.532 13.0209 118.842 13.0209C119.407 13.0209 119.987 12.9517 120.584 12.8123C121.181 12.6728 121.809 12.4642 122.468 12.1853L121.806 16.3537C121.263 16.5292 120.664 16.6637 120.008 16.7554C119.353 16.8471 118.645 16.8929 117.886 16.8929C115.62 16.8929 113.805 16.1821 112.44 14.7595C111.076 13.3368 110.394 11.4491 110.394 9.09533C110.394 7.95939 110.569 6.87611 110.92 5.84547C111.272 4.81581 111.787 3.87878 112.467 3.03536C113.263 2.0525 114.257 1.3017 115.448 0.781023C116.638 0.260341 117.971 0 119.448 0C120.288 0 121.102 0.095549 121.891 0.285685C122.681 0.476797 123.451 0.762494 124.204 1.14374Z" fill={wordFill}/>
      <path d="M123.246 16.8929L131.77 0H137.468L141.085 16.8929H136.468L135.782 13.7083H129.829L128.201 16.8929H123.247H123.246ZM131.537 9.94667H135.13L134.35 5.99992C134.273 5.60811 134.214 5.25722 134.176 4.95032C134.137 4.6424 134.114 4.35391 134.106 4.08486C133.943 4.54624 133.794 4.95236 133.659 5.30223C133.522 5.65209 133.416 5.91195 133.339 6.08074L131.537 9.94667Z" fill={wordFill}/>
      <path d="M141.851 16.8929L144.513 0H149.054L147.014 12.8541H152.592L151.959 16.8929H141.851Z" fill={wordFill}/>
      <path d="M68.9785 42.9999L71.0461 30.0303H67.2363L67.8871 26.1071H79.896L79.2453 30.0303H75.6106L73.543 42.9999H68.9785Z" fill={wordFill}/>
      <path d="M84.9084 39.2383H90.2438L89.6434 42.9999H79.7036L82.4235 26.1071H92.3633L91.7389 30.0067H86.4046L85.9693 32.7648H90.9151L90.3377 36.4343H85.3678L84.9084 39.2383Z" fill={wordFill}/>
      <path d="M107.709 27.2508L106.983 31.6941C106.366 31.1588 105.694 30.7542 104.968 30.4792C104.242 30.2043 103.486 30.0668 102.701 30.0668C101.365 30.0668 100.264 30.5329 99.3982 31.4631C98.5325 32.3942 98.0992 33.5818 98.0992 35.0259C98.0992 36.3315 98.4622 37.3407 99.1894 38.0554C99.9155 38.7701 100.943 39.128 102.272 39.128C102.844 39.128 103.433 39.0588 104.038 38.9193C104.643 38.7799 105.28 38.5712 105.948 38.2923L105.277 42.4607C104.726 42.6362 104.119 42.7708 103.454 42.8625C102.79 42.9541 102.072 42.9999 101.302 42.9999C99.0049 42.9999 97.1652 42.2891 95.7812 40.8665C94.3983 39.4439 93.7063 37.5562 93.7063 35.2024C93.7063 34.0665 93.8839 32.9832 94.2402 31.9525C94.5964 30.9229 95.1185 29.9858 95.8086 29.1424C96.6157 28.1596 97.6229 27.4088 98.8302 26.8881C100.037 26.3674 101.389 26.1071 102.886 26.1071C103.737 26.1071 104.563 26.2026 105.363 26.3928C106.164 26.5839 106.944 26.8695 107.709 27.2508Z" fill={wordFill}/>
      <path d="M108.284 42.9999L110.976 26.1071H115.57L114.51 32.6267H120.479L121.517 26.1071H126.122L123.417 42.9999H118.812L119.908 36.0998H113.962L112.866 42.9999H108.284Z" fill={wordFill}/>
      <path d="M127.082 42.9989L129.752 26.1071H134.919L138.49 34.4491C138.521 34.5187 138.571 34.6374 138.641 34.8072C139.034 35.7227 139.307 36.5227 139.462 37.207V36.7804C139.462 36.4725 139.479 36.1329 139.514 35.7595C139.549 35.3862 139.601 34.935 139.67 34.4041L140.977 26.1081H145.496L142.825 42.9999H137.855L134.063 34.4041C133.785 33.7812 133.575 33.2656 133.433 32.8585C133.29 32.4513 133.168 32.0432 133.069 31.635V32.1076C133.069 32.4155 133.056 32.7408 133.029 33.0825C133.002 33.4252 132.954 33.8804 132.885 34.4502L131.602 42.9999H127.082V42.9989Z" fill={wordFill}/>
      <path d="M155.804 42.9999C154.667 42.9999 153.633 42.842 152.703 42.527C151.772 42.2121 150.945 41.7392 150.221 41.1083C149.461 40.4336 148.866 39.6019 148.439 38.6122C148.011 37.6225 147.798 36.5704 147.798 35.4559C147.798 34.2537 147.981 33.1294 148.347 32.0851C148.713 31.0399 149.258 30.0931 149.983 29.2419C150.83 28.2298 151.864 27.4546 153.084 26.9154C154.304 26.3762 155.628 26.1071 157.055 26.1071C159.445 26.1071 161.377 26.8042 162.851 28.1966C164.324 29.59 165.061 31.4007 165.061 33.6296C165.061 34.8251 164.874 35.9483 164.502 37.0004C164.129 38.0525 163.584 39.0003 162.866 39.8437C161.99 40.8772 160.954 41.6622 159.759 42.1975C158.564 42.7328 157.246 42.9999 155.804 42.9999ZM156.782 30.0453C155.485 30.0453 154.399 30.5182 153.522 31.464C152.646 32.4098 152.208 33.5828 152.208 34.983C152.208 36.2223 152.557 37.212 153.256 37.9521C153.955 38.6931 154.887 39.0627 156.053 39.0627C157.327 39.0627 158.41 38.5732 159.3 37.5942C160.191 36.6153 160.636 35.4218 160.636 34.0148C160.636 32.8564 160.274 31.9048 159.55 31.1608C158.826 30.4168 157.902 30.0444 156.78 30.0444L156.782 30.0453Z" fill={wordFill}/>
      <path d="M167.171 42.9999L169.833 26.1071H174.374L172.334 38.9611H177.912L177.279 42.9999H167.171Z" fill={wordFill}/>
      <path d="M188.221 42.9999C187.083 42.9999 186.05 42.842 185.119 42.527C184.189 42.2121 183.362 41.7392 182.637 41.1083C181.877 40.4336 181.283 39.6019 180.855 38.6122C180.428 37.6225 180.215 36.5704 180.215 35.4559C180.215 34.2537 180.398 33.1294 180.764 32.0851C181.13 31.0399 181.675 30.0931 182.399 29.2419C183.247 28.2298 184.28 27.4546 185.501 26.9154C186.721 26.3762 188.045 26.1071 189.472 26.1071C191.862 26.1071 193.794 26.8042 195.268 28.1966C196.741 29.59 197.478 31.4007 197.478 33.6296C197.478 34.8251 197.291 35.9483 196.918 37.0004C196.546 38.0525 196.001 39.0003 195.283 39.8437C194.406 40.8772 193.371 41.6622 192.176 42.1975C190.98 42.7328 189.663 42.9999 188.221 42.9999ZM189.199 30.0453C187.902 30.0453 186.816 30.5182 185.939 31.464C185.063 32.4098 184.624 33.5828 184.624 34.983C184.624 36.2223 184.974 37.212 185.672 37.9521C186.372 38.6931 187.304 39.0627 188.469 39.0627C189.744 39.0627 190.827 38.5732 191.717 37.5942C192.608 36.6153 193.053 35.4218 193.053 34.0148C193.053 32.8564 192.691 31.9048 191.967 31.1608C191.242 30.4168 190.319 30.0444 189.197 30.0444L189.199 30.0453Z" fill={wordFill}/>
      <path d="M209.318 33.8061L217.426 33.8168C217.359 36.6835 216.569 38.931 215.054 40.5584C213.539 42.1858 211.483 42.9999 208.887 42.9999C206.292 42.9999 204.307 42.3067 202.803 40.9211C201.299 39.5356 200.546 37.6761 200.546 35.3448C200.546 34.0616 200.778 32.8428 201.242 31.6883C201.705 30.5338 202.37 29.5198 203.239 28.6471C204.063 27.8261 205.039 27.1972 206.168 26.7613C207.297 26.3255 208.52 26.1071 209.836 26.1071C211.381 26.1071 212.73 26.4152 213.885 27.0305C215.039 27.6467 216.04 28.5925 216.886 29.8679L213.444 32.2109C213.039 31.4845 212.538 30.9424 211.938 30.5836C211.338 30.2247 210.638 30.0444 209.836 30.0444C208.482 30.0444 207.365 30.5319 206.482 31.5069C205.6 32.482 205.158 33.7135 205.158 35.2024C205.158 36.4339 205.507 37.4226 206.206 38.1666C206.905 38.9106 207.828 39.283 208.975 39.283C209.402 39.283 209.805 39.2333 210.183 39.1348C210.562 39.0363 210.913 38.891 211.237 38.6999C211.523 38.5244 211.77 38.3021 211.976 38.0349C212.182 37.7678 212.348 37.4538 212.473 37.095H208.799L209.318 33.8061Z" fill={wordFill}/>
      <path d="M218.961 42.9999L221.641 26.1071H226.25L223.57 42.9999H218.961Z" fill={wordFill}/>
      <path d="M232.526 39.2383H237.781L237.19 42.9999H227.4L230.079 26.1071H239.868L239.253 30.0067H234L233.571 32.7648H238.442L237.873 36.4343H232.979L232.526 39.2383Z" fill={wordFill}/>
      <path d="M241.731 37.0577C242.411 37.7832 243.059 38.31 243.674 38.6392C244.291 38.9683 244.927 39.1339 245.584 39.1339C246.13 39.1339 246.566 39.0024 246.891 38.7385C247.216 38.4746 247.378 38.1269 247.378 37.6955C247.378 37.1093 246.721 36.4763 245.407 35.7956C245.281 35.7294 245.182 35.6788 245.108 35.6418C243.831 34.9825 242.956 34.3495 242.484 33.7418C242.012 33.1342 241.776 32.3941 241.776 31.5225C241.776 29.9332 242.316 28.6341 243.397 27.6233C244.478 26.6125 245.872 26.1071 247.577 26.1071C248.477 26.1071 249.343 26.2648 250.174 26.5794C251.004 26.8939 251.789 27.3594 252.527 27.9739L250.666 31.1485C250.083 30.6509 249.552 30.2809 249.072 30.0394C248.592 29.7979 248.15 29.6771 247.743 29.6771C247.3 29.6771 246.931 29.8037 246.636 30.0559C246.34 30.3081 246.193 30.6178 246.193 30.984C246.193 31.4378 246.747 31.9471 247.854 32.5109C248.245 32.7086 248.548 32.8702 248.762 32.9939C249.899 33.6162 250.689 34.2511 251.132 34.8997C251.575 35.5483 251.796 36.3585 251.796 37.3323C251.796 39.053 251.195 40.4281 249.991 41.4564C248.788 42.4858 247.153 42.9999 245.086 42.9999C244.001 42.9999 242.986 42.7711 242.041 42.3134C241.095 41.8557 240.243 41.176 239.483 40.2762L241.731 37.0577Z" fill={wordFill}/>
    </svg>
  );
};

Object.assign(window, { SIcon, SIcons, FyscalLogo });
