/* ITSOS custom cursor — pallino arancione, alone, scia cometa, testo/illuminazione */

:root {
  --itsos-cursor: #ff9517;
  --itsos-cursor-core: #ff7a00;
  --itsos-cursor-glow: #ffb84d;
  --itsos-cursor-hot: #ff6b00;
  --itsos-cursor-soft: rgba(255, 149, 23, 0.55);
  --itsos-cursor-trail: rgba(255, 184, 77, 0.4);
}

@media (hover: hover) and (pointer: fine) {
  html.itsos-cursor-ready,
  html.itsos-cursor-ready body {
    cursor: none !important;
  }

  html.itsos-cursor-ready a,
  html.itsos-cursor-ready button,
  html.itsos-cursor-ready [role="button"],
  html.itsos-cursor-ready label,
  html.itsos-cursor-ready select,
  html.itsos-cursor-ready summary,
  html.itsos-cursor-ready .button,
  html.itsos-cursor-ready .itsos-livechat-label,
  html.itsos-cursor-ready .o-livechat-root,
  html.itsos-cursor-ready [id^="o-livechat-root-"] {
    cursor: none !important;
  }

  /* Input: cursore di sistema per digitare */
  html.itsos-cursor-ready input,
  html.itsos-cursor-ready textarea,
  html.itsos-cursor-ready [contenteditable="true"] {
    cursor: text !important;
  }
}

.itsos-cursor-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Sopra il widget Odoo Live Chat (shadow + label ~2147483646) */
  z-index: 2147483647;
  overflow: hidden;
}

.itsos-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe0a8 0%, var(--itsos-cursor) 42%, var(--itsos-cursor-core) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 2px rgba(255, 149, 23, 0.35),
    0 0 14px 4px var(--itsos-cursor-soft),
    0 0 28px 8px rgba(255, 184, 77, 0.28);
  transform: translate3d(-100px, -100px, 0) scale(1);
  will-change: transform, width, height, box-shadow;
  transition:
    width 0.18s ease,
    height 0.18s ease,
    margin 0.18s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  opacity: 0;
}

html.itsos-cursor-ready .itsos-cursor-dot.is-on {
  opacity: 1;
}

.itsos-cursor-dot.is-hover {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 18px 6px rgba(255, 149, 23, 0.55),
    0 0 36px 12px rgba(255, 184, 77, 0.35);
}

.itsos-cursor-dot.is-dark {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  background: radial-gradient(circle at 35% 30%, #fff3d6 0%, var(--itsos-cursor-glow) 38%, var(--itsos-cursor) 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.7),
    0 0 22px 8px rgba(255, 149, 23, 0.7),
    0 0 48px 18px rgba(255, 184, 77, 0.45),
    0 0 80px 28px rgba(255, 107, 0, 0.2);
}

.itsos-cursor-trail-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--itsos-cursor);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity, width, height;
  box-shadow: 0 0 10px 2px var(--itsos-cursor-trail);
}

/* Spotlight su overlay scuri: alone luminoso che “scava” l’oscuramento */
.itsos-cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-200px, -200px, 0);
  background: radial-gradient(
    circle,
    rgba(255, 230, 180, 0.42) 0%,
    rgba(255, 149, 23, 0.22) 28%,
    rgba(255, 149, 23, 0.08) 52%,
    transparent 72%
  );
  mix-blend-mode: soft-light;
  transition: opacity 0.25s ease;
  will-change: transform, opacity;
}

.itsos-cursor-spotlight.is-on {
  opacity: 1;
}

/* Testo: palette arancione congruente al passaggio */
@media (hover: hover) and (pointer: fine) {
  html.itsos-cursor-ready .itsos-cursor-text-hot,
  html.itsos-cursor-ready .itsos-cursor-text-hot * {
    color: var(--itsos-cursor) !important;
    -webkit-text-fill-color: var(--itsos-cursor);
    transition: color 0.15s ease, text-shadow 0.15s ease;
    text-shadow: 0 0 12px rgba(255, 149, 23, 0.25);
  }

  html.itsos-cursor-ready a.itsos-cursor-text-hot,
  html.itsos-cursor-ready .itsos-cursor-text-hot a {
    color: var(--itsos-cursor-hot) !important;
    -webkit-text-fill-color: var(--itsos-cursor-hot);
  }

  html.itsos-cursor-ready h1.itsos-cursor-text-hot,
  html.itsos-cursor-ready h2.itsos-cursor-text-hot,
  html.itsos-cursor-ready h3.itsos-cursor-text-hot,
  html.itsos-cursor-ready .itsos-cursor-text-hot h1,
  html.itsos-cursor-ready .itsos-cursor-text-hot h2,
  html.itsos-cursor-ready .itsos-cursor-text-hot h3 {
    color: var(--itsos-cursor-glow) !important;
    -webkit-text-fill-color: var(--itsos-cursor-glow);
  }

  html.itsos-cursor-ready strong.itsos-cursor-text-hot,
  html.itsos-cursor-ready b.itsos-cursor-text-hot,
  html.itsos-cursor-ready .itsos-cursor-text-hot strong,
  html.itsos-cursor-ready .itsos-cursor-text-hot b {
    color: var(--itsos-cursor-core) !important;
    -webkit-text-fill-color: var(--itsos-cursor-core);
  }
}

@media (prefers-reduced-motion: reduce) {
  .itsos-cursor-root {
    display: none !important;
  }
  html.itsos-cursor-ready,
  html.itsos-cursor-ready body,
  html.itsos-cursor-ready a,
  html.itsos-cursor-ready button {
    cursor: auto !important;
  }
}
