/* ============================================================
   CSDEVELOPER — Design System "Deep Space"
   Estensioni custom a Tailwind CSS (CDN): neon, glow, nebulose.
   Zero dipendenze JS pesanti: solo CSS3 puro per le animazioni.
   ============================================================ */

:root {
  --space-black: #030308;
  --space-deep: #070712;
  --alien-green: #00ff66;
  --cyber-cyan: #00e5ff;
  --galaxy-violet: #a855f7;
  --plasma-pink: #ff2ec4;
  --star-white: #e8f4ff;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--space-black);
  color: var(--star-white);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

::selection {
  background: var(--alien-green);
  color: #02120a;
}

/* ---------- Font display futuristici ---------- */
.font-orbitron { font-family: 'Orbitron', 'Inter', sans-serif; }
.font-mono-tech { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- Nebulosa spaziale (sfondo animato CSS puro) ---------- */
.nebula-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 15% 10%, rgba(168, 85, 247, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 25%, rgba(0, 229, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 55% 50% at 50% 90%, rgba(0, 255, 102, 0.10), transparent 65%),
    var(--space-black);
  animation: nebula-drift 40s ease-in-out infinite alternate;
}

@keyframes nebula-drift {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; }
  50%  { background-position: 10% 5%, 90% 10%, 45% 90%, 0 0; }
  100% { background-position: -5% 10%, 100% -5%, 55% 100%, 0 0; }
}

/* Polvere stellare: puntini generati con box-shadow multipli, costo GPU ~0 */
.starfield,
.starfield::before,
.starfield::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  background-repeat: repeat;
}

.starfield {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(0,229,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 250px 150px, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 380px 60px, rgba(0,255,102,.55), transparent),
    radial-gradient(1px 1px at 90px 220px, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 320px 300px, rgba(168,85,247,.5), transparent);
  background-size: 420px 420px;
  animation: stars-twinkle 6s ease-in-out infinite alternate;
}

.starfield::before {
  background-image:
    radial-gradient(1px 1px at 60px 120px, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 200px 40px, rgba(0,255,102,.4), transparent),
    radial-gradient(1px 1px at 340px 200px, rgba(0,229,255,.45), transparent);
  background-size: 500px 500px;
  animation: stars-twinkle 9s ease-in-out infinite alternate-reverse;
}

@keyframes stars-twinkle {
  from { opacity: .55; }
  to   { opacity: 1; }
}

/* Alone luminoso che segue il mouse (posizionato via JS con CSS vars) */
.mouse-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,102,.10), rgba(0,229,255,.05) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity .4s ease;
  will-change: transform;
}

/* ---------- Tipografia neon ---------- */
.neon-text-green {
  color: var(--alien-green);
  text-shadow:
    0 0 6px rgba(0,255,102,.9),
    0 0 18px rgba(0,255,102,.55),
    0 0 42px rgba(0,255,102,.35);
}

.neon-text-cyan {
  color: var(--cyber-cyan);
  text-shadow:
    0 0 6px rgba(0,229,255,.9),
    0 0 18px rgba(0,229,255,.5),
    0 0 42px rgba(0,229,255,.3);
}

.neon-text-violet {
  color: var(--galaxy-violet);
  text-shadow:
    0 0 6px rgba(168,85,247,.9),
    0 0 20px rgba(168,85,247,.5),
    0 0 46px rgba(168,85,247,.3);
}

.neon-flicker {
  animation: neon-flicker 4.5s linear infinite;
}

@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  3%  { opacity: .82; }
  6%  { opacity: 1; }
  52% { opacity: 1; }
  54% { opacity: .75; }
  56% { opacity: 1; }
}

/* Gradiente alieno per titoli */
.text-gradient-alien {
  background: linear-gradient(100deg, var(--alien-green) 0%, var(--cyber-cyan) 45%, var(--galaxy-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(0,255,102,.35));
}

/* ---------- Card olografiche ---------- */
.holo-card {
  position: relative;
  background: linear-gradient(160deg, rgba(14,18,34,.85), rgba(7,7,18,.92));
  border: 1px solid rgba(0,229,255,.18);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s ease, box-shadow .35s ease;
  overflow: hidden;
}

.holo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(0,255,102,.08) 48%, rgba(0,229,255,.10) 52%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s ease;
  pointer-events: none;
}

.holo-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0,255,102,.55);
  box-shadow:
    0 0 0 1px rgba(0,255,102,.25),
    0 8px 40px rgba(0,255,102,.18),
    0 0 80px rgba(0,229,255,.10);
}

.holo-card:hover::before {
  transform: translateX(120%);
}

/* Bordo che si accende (effetto "circuito") */
.circuit-border {
  position: relative;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,255,102,.7), rgba(0,229,255,.4) 40%, rgba(168,85,247,.6) 80%);
  background-size: 250% 250%;
  animation: circuit-flow 6s linear infinite;
}

@keyframes circuit-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.circuit-border > .circuit-inner {
  background: rgba(5,6,16,.96);
  border-radius: calc(1rem - 1px);
  height: 100%;
}

/* ---------- Pulsanti "accensione astronave" ---------- */
.btn-plasma {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #02120a;
  background: linear-gradient(100deg, var(--alien-green), var(--cyber-cyan));
  box-shadow: 0 0 18px rgba(0,255,102,.45), 0 0 46px rgba(0,255,102,.18);
  transition: box-shadow .3s ease, transform .3s ease, filter .3s ease;
  isolation: isolate;
}

.btn-plasma:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.12);
  box-shadow:
    0 0 26px rgba(0,255,102,.8),
    0 0 70px rgba(0,255,102,.4),
    0 0 120px rgba(0,229,255,.25);
}

.btn-ghost-neon {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  color: var(--cyber-cyan);
  border: 1px solid rgba(0,229,255,.45);
  background: rgba(0,229,255,.05);
  transition: all .3s ease;
}

.btn-ghost-neon:hover {
  color: #021218;
  background: var(--cyber-cyan);
  box-shadow: 0 0 24px rgba(0,229,255,.6), 0 0 60px rgba(0,229,255,.25);
}

/* ---------- Pulsante WhatsApp "UFO" ---------- */
.ufo-whatsapp {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 60;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #0aff8a, #00b34a 60%, #015c26);
  box-shadow:
    0 0 20px rgba(0,255,102,.7),
    0 0 60px rgba(0,255,102,.35),
    inset 0 -6px 14px rgba(0,0,0,.45);
  animation: ufo-pulse 2.6s ease-in-out infinite;
  transition: transform .3s ease;
}

.ufo-whatsapp:hover {
  transform: scale(1.12) rotate(-6deg);
}

.ufo-whatsapp::after {
  /* raggio traente */
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 46px;
  height: 70px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(0,255,102,.35), transparent 80%);
  clip-path: polygon(28% 0, 72% 0, 100% 100%, 0 100%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}

.ufo-whatsapp:hover::after { opacity: 1; }

@keyframes ufo-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,255,102,.7), 0 0 60px rgba(0,255,102,.3), inset 0 -6px 14px rgba(0,0,0,.45); }
  50%      { box-shadow: 0 0 34px rgba(0,255,102,.95), 0 0 90px rgba(0,255,102,.5), inset 0 -6px 14px rgba(0,0,0,.45); }
}

/* ---------- Reveal on scroll (attivato da JS con IntersectionObserver) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .neon-flicker, .starfield, .starfield::before, .nebula-bg, .ufo-whatsapp { animation: none !important; }
}

/* ---------- Linee di sezione "scroll-driven" ---------- */
.scanline-title {
  position: relative;
  display: inline-block;
}

.scanline-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -10px;
  height: 3px;
  width: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--alien-green), var(--cyber-cyan), transparent);
  box-shadow: 0 0 12px rgba(0,255,102,.7);
  transform-origin: left;
  animation: scanline-grow linear both;
  animation-timeline: view();
  animation-range: entry 10% cover 40%;
}

@supports not (animation-timeline: view()) {
  .scanline-title::after { transform: scaleX(1); }
}

@keyframes scanline-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ---------- FAQ "ologramma" ---------- */
.faq-item {
  border: 1px solid rgba(0,229,255,.18);
  border-radius: .9rem;
  background: rgba(10,12,26,.7);
  backdrop-filter: blur(8px);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.faq-item[open] {
  border-color: rgba(0,255,102,.5);
  box-shadow: 0 0 30px rgba(0,255,102,.12), inset 0 0 40px rgba(0,229,255,.04);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.4rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary .faq-icon {
  color: var(--alien-green);
  text-shadow: 0 0 10px rgba(0,255,102,.8);
  transition: transform .35s ease;
  font-size: 1.3rem;
  line-height: 1;
}

.faq-item[open] summary .faq-icon { transform: rotate(45deg); }

.faq-item .faq-body {
  padding: 0 1.4rem 1.2rem;
  color: #b9c6dd;
  animation: holo-in .45s ease;
}

@keyframes holo-in {
  from { opacity: 0; transform: translateY(-8px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* ---------- Form multi-step olografico ---------- */
.form-step {
  display: none;
  animation: holo-in .5s ease;
}

.form-step.active { display: block; }

.holo-input {
  width: 100%;
  background: rgba(5,8,20,.85);
  border: 1px solid rgba(0,229,255,.25);
  border-radius: .65rem;
  padding: .85rem 1.1rem;
  color: var(--star-white);
  transition: border-color .3s ease, box-shadow .3s ease;
}

.holo-input:focus {
  outline: none;
  border-color: var(--alien-green);
  box-shadow: 0 0 0 1px rgba(0,255,102,.5), 0 0 24px rgba(0,255,102,.18);
}

.holo-input.input-error {
  border-color: #ff4d6d;
  box-shadow: 0 0 0 1px rgba(255,77,109,.5), 0 0 20px rgba(255,77,109,.2);
}

.error-msg {
  color: #ff7a93;
  font-size: .82rem;
  margin-top: .35rem;
  display: none;
  text-shadow: 0 0 8px rgba(255,77,109,.5);
}

.weapon-card {
  cursor: pointer;
  border: 1px solid rgba(0,229,255,.2);
  border-radius: .9rem;
  padding: 1.2rem;
  text-align: center;
  background: rgba(8,10,24,.75);
  transition: all .3s ease;
}

.weapon-card:hover { border-color: rgba(0,229,255,.6); transform: translateY(-3px); }

.weapon-card.selected {
  border-color: var(--alien-green);
  background: rgba(0,255,102,.08);
  box-shadow: 0 0 26px rgba(0,255,102,.28), inset 0 0 30px rgba(0,255,102,.06);
}

.progress-track {
  height: 6px;
  border-radius: 9999px;
  background: rgba(0,229,255,.12);
  overflow: hidden;
}

.progress-bar-neon {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--alien-green), var(--cyber-cyan));
  box-shadow: 0 0 14px rgba(0,255,102,.8);
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

/* ---------- Badge / chip ---------- */
.chip-neon {
  display: inline-block;
  padding: .28rem .85rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--alien-green);
  border: 1px solid rgba(0,255,102,.4);
  background: rgba(0,255,102,.07);
  text-shadow: 0 0 8px rgba(0,255,102,.6);
}

/* ---------- Nav glass ---------- */
.nav-glass {
  background: rgba(4,5,14,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,229,255,.14);
}

.nav-link {
  position: relative;
  color: #c6d4ea;
  transition: color .25s ease, text-shadow .25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--alien-green);
  box-shadow: 0 0 10px rgba(0,255,102,.8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--alien-green);
  text-shadow: 0 0 12px rgba(0,255,102,.6);
}

.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* ---------- Effetto filtro neon immagini (attivato da JS) ---------- */
.neon-filter-green  { filter: hue-rotate(90deg) saturate(1.6) brightness(1.05); transition: filter .6s ease; }
.neon-filter-cyan   { filter: hue-rotate(160deg) saturate(1.5) brightness(1.05); transition: filter .6s ease; }
.neon-filter-violet { filter: hue-rotate(240deg) saturate(1.7) brightness(1.02); transition: filter .6s ease; }

.img-glow-frame {
  border-radius: 1rem;
  border: 1px solid rgba(0,229,255,.25);
  box-shadow: 0 0 30px rgba(0,229,255,.12), 0 20px 60px rgba(0,0,0,.5);
}

/* ---------- Griglia HUD decorativa ---------- */
.hud-grid {
  background-image:
    linear-gradient(rgba(0,229,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 30%, transparent 75%);
}

/* Raggio traente hero */
.tractor-beam {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(560px, 80vw);
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,255,102,.16), rgba(0,229,255,.05) 55%, transparent 90%);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  filter: blur(6px);
  animation: beam-sway 9s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes beam-sway {
  from { transform: translateX(-52%) rotate(-1.2deg); opacity: .8; }
  to   { transform: translateX(-48%) rotate(1.2deg); opacity: 1; }
}

/* Typing cursor */
.type-cursor::after {
  content: '▌';
  color: var(--alien-green);
  animation: cursor-blink 1s steps(1) infinite;
}

@keyframes cursor-blink { 50% { opacity: 0; } }

/* Scrollbar aliena */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #05060f; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--alien-green), var(--cyber-cyan));
  border-radius: 9999px;
}
