/* ================================================================
   hitrack.html — pagina prodotto Monitoraggio IT. Riusa .reveal/
   .reveal.visible, .eyebrow, .section*, .btn, .cta, .spot-card,
   .service-icon, .badge-product, .advantages-grid/.advantage-card,
   .live-dot (keyframe sec-live-pulse condivisa) dal design system in
   css/style.css. Concetto guida distinto da hibackup.html: "rete viva
   monitorata in tempo reale", non copie di dati.
   ================================================================ */

.hero--hitrack { padding-bottom: 56px; }
.lede-text { max-width: 760px; margin: 0 auto; font-size: 1.02rem; color: var(--text-muted); line-height: 1.7; text-align: center; }

/* ---------- Hero: mappa di rete viva ---------- */
.netmap-wrap { position: relative; z-index: 2; margin-top: 48px; }
.netmap { position: relative; opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.netmap.visible { opacity: 1; transform: none; }
.netmap__svg { width: 100%; height: auto; display: block; overflow: visible; }
.netmap-caption { margin-top: 14px; font-size: .82rem; color: rgba(255,255,255,.55); text-align: center; }

.netmap-line { stroke: rgba(255,255,255,.16); stroke-width: 1.4; }

.netmap-node__ring {
  fill: none; stroke: var(--teal); stroke-width: 2;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .8s ease;
}
.netmap-node__ring.is-drawn { stroke-dashoffset: 0; }
.netmap-node__body { fill: var(--navy-dark); stroke: none; }
.netmap-node__icon { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.netmap-node__label { font-size: 12px; font-weight: 600; fill: rgba(255,255,255,.6); }

.netmap-node[data-node] {
  transition: transform .35s ease;
  transform: translate(calc(var(--px,0)*1px), calc(var(--py,0)*1px));
}
.netmap-node[data-node].is-glow .netmap-node__ring { stroke-width: 3; filter: drop-shadow(0 0 4px rgba(18,181,166,.6)); }

/* Stato anomalia: il nodo passa a tonalità rosso/arancio con un piccolo impulso */
.netmap-node[data-node].is-anomaly .netmap-node__ring { stroke: #e9604a; animation: netmap-alert-pulse 1s ease-in-out infinite; }
.netmap-node[data-node].is-anomaly .netmap-node__body { fill: #3a1f1a; }
@keyframes netmap-alert-pulse {
  0%, 100% { stroke-width: 2; opacity: 1; }
  50% { stroke-width: 3.4; opacity: .65; }
}
/* Stato risolto: breve lampo verde quando l'impulso di ritorno arriva */
.netmap-node[data-node].is-resolved .netmap-node__ring { stroke: #2ecc71; transition: stroke .3s ease; }

.netmap-node--core .netmap-node__body { fill: var(--orange); }
.netmap-node--core .netmap-node__corelabel { font-size: 15px; font-weight: 800; fill: var(--navy-dark); }
.netmap-node--core .netmap-node__pulsering { fill: none; stroke: var(--orange); stroke-width: 1.6; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.netmap.visible .netmap-node--core .netmap-node__pulsering { animation: netmap-core-pulse 2.6s ease-out infinite; }
@keyframes netmap-core-pulse { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
.netmap-node--core.is-ack .netmap-node__body { animation: netmap-ack-flash .5s ease-out; }
@keyframes netmap-ack-flash { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.netmap-pulse { fill: var(--orange); opacity: 0; }
.netmap-pulse--return { fill: #2ecc71; }
.netmap-pulse.is-live { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .netmap { transition: none; opacity: 1; transform: none; }
  .netmap-node[data-node] { transition: none; }
  .netmap-node--core .netmap-node__pulsering { animation: none !important; opacity: 0; }
  .netmap-node--core.is-ack .netmap-node__body { animation: none; }
  .netmap-node[data-node].is-anomaly .netmap-node__ring { animation: none; opacity: 1; }
  .netmap-pulse { display: none; }
}

/* ---------- Il problema: stripe con lampeggio rosso prima dell'assestamento ---------- */
.problem-stats { position: relative; padding: 90px 0; background: var(--navy-dark); overflow: hidden; text-align: center; }
.problem-stats__grid-bg {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  animation: problem-grid-drift 14s linear infinite;
}
@keyframes problem-grid-drift { from { background-position: 0 0, 0 0; } to { background-position: 42px 42px, 42px 42px; } }

.problem-stats .eyebrow { color: var(--orange); }
.problem-stats h2 { color: var(--white); font-size: 1.5rem; max-width: 680px; margin: 10px auto 0; }
.problem-stats__row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 44px; align-items: start; }
.problem-stats__group--big .problem-stats__num { font-size: 3rem; }
.problem-stats__items { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.problem-stats__num {
  font-size: 2.6rem; font-weight: 800; color: var(--white); font-variant-numeric: tabular-nums;
  transition: color .25s ease;
}
.problem-stats__num--static { font-size: 2.6rem; }
.problem-stats__num.is-alert { color: #ff5a3c; text-shadow: 0 0 14px rgba(255,90,60,.6); }
.problem-stats__label { font-size: .85rem; color: rgba(255,255,255,.6); line-height: 1.5; margin-top: 6px; }
.problem-stats__source { font-size: .75rem; color: rgba(255,255,255,.4); margin-top: 16px; }
.problem-stats__closing { max-width: 720px; margin: 44px auto 0; color: rgba(255,255,255,.75); font-size: 1rem; line-height: 1.7; }

@media (max-width: 860px) {
  .problem-stats__row { grid-template-columns: 1fr; gap: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .problem-stats__grid-bg { animation: none; }
}

/* ---------- Due ambiti di copertura ---------- */
.coverage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; }
.coverage-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 28px; }
.coverage-panel__art { display: flex; justify-content: center; margin-bottom: 18px; }
.coverage-panel__art svg { width: 100%; max-width: 220px; height: auto; overflow: visible; color: var(--orange); }
.coverage-panel h3 { font-size: 1.1rem; margin: 6px 0 10px; }
.coverage-panel p { font-size: .92rem; color: var(--text-muted); line-height: 1.65; }

.coverage-router { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.coverage-timer__ring { fill: none; stroke: var(--border); stroke-width: 3; }
.coverage-timer__num { font-size: 15px; font-weight: 800; fill: var(--navy-dark); }
.coverage-ticket { fill: var(--white); stroke: var(--orange); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); }
.coverage-ticket__check { fill: none; stroke: #2ecc71; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.coverage-ticket.is-open { opacity: 1; transform: scale(1); transition: opacity .3s ease, transform .3s cubic-bezier(.34,1.56,.64,1); }
.coverage-ticket.is-open .coverage-ticket__check { stroke-dashoffset: 0; transition: stroke-dashoffset .35s ease .1s; }

.coverage-radar__ring { fill: none; stroke: var(--border); stroke-width: 1.4; }
.coverage-radar__sweep { fill: rgba(255,130,0,.16); }
.reveal.visible .coverage-radar { animation: coverage-radar-spin 6s linear infinite; transform-box: fill-box; transform-origin: 80px 70px; }
@keyframes coverage-radar-spin { to { transform: rotate(360deg); } }
.coverage-device { fill: none; stroke: var(--navy-mid); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes coverage-device-sweep {
  0%, 6%, 100% { stroke: var(--navy-mid); filter: none; }
  2% { stroke: var(--orange); filter: drop-shadow(0 0 4px rgba(255,130,0,.55)); }
}
/* Ogni dispositivo si illumina quando il raggio del radar lo attraversa: il
   ritardo corrisponde alla sua posizione angolare rispetto al centro,
   nello stesso ordine del markup (centro, alto sx, alto dx, basso sx,
   basso dx), sincronizzato con la rotazione di 6s di .coverage-radar. */
.reveal.visible .coverage-device { animation: coverage-device-sweep 6s linear infinite; }
/* :nth-of-type conta tutti i <g> fratelli, incluso .coverage-radar che
   precede i dispositivi nel markup: i dispositivi sono quindi il 2°-6°
   <g>, non il 1°-5°. */
.reveal.visible .coverage-device:nth-of-type(2) { animation-delay: 0s; }
.reveal.visible .coverage-device:nth-of-type(3) { animation-delay: 5.03s; }
.reveal.visible .coverage-device:nth-of-type(4) { animation-delay: .97s; }
.reveal.visible .coverage-device:nth-of-type(5) { animation-delay: 3.91s; }
.reveal.visible .coverage-device:nth-of-type(6) { animation-delay: 2.09s; }

.coverage-scope { text-align: center; max-width: 760px; margin: 36px auto 0; font-size: .9rem; color: var(--text-muted); }

@media (max-width: 860px) { .coverage-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .reveal.visible .coverage-radar { animation: none; }
  .coverage-ticket, .coverage-ticket__check { transition: none; }
}

/* ---------- Punti di forza: bento grid (stesso pattern spotlight + stroke-draw) ---------- */
.track-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.track-bento__card {
  position: relative; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.track-bento__card:hover, .track-bento__card.is-touched { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(255,130,0,.35); }
.track-bento__card h3 { font-size: 1.05rem; }
.track-bento__card p { font-size: .88rem; color: var(--text-muted); line-height: 1.6; }

.track-bento__card .service-icon svg [pathLength] {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .7s ease; transition-delay: calc(var(--i,0) * .1s);
}
.reveal.visible .track-bento__card .service-icon svg [pathLength].is-drawn { stroke-dashoffset: 0; }

@media (max-width: 960px) { .track-bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .track-bento { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .track-bento__card { transition: none; }
  .track-bento__card .service-icon svg [pathLength] { stroke-dasharray: none; stroke-dashoffset: 0; transition: none; }
}

/* ---------- Chiusura ---------- */
.hitrack-closing {
  max-width: 640px; margin: 52px auto 0; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.hitrack-closing .live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 0 rgba(46,204,113,.6); animation: sec-live-pulse 2.2s infinite; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  .hitrack-closing .live-dot { animation: none; box-shadow: none; }
}
