/* ============================================================
   EDUCARE — Icon set (original stroke icons, Lucide-style)
   Usage: <Icon name="users" size={20} />
   ============================================================ */
(function () {
  const P = {
    // sidebar
    dashboard: <><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/></>,
    users: <><path d="M16 19v-1.5a3.5 3.5 0 0 0-3.5-3.5h-5A3.5 3.5 0 0 0 4 17.5V19"/><circle cx="10" cy="8" r="3.2"/><path d="M20 19v-1.4a3.4 3.4 0 0 0-2.6-3.3"/><path d="M15.5 5.1a3.2 3.2 0 0 1 0 5.9"/></>,
    calendar: <><rect x="3.5" y="4.5" width="17" height="16" rx="2.5"/><path d="M3.5 9h17M8 3v3M16 3v3"/></>,
    clipboardCheck: <><rect x="5" y="4.5" width="14" height="16.5" rx="2.5"/><path d="M9 4.5V3.5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1"/><path d="M9 13l2 2 4-4"/></>,
    fileText: <><path d="M6 2.5h7l5 5V20a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 6 20V4a1.5 1.5 0 0 1 1.5-1.5z"/><path d="M13 2.5V8h5"/><path d="M9 13h6M9 16.5h6"/></>,
    clipboardList: <><rect x="5" y="4.5" width="14" height="16.5" rx="2.5"/><path d="M9 4.5V3.5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1"/><path d="M9 10h6M9 14h6M9 17.5h3.5"/></>,
    wallet: <><path d="M3.5 7.5A2.5 2.5 0 0 1 6 5h11.5A1.5 1.5 0 0 1 19 6.5V8"/><rect x="3.5" y="7" width="17" height="13" rx="2.5"/><circle cx="16" cy="13.5" r="1.4"/></>,
    chat: <><path d="M4 5.5h16a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 20 16.5H9l-4.5 4V16.5H4A1.5 1.5 0 0 1 2.5 15V7A1.5 1.5 0 0 1 4 5.5z"/></>,
    book: <><path d="M5 4.5h11A2.5 2.5 0 0 1 18.5 7v12.5H7A2 2 0 0 1 5 17.5z"/><path d="M5 17.5A2 2 0 0 1 7 15.5h11.5"/></>,
    layers: <><path d="M12 3l8.5 4.5L12 12 3.5 7.5z"/><path d="M3.5 12L12 16.5 20.5 12M3.5 16.5L12 21l8.5-4.5"/></>,
    // top / misc
    settings: <><circle cx="12" cy="12" r="3"/><path d="M12 2.5v2.2M12 19.3v2.2M4.2 4.2l1.6 1.6M18.2 18.2l1.6 1.6M2.5 12h2.2M19.3 12h2.2M4.2 19.8l1.6-1.6M18.2 5.8l1.6-1.6"/></>,
    search: <><circle cx="11" cy="11" r="7"/><path d="M20 20l-3.2-3.2"/></>,
    bell: <><path d="M6 9a6 6 0 0 1 12 0c0 5 2 6 2 6H4s2-1 2-6z"/><path d="M10 20a2 2 0 0 0 4 0"/></>,
    sun: <><circle cx="12" cy="12" r="4.2"/><path d="M12 2.5v2.5M12 19v2.5M4.9 4.9l1.8 1.8M17.3 17.3l1.8 1.8M2.5 12H5M19 12h2.5M4.9 19.1l1.8-1.8M17.3 6.7l1.8-1.8"/></>,
    moon: <><path d="M20 14.5A8.2 8.2 0 0 1 9.5 4 8.2 8.2 0 1 0 20 14.5z"/></>,
    mail: <><rect x="3" y="5" width="18" height="14" rx="2.5"/><path d="M4 7l8 6 8-6"/></>,
    x: <><path d="M6 6l12 12M18 6L6 18"/></>,
    chevL: <><path d="M15 5l-7 7 7 7"/></>,
    chevR: <><path d="M9 5l7 7-7 7"/></>,
    chevDown: <><path d="M5 9l7 7 7-7"/></>,
    eye: <><path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z"/><circle cx="12" cy="12" r="3"/></>,
    eyeOff: <><path d="M10 6a9.7 9.7 0 0 1 2-.2c6 0 9.5 6.2 9.5 6.2a16 16 0 0 1-2.3 3M6.2 6.3A15.7 15.7 0 0 0 2.5 12S6 18.2 12 18.2a9.4 9.4 0 0 0 3.6-.7"/><path d="M9.8 9.9a3 3 0 0 0 4.2 4.3M3 3l18 18"/></>,
    lock: <><rect x="4.5" y="10" width="15" height="10.5" rx="2.5"/><path d="M8 10V7.5a4 4 0 0 1 8 0V10"/></>,
    plus: <><path d="M12 5v14M5 12h14"/></>,
    plusCircle: <><circle cx="12" cy="12" r="9"/><path d="M12 8.5v7M8.5 12h7"/></>,
    sparkles: <><path d="M12 3l1.7 4.6L18.5 9 13.7 10.7 12 15.5 10.3 10.7 5.5 9l4.8-1.4z"/><path d="M18.5 14.5l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8z"/></>,
    arrowRight: <><path d="M5 12h13M13 6l6 6-6 6"/></>,
    logout: <><path d="M14 4.5H7A2 2 0 0 0 5 6.5v11a2 2 0 0 0 2 2h7"/><path d="M17 8.5l4 3.5-4 3.5M9 12h12"/></>,
    help: <><circle cx="12" cy="12" r="9"/><path d="M9.5 9.5a2.5 2.5 0 0 1 4.8.9c0 1.7-2.3 2.1-2.3 3.6"/><path d="M12 17.4h.01"/></>,
    headset: <><path d="M4 13v-1a8 8 0 0 1 16 0v1"/><rect x="3" y="13" width="4" height="6" rx="1.5"/><rect x="17" y="13" width="4" height="6" rx="1.5"/><path d="M20 19v.5a3 3 0 0 1-3 3h-2"/></>,
    heart: <><path d="M12 20s-7-4.6-9.2-9A4.3 4.3 0 0 1 12 6.5 4.3 4.3 0 0 1 21.2 11C19 15.4 12 20 12 20z"/></>,
    clipboardHeart: <><rect x="5" y="4.5" width="14" height="16.5" rx="2.5"/><path d="M9 4.5V3.5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1"/><path d="M12 17s-3-1.9-3-3.8a1.8 1.8 0 0 1 3-1.2 1.8 1.8 0 0 1 3 1.2C15 15.1 12 17 12 17z"/></>,
    activity: <><path d="M3 12h4l2.5 7 5-15L17 12h4"/></>,
    chart: <><path d="M4 4v16h16"/><path d="M8 14l3-3 3 2 4-5"/></>,
    folderHeart: <><path d="M3.5 6.5A1.5 1.5 0 0 1 5 5h4l2 2h6.5A1.5 1.5 0 0 1 19 8.5v9A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"/></>,
    menu: <><path d="M4 7h16M4 12h16M4 17h16"/></>,
    download: <><path d="M12 3v12M7 10l5 5 5-5M4 19h16"/></>,
    home: <><path d="M4 11l8-7 8 7"/><path d="M6 10v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-9"/></>,
  };

  function Icon({ name, size = 20, stroke = 1.85, className = "", style }) {
    const d = P[name];
    if (!d) return null;
    return (
      <svg className={className} style={style} width={size} height={size} viewBox="0 0 24 24"
        fill="none" stroke="currentColor" strokeWidth={stroke}
        strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
        {d}
      </svg>
    );
  }

  // Brand mark — open book + sprout + spark ("registro · desenvolvimento · IA")
  function Logo({ size = 38 }) {
    const u = "lg" + Math.round(size);
    return (
      <span className="login-logo" style={{ width: size, height: size, display: "inline-flex" }}>
        <svg width={size} height={size} viewBox="0 0 40 40" fill="none" aria-label="Educare">
          <defs>
            <linearGradient id={u + "b"} x1="4" y1="4" x2="36" y2="36" gradientUnits="userSpaceOnUse">
              <stop stopColor="var(--primary-light)"/><stop offset="1" stopColor="var(--primary)"/>
            </linearGradient>
            <linearGradient id={u + "c"} x1="6" y1="24" x2="34" y2="34" gradientUnits="userSpaceOnUse">
              <stop stopColor="#14B8A6"/><stop offset="1" stopColor="#0F766E"/>
            </linearGradient>
            <linearGradient id={u + "l"} x1="13" y1="9" x2="20" y2="20" gradientUnits="userSpaceOnUse">
              <stop stopColor="#34D6BF"/><stop offset="1" stopColor="#14B8A6"/>
            </linearGradient>
            <radialGradient id={u + "h"} cx="0.5" cy="0.45" r="0.62">
              <stop stopColor="#FFFFFF"/><stop offset="1" stopColor="#E4F3EE"/>
            </radialGradient>
          </defs>

          <rect x="2" y="2" width="36" height="36" rx="12" fill={`url(#${u}b)`}/>
          <circle cx="20" cy="17.5" r="13.2" fill={`url(#${u}h)`}/>

          {/* broto */}
          <path d="M20 27 C 18.9 22 18.9 17 20 12" stroke="#14B8A6" strokeWidth="2.3" strokeLinecap="round"/>
          <path d="M20 19.6 C 13.8 19.6 10.8 14.2 14 10.2 C 18 11.6 21 15.2 20.5 20 Z" fill={`url(#${u}l)`}/>
          <path d="M20 16.8 C 26.2 16.3 29.2 11 26.8 7.2 C 22.4 8.4 19.6 12 20 18 Z" fill="#0F9B8B"/>
          <circle cx="20" cy="10.2" r="2.7" fill="#FB923C"/>
          <circle cx="19.1" cy="9.4" r="0.9" fill="#FFD9B8"/>

          {/* faíscas */}
          <path d="M30.5 10 Q30.5 12 32.5 12 Q30.5 12 30.5 14 Q30.5 12 28.5 12 Q30.5 12 30.5 10 Z" fill="#FB923C"/>
          <path d="M9.5 11.6 Q9.5 13 11 13 Q9.5 13 9.5 14.4 Q9.5 13 8 13 Q9.5 13 9.5 11.6 Z" fill="#34D6BF"/>

          {/* livro aberto */}
          <path d="M5.5 27.4 L20 24.3 L34.5 27.4 L34.5 32.6 Q34.5 33.9 33.3 33.6 L20 31.4 L6.7 33.6 Q5.5 33.9 5.5 32.6 Z" fill={`url(#${u}c)`}/>
          <path d="M7 28.1 L20 25.1 L20 31 L7.8 30.7 Q6.8 30.7 6.8 29.7 L6.8 28.6 Q6.8 28 7 28.1 Z" fill="#FFF9EF"/>
          <path d="M33 28.1 L20 25.1 L20 31 L32.2 30.7 Q33.2 30.7 33.2 29.7 L33.2 28.6 Q33.2 28 33 28.1 Z" fill="#FBF1DE"/>
          <path d="M20 25.1 L20 31" stroke="#0C5F58" strokeWidth="1.3" strokeLinecap="round"/>
          <g stroke="#E0D4BE" strokeWidth="1.2" strokeLinecap="round">
            <path d="M9.2 28.7 L17.4 26.8"/><path d="M30.8 28.7 L22.6 26.8"/>
          </g>
        </svg>
      </span>
    );
  }

  window.Icon = Icon;
  window.Logo = Logo;
})();
