// FOOTPASS Messenger v2 · shared icons, status bar, avatar
const FPIcon = {
  Back: ({ c = 'currentColor' }) => (
    <svg width="12" height="20" viewBox="0 0 12 20" fill="none">
      <path d="M10 2L2 10l8 8" stroke={c} strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"></path>
    </svg>
  ),
  Phone: ({ c = 'currentColor', s = 22 }) => (
    <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
      <path d="M22 16.92v3a2 2 0 01-2.18 2A19.79 19.79 0 012 4.18 2 2 0 013.99 2h3a2 2 0 012 1.72c.13.96.36 1.9.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0122 16.92z" stroke={c} strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"></path>
    </svg>
  ),
  PhoneFill: ({ c = '#fff', s = 24 }) => (
    <svg width={s} height={s} viewBox="0 0 24 24" fill={c}>
      <path d="M22 16.92v3a2 2 0 01-2.18 2A19.79 19.79 0 012 4.18 2 2 0 013.99 2h3a2 2 0 012 1.72c.13.96.36 1.9.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0122 16.92z"></path>
    </svg>
  ),
  PhoneDown: ({ c = '#fff', s = 26 }) => (
    <svg width={s} height={s} viewBox="0 0 24 24" fill="none">
      <path d="M12 9.5c-3.6 0-6.9 1.1-9.6 3a2 2 0 00-.5 2.7l1.1 1.7a2 2 0 002.5.7l2.6-1.2a2 2 0 001.1-1.9l-.05-1.4a13.7 13.7 0 015.7 0l-.05 1.4a2 2 0 001.1 1.9l2.6 1.2a2 2 0 002.5-.7l1.1-1.7a2 2 0 00-.5-2.7 16.6 16.6 0 00-9.6-3z" fill={c}></path>
    </svg>
  ),
  Video: ({ c = 'currentColor', s = 22 }) => (
    <svg width={s} height={Math.round(s * 14 / 22)} viewBox="0 0 22 14" fill="none">
      <rect x="0.9" y="0.9" width="14.2" height="12.2" rx="2.6" stroke={c} strokeWidth="1.6"></rect>
      <path d="M15.5 4.75L21 2V12L15.5 9.25" stroke={c} strokeWidth="1.6" strokeLinejoin="round"></path>
    </svg>
  ),
  VideoFill: ({ c = '#fff', s = 26 }) => (
    <svg width={s} height={Math.round(s * 14 / 22)} viewBox="0 0 22 14" fill={c}>
      <rect x="0.5" y="0.5" width="15" height="13" rx="3"></rect>
      <path d="M16.5 4.75L22 1.6V12.4L16.5 9.25z"></path>
    </svg>
  ),
  Plus: ({ c = 'currentColor' }) => (
    <svg width="14" height="14" viewBox="0 0 14 14" fill="none">
      <path d="M7 1.5V12.5M1.5 7H12.5" stroke={c} strokeWidth="1.7" strokeLinecap="round"></path>
    </svg>
  ),
  Mic: ({ c = 'currentColor', s = 14 }) => (
    <svg width={s} height={Math.round(s * 20 / 14)} viewBox="0 0 14 20" fill="none">
      <rect x="4.25" y="1.25" width="5.5" height="10.5" rx="2.75" stroke={c} strokeWidth="1.6"></rect>
      <path d="M1.75 9.25C1.75 12.15 4.1 14.5 7 14.5C9.9 14.5 12.25 12.15 12.25 9.25M7 14.5V18.5M4.5 18.5H9.5" stroke={c} strokeWidth="1.6" strokeLinecap="round"></path>
    </svg>
  ),
  MicOff: ({ c = '#fff', s = 22 }) => (
    <svg width={s} height={s} viewBox="0 0 22 22" fill="none">
      <rect x="8" y="2" width="6" height="11" rx="3" stroke={c} strokeWidth="1.6"></rect>
      <path d="M4 10c0 3.9 3.1 7 7 7s7-3.1 7-7M11 17v3M7.5 20h7" stroke={c} strokeWidth="1.6" strokeLinecap="round"></path>
      <path d="M3 2l16 18" stroke={c} strokeWidth="1.8" strokeLinecap="round"></path>
    </svg>
  ),
  Send: ({ c = '#fff' }) => (
    <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
      <path d="M8 13.5V2.5M3 7.5L8 2.5L13 7.5" stroke={c} strokeWidth="2.1" strokeLinecap="round" strokeLinejoin="round"></path>
    </svg>
  ),
  SingleCheck: ({ cls = '' }) => (
    <svg className={`tick ${cls}`} width="15" height="10" viewBox="0 0 15 10" fill="none">
      <path d="M4.5 5.3L7 7.8L12 2.4" strokeWidth="1.45" strokeLinecap="round" strokeLinejoin="round"></path>
    </svg>
  ),
  DoubleCheck: ({ cls = '' }) => (
    <svg className={`tick ${cls}`} width="15" height="10" viewBox="0 0 15 10" fill="none">
      <path d="M1 5.3L3.5 7.8L8.5 2.4" strokeWidth="1.45" strokeLinecap="round" strokeLinejoin="round"></path>
      <path d="M6.6 6.2L8.1 7.8L13.6 1.9" strokeWidth="1.45" strokeLinecap="round" strokeLinejoin="round"></path>
    </svg>
  ),
  More: ({ c = 'currentColor' }) => (
    <svg width="20" height="4" viewBox="0 0 20 4" fill={c}>
      <circle cx="2" cy="2" r="1.75"></circle><circle cx="10" cy="2" r="1.75"></circle><circle cx="18" cy="2" r="1.75"></circle>
    </svg>
  ),
  Play: ({ c = '#fff' }) => (
    <svg width="10" height="12" viewBox="0 0 10 12" fill={c}>
      <path d="M1 1.2C1 0.55 1.7 0.15 2.25 0.5L9.3 5.3C9.8 5.65 9.8 6.35 9.3 6.7L2.25 11.5C1.7 11.85 1 11.45 1 10.8V1.2Z"></path>
    </svg>
  ),
  Pause: ({ c = '#fff' }) => (
    <svg width="10" height="12" viewBox="0 0 10 12" fill={c}>
      <rect x="1" y="0.5" width="3" height="11" rx="0.6"></rect><rect x="6" y="0.5" width="3" height="11" rx="0.6"></rect>
    </svg>
  ),
  Shield: ({ c = 'var(--acc, #00A37E)', s = 11 }) => (
    <svg width={Math.round(s * 10 / 11)} height={s} viewBox="0 0 10 11" fill={c}>
      <path d="M5 0.5L0.75 2v3.5c0 2.5 1.8 4.5 4.25 5C7.45 10 9.25 8 9.25 5.5V2L5 0.5z"></path>
      <path d="M3.4 5.3L4.4 6.3L6.8 3.9" stroke="#fff" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round" fill="none"></path>
    </svg>
  ),
  Doc: ({ c = 'currentColor', s = 18 }) => (
    <svg width={s} height={Math.round(s * 22 / 18)} viewBox="0 0 18 22" fill="none">
      <path d="M2 3a2 2 0 012-2h7l5 5v13a2 2 0 01-2 2H4a2 2 0 01-2-2V3z" stroke={c} strokeWidth="1.5"></path>
      <path d="M11 1v5h5" stroke={c} strokeWidth="1.5"></path>
    </svg>
  ),
  Pen: ({ c = 'currentColor', s = 14 }) => (
    <svg width={s} height={s} viewBox="0 0 14 14" fill="none">
      <path d="M9.8 1.6a1.6 1.6 0 012.3 2.3L4.6 11.4 1.5 12.5l1.1-3.1 7.2-7.8z" stroke={c} strokeWidth="1.3" strokeLinejoin="round"></path>
    </svg>
  ),
  Calendar: ({ c = 'currentColor', s = 18 }) => (
    <svg width={s} height={s} viewBox="0 0 18 18" fill="none">
      <rect x="1.5" y="3" width="15" height="13.5" rx="2.5" stroke={c} strokeWidth="1.5"></rect>
      <path d="M1.5 7.5h15M5.5 1v3.5M12.5 1v3.5" stroke={c} strokeWidth="1.5" strokeLinecap="round"></path>
    </svg>
  ),
  Pin: ({ c = 'currentColor', s = 12 }) => (
    <svg width={Math.round(s * 18 / 22)} height={s} viewBox="0 0 18 22" fill="none">
      <path d="M9 21C9 21 16 14 16 9A7 7 0 002 9C2 14 9 21 9 21z" stroke={c} strokeWidth="1.5"></path>
      <circle cx="9" cy="9" r="2.5" stroke={c} strokeWidth="1.5"></circle>
    </svg>
  ),
  Timer: ({ c = 'currentColor', s = 12 }) => (
    <svg width={s} height={s} viewBox="0 0 14 14" fill="none">
      <circle cx="7" cy="8" r="5.2" stroke={c} strokeWidth="1.3"></circle>
      <path d="M7 5.5V8l1.8 1.4M5.5 1h3" stroke={c} strokeWidth="1.3" strokeLinecap="round"></path>
    </svg>
  ),
  Globe: ({ c = 'currentColor', s = 11 }) => (
    <svg width={s} height={s} viewBox="0 0 22 22" fill="none">
      <circle cx="11" cy="11" r="9" stroke={c} strokeWidth="1.8"></circle>
      <path d="M2 11h18M11 2c2.8 3.5 2.8 14 0 18M11 2C8.2 5.5 8.2 16 11 20" stroke={c} strokeWidth="1.8"></path>
    </svg>
  ),
  SpeakerOn: ({ c = '#fff', s = 22 }) => (
    <svg width={s} height={s} viewBox="0 0 22 22" fill="none">
      <path d="M3 8.5h3l5-4v13l-5-4H3v-5z" stroke={c} strokeWidth="1.6" strokeLinejoin="round"></path>
      <path d="M14.5 7.5a5 5 0 010 7M17 5a8.5 8.5 0 010 12" stroke={c} strokeWidth="1.6" strokeLinecap="round"></path>
    </svg>
  ),
  CamFlip: ({ c = '#fff', s = 22 }) => (
    <svg width={s} height={s} viewBox="0 0 22 22" fill="none">
      <path d="M3 7a2 2 0 012-2h2l1.5-2h5L15 5h2a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V7z" stroke={c} strokeWidth="1.5"></path>
      <path d="M8.2 11.6a3 3 0 005.3 1.3M13.8 10.4a3 3 0 00-5.3-1.3" stroke={c} strokeWidth="1.4" strokeLinecap="round"></path>
      <path d="M8 8.6v1.8h1.8M14 13.4v-1.8h-1.8" stroke={c} strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round"></path>
    </svg>
  ),
  CamOff: ({ c = '#fff', s = 24 }) => (
    <svg width={s} height={Math.round(s * 16 / 24)} viewBox="0 0 24 16" fill="none">
      <path d="M2 3.5A2.5 2.5 0 014.5 1H14a2.5 2.5 0 012.5 2.5v9A2.5 2.5 0 0114 15H4.5A2.5 2.5 0 012 12.5v-9z" stroke={c} strokeWidth="1.5"></path>
      <path d="M16.5 5.75L22 3V13L16.5 10.25" stroke={c} strokeWidth="1.5" strokeLinejoin="round"></path>
      <path d="M1 0.5l21 15" stroke={c} strokeWidth="1.7" strokeLinecap="round"></path>
    </svg>
  ),
  User: ({ c = 'currentColor', s = 18 }) => (
    <svg width={s} height={s} viewBox="0 0 22 22" fill="none">
      <circle cx="11" cy="8" r="4" stroke={c} strokeWidth="1.5"></circle>
      <path d="M3 20C3 16 6.5 13 11 13C15.5 13 19 16 19 20" stroke={c} strokeWidth="1.5" strokeLinecap="round"></path>
    </svg>
  ),
  Sun: ({ c = 'currentColor' }) => (
    <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
      <circle cx="8" cy="8" r="3" stroke={c} strokeWidth="1.4"></circle>
      <path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.4 1.4M11.55 11.55l1.4 1.4M3.05 12.95l1.4-1.4M11.55 4.45l1.4-1.4" stroke={c} strokeWidth="1.4" strokeLinecap="round"></path>
    </svg>
  ),
  Moon: ({ c = 'currentColor' }) => (
    <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
      <path d="M13.5 9.5A6 6 0 016.5 2.5C6.5 2.3 6.5 2.1 6.55 1.9A6.5 6.5 0 1014.1 9.45C13.9 9.48 13.7 9.5 13.5 9.5Z" fill={c}></path>
    </svg>
  ),
};

// ── Status bar ──
function FPStatusBar({ time = '16:08', light }) {
  const c = light ? '#fff' : 'currentColor';
  return (
    <div className="statusbar">
      <div className="sb-time" style={light ? { color: '#fff' } : undefined}>{time}</div>
      <div className="sb-right">
        <svg width="18" height="11" viewBox="0 0 18 11" fill={c}>
          <rect x="0" y="7" width="3" height="4" rx="0.6"></rect>
          <rect x="4.5" y="5" width="3" height="6" rx="0.6"></rect>
          <rect x="9" y="2.5" width="3" height="8.5" rx="0.6"></rect>
          <rect x="13.5" y="0" width="3" height="11" rx="0.6"></rect>
        </svg>
        <svg width="16" height="11" viewBox="0 0 16 11" fill={c}>
          <path d="M8 2.8C10.1 2.8 12 3.6 13.4 5L14.4 4C12.7 2.4 10.4 1.3 8 1.3C5.6 1.3 3.3 2.4 1.6 4L2.6 5C4 3.6 5.9 2.8 8 2.8Z"></path>
          <path d="M8 6.2C9.2 6.2 10.3 6.7 11.1 7.5L12.1 6.5C10.9 5.4 9.5 4.7 8 4.7C6.5 4.7 5.1 5.4 3.9 6.5L4.9 7.5C5.7 6.7 6.8 6.2 8 6.2Z"></path>
          <circle cx="8" cy="9.6" r="1.4"></circle>
        </svg>
        <svg width="25" height="12" viewBox="0 0 25 12" fill="none">
          <rect x="0.5" y="0.5" width="21" height="11" rx="3" stroke={c} strokeOpacity="0.4"></rect>
          <rect x="2" y="2" width="18" height="8" rx="1.5" fill={c}></rect>
          <path d="M23 4V8C23.7 7.7 24 7.3 24 6C24 4.7 23.7 4.3 23 4Z" fill={c} fillOpacity="0.4"></path>
        </svg>
      </div>
    </div>
  );
}

// ── Avatar · photo or monogram on Modern Black ──
const LUCAS_PHOTO = 'assets/lucas-avatar.png';
function FPAvatar({ size = 40, initials = 'LF', ring = false, src }) {
  return (
    <div className={`avatar ${ring ? 'avatar-ring' : ''}`} style={{ width: size, height: size }}>
      {src ? (
        <img src={src} alt={initials} width={size} height={size}
          style={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block' }} />
      ) : (
        <svg width={size} height={size} viewBox="0 0 40 40">
          <circle cx="20" cy="20" r="20" fill="#0F0F0F"></circle>
          <text x="20" y="20" textAnchor="middle" dominantBaseline="central"
            fontFamily="Orbitron, sans-serif" fontWeight="700" fontSize="13"
            letterSpacing="0.5" fill="#EAEAEA">{initials}</text>
        </svg>
      )}
    </div>
  );
}

// ── Scan facial · buste de portrait dans le cadre de scan (symbole KYC universel,
// celui des apps bancaires : cadre Face ID + silhouette d'identité, pas de smiley) ──
FPIcon.FaceScan = ({ s = 14, c = 'currentColor' }) => (
  <svg width={s} height={s} viewBox="0 0 16 16" fill="none">
    <path d="M1 5V3.5A2.5 2.5 0 013.5 1H5M11 1h1.5A2.5 2.5 0 0115 3.5V5M15 11v1.5a2.5 2.5 0 01-2.5 2.5H11M5 15H3.5A2.5 2.5 0 011 12.5V11" stroke={c} strokeWidth="1.4" strokeLinecap="round"></path>
    <circle cx="8" cy="6.2" r="2.05" fill={c}></circle>
    <path d="M4.55 12.1c.4-1.95 1.75-3.05 3.45-3.05s3.05 1.1 3.45 3.05c.06.3-.18.55-.48.55H5.03c-.3 0-.54-.25-.48-.55z" fill={c}></path>
  </svg>
);

Object.assign(window, { FPIcon, FPStatusBar, FPAvatar, LUCAS_PHOTO });
