/**
 * styles.css — Vektora Cyber Solutions · Forensics & Malware Removal
 * ════════════════════════════════════════════════════════════════
 * Identità cromatica volutamente distinta dal resto dei progetti Vektora
 * (nessun oro/nero da brand principale): base scura verde-petrolio,
 * accento verde tecnico. Tono "security/incident response" calmo,
 * non hacker-cliché. Segue lo standard Vektora: variabili di tema in
 * :root, dark/light mode, fade-in via Intersection Observer,
 * prefers-reduced-motion sempre rispettato.
 */

:root {
  --sfondo:       #0B1210;
  --sfondo-card:  #121B18;
  --bordo:        rgba(62, 146, 104, 0.25);
  --testo:        #E7EDE9;
  --testo-soft:   #9FB3A9;
  --accento:      #3E9268;   /* verde tecnico — invariato tra i temi */
  --accento-2:    #2A9D8F;   /* petrolio — dettagli secondari, gradienti */
  --su-accento:   #06110C;   /* testo sopra un fondo pieno accento */
  --font-body:    'Inter', -apple-system, sans-serif;
}

:root[data-theme="light"] {
  --sfondo:       #F3F7F4;
  --sfondo-card:  #E6EFE9;
  --bordo:        rgba(44, 107, 73, 0.2);
  --testo:        #142019;
  --testo-soft:   #4B5D53;
  --accento:      #2C6B49;   /* più scuro: contrasto AA su sfondo chiaro */
  --accento-2:    #1F7A70;
  --su-accento:   #F3F7F4;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --sfondo:       #F3F7F4;
    --sfondo-card:  #E6EFE9;
    --bordo:        rgba(44, 107, 73, 0.2);
    --testo:        #142019;
    --testo-soft:   #4B5D53;
    --accento:      #2C6B49;
    --accento-2:    #1F7A70;
    --su-accento:   #F3F7F4;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body, header, footer, nav, section, div, p, h1, h2, h3, h4, h5, h6, span, a, li, ul {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--sfondo);
  color: var(--testo);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.text-accento   { color: var(--accento); }
.hover\:text-accento:hover { color: var(--accento) !important; }
.bg-accento     { background-color: var(--accento); }
.border-accento { border-color: var(--accento); }

.divider {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--accento);
  margin: 0 auto;
}

/* ═══ SFONDO DECORATIVO — animato, dietro l'intera pagina (come Vektora) ═══
   Iniettato da js/script.js su tutte le pagine, come <div> nel documento
   stesso — NON un iframe: il protocollo file:// (apertura diretta del
   file, senza server) blocca il caricamento di un iframe che punta a un
   altro file locale, quindi l'animazione restava vuota. Da inline invece
   funziona identico sia con doppio click sia su server. Segue il tema
   della pagina automaticamente (stesse variabili --accento/--sfondo),
   nessun handshake via postMessage necessario. Le sezioni sopra restano
   trasparenti per lasciarlo intravedere; le card/i form mantengono uno
   sfondo pieno per la leggibilità del testo. */
#vkf-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

/* Bagliore centrale. Di norma è il <canvas> .vkf-bg__glow-baked: il blur da
   75px viene applicato UNA volta sola in JS (initDecorBackground) e poi
   animato solo con transform/opacity (composited, nessun filter per frame).
   Il <div> .vkf-bg__glow con filter:blur resta come fallback per i browser
   senza ctx.filter e viene rimosso dal JS quando il bake riesce. */
.vkf-bg__glow,
.vkf-bg__glow-baked {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  --glow-alpha: 0.22;
  opacity: var(--glow-alpha);
  animation: vkf-bg-pulse 6s ease-in-out infinite alternate;
}
.vkf-bg__glow {
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle at center, var(--accento) 0%, rgba(62, 146, 104, 0.05) 55%, transparent 75%);
  filter: blur(75px);
}
:root[data-theme="light"] .vkf-bg__glow,
:root[data-theme="light"] .vkf-bg__glow-baked { --glow-alpha: 0.14; }

/* Come il prototipo: oltre alla scala pulsa anche l'intensità (× 1.3). */
@keyframes vkf-bg-pulse {
  0%   { transform: translate(-50%, -50%) scale(0.9);  opacity: var(--glow-alpha); }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: calc(var(--glow-alpha) * 1.3); }
}

/* Archi tratteggiati statici (SVG). I raggi che marciano sono disegnati nel
   canvas, vedi drawRays() in js/script.js. */
.vkf-bg__rays { position: absolute; inset: 0; width: 100%; height: 100%; }
.vkf-bg__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .vkf-bg__glow, .vkf-bg__glow-baked { animation: none !important; }
}

/* Le sezioni con ancora nel nav hanno bisogno di margine per la navbar fissa */
section[id] { scroll-margin-top: 88px; }

/* ═══ NAVBAR ═══ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
#navbar.scrolled {
  background: linear-gradient(to bottom, var(--sfondo) 0%, color-mix(in srgb, var(--sfondo) 90%, transparent) 100%);
  box-shadow: 0 1px 0 var(--bordo);
}
#mobile-menu { display: none; }
#mobile-menu.open { display: flex; }

/* ═══ BOTTONI ═══ */
.btn-accento {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--accento);
  color: var(--su-accento);
  border: 1px solid var(--accento);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  cursor: pointer;
}
.btn-accento:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(62,146,104,0.25); opacity: 0.94; }
.btn-accento:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: transparent;
  color: var(--testo);
  border: 1px solid var(--bordo);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.btn-outline:hover { transform: translateY(-1px); border-color: var(--accento); }

/* ═══ SEZIONI / CARD ═══ */
.section-pad { padding: 5.5rem 1.5rem; }
@media (max-width: 768px) { .section-pad { padding: 3.5rem 1.25rem; } }

.card-vektora {
  background: var(--sfondo-card);
  border: 1px solid var(--bordo);
  border-radius: 12px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.card-vektora:hover {
  border-color: var(--accento);
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(62,146,104,0.14);
}

/* ═══ FAQ (accordion nativo, nessun JS necessario) ═══ */
.faq-item {
  background: var(--sfondo-card);
  border: 1px solid var(--bordo);
  border-radius: 10px;
  padding: 0.25rem 0;
  margin-bottom: 0.75rem;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--accento);
  transition: transform 0.25s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 1.25rem 1.1rem;
  color: var(--testo-soft);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* ═══ TIMELINE "Come lavoro" ═══ */
.step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accento);
  color: var(--accento);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}

/* ═══ FORM (sezione aziende) ═══ */
.form-field {
  width: 100%;
  background: var(--sfondo);
  border: 1px solid var(--bordo);
  color: var(--testo);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
}
.form-field:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }
.form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--testo-soft);
  margin-bottom: 0.35rem;
  display: block;
}
/* Honeypot anti-spam: nascosto a schermo, visibile agli screen reader solo se un bot lo compila */
.hp-field { position: absolute; left: -9999px; }

/* ═══ FOCUS VISIBILE (accessibilità) ═══ */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: 2px;
}

/* ═══ SCROLL ANIMATIONS ═══ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal-hero > * {
  opacity: 0;
  animation: reveal-up 0.8s ease forwards;
}
.reveal-hero > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-hero > *:nth-child(2) { animation-delay: 0.15s; }
.reveal-hero > *:nth-child(3) { animation-delay: 0.25s; }
.reveal-hero > *:nth-child(4) { animation-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .fade-in { opacity: 1; transform: none; }
  .reveal-hero > * { opacity: 1; transform: none; }
}

/* ═══ WHATSAPP FLOAT ═══ */
#wa-float {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 90;
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.25s;
}
#wa-float:hover { transform: scale(1.08); }

/* ═══ THEME TOGGLE ═══ */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accento);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle svg { width: 16px; height: 16px; color: var(--accento); }
