@property --btn-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --nero: #030303; --navy: #0a111e; --navy-light: #0f1a2e;
  --blu-scuro: #1035B0; --blu-medio: #2680E9; --ciano: #3EC8F7;
  --ghiaccio: #e8f4ff; --ciano-vivid: #4FE3FF; --oro: #f5c842;
  --testo-secondario: #8aa4c8; --testo-dim: #4a6c96;
  --bordo: rgba(62, 200, 247, 0.14); --bordo-hover: rgba(79, 227, 255, 0.55);
  --radius: 18px; --radius-sm: 12px; --radius-pill: 100px; --max: 1200px;
  --shadow-md: 0 12px 40px rgba(0,0,0,0.5);
  --grad-brand: linear-gradient(135deg, #2680E9 0%, #4FE3FF 100%);
  --success: #22d3a0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--nero); color: var(--ghiaccio);
  line-height: 1.65; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(1000px 700px at 12% -8%, rgba(16,53,176,0.28), transparent 60%),
    radial-gradient(900px 600px at 100% 5%, rgba(62,200,247,0.18), transparent 55%),
    radial-gradient(800px 700px at 50% 110%, rgba(38,128,233,0.16), transparent 60%);
}

#particle-canvas {
  position: fixed; inset: 0; z-index: -2;
  pointer-events: none; opacity: 0.85;
}

body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
}
h1 { font-size: clamp(34px, 5.5vw, 58px); letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.025em; }
h3 { font-size: 20px; letter-spacing: -0.015em; }

/* ═══ HEADER ═══ */
header {
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 1000; padding: 14px 0;
  background: rgba(3, 3, 3, 0.78);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--bordo);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.logo-container { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.logo-wrap { position: relative; width: 52px; height: 52px; display: grid; place-items: center; flex-shrink: 0; }
.logo-wrap::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(79, 227, 255, 0.9) 25%, transparent 50%, rgba(38, 128, 233, 0.9) 75%, transparent 100%);
  animation: logoSpin 6s linear infinite; opacity: 0.9;
}
.logo-wrap::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--nero); }
@keyframes logoSpin { to { transform: rotate(360deg); } }
.logo-svg {
  width: 40px; height: 40px; position: relative; z-index: 2;
  filter: drop-shadow(0 0 12px rgba(79, 227, 255, 0.8)) drop-shadow(0 0 24px rgba(38, 128, 233, 0.5));
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), filter 0.5s;
}
.logo-container:hover .logo-svg {
  transform: rotate(8deg) scale(1.12);
  filter: drop-shadow(0 0 20px rgba(79, 227, 255, 1)) drop-shadow(0 0 40px rgba(38, 128, 233, 0.7));
}
.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700; letter-spacing: 1.8px;
  background: linear-gradient(120deg, #ffffff 0%, #4FE3FF 50%, #2680E9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: logoShine 4s ease-in-out infinite;
}
@keyframes logoShine { 0%, 100% { background-position: 0% center; } 50% { background-position: 100% center; } }

nav { display: flex; gap: 6px; align-items: center; }
nav a.nav-link {
  color: var(--testo-secondario); text-decoration: none; font-weight: 500; font-size: 14.5px;
  padding: 9px 14px; border-radius: 10px; transition: color 0.25s, background 0.25s;
}
nav a.nav-link:hover { color: var(--ciano-vivid); background: rgba(79, 227, 255, 0.07); }

.nav-auth-group { display: flex; align-items: center; gap: 10px; margin-left: 8px; }

.btn-auth-login,
.btn-auth-register {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 700;
  text-decoration: none; transition: all 0.25s;
}
.btn-auth-login {
  background: rgba(10, 17, 30, 0.75); color: var(--ciano-vivid);
  border: 1px solid rgba(79, 227, 255, 0.45); backdrop-filter: blur(10px);
}
.btn-auth-login:hover { color: #fff; border-color: var(--ciano-vivid); background: rgba(79, 227, 255, 0.12); }
.btn-auth-register {
  background: var(--grad-brand); color: #02121d; border: none;
  box-shadow: 0 6px 18px rgba(38, 128, 233, 0.35);
}
.btn-auth-register:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(79, 227, 255, 0.5); }
.btn-auth-dashboard {
  color: var(--testo-secondario); padding: 9px 14px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; text-decoration: none;
  transition: color 0.25s, background 0.25s; display: inline-flex; align-items: center;
}
.btn-auth-dashboard:hover { color: var(--ciano-vivid); background: rgba(79, 227, 255, 0.07); }
.btn-auth-logout {
  display: none; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  color: #ff5252; border: 1px solid rgba(255,82,82,0.4);
  background: rgba(255,82,82,0.08); cursor: pointer; transition: all 0.25s;
}
.btn-auth-logout:hover { background: rgba(255,82,82,0.2); color: #fff; }

body.logged-in .btn-auth-login, body.logged-in .btn-auth-register { display: none !important; }
body.logged-in .btn-auth-logout { display: inline-flex !important; }
body.logged-in .btn-auth-dashboard { display: inline-flex !important; }
body.not-logged-in .btn-auth-logout, body.not-logged-in .btn-auth-dashboard { display: none !important; }
body.not-logged-in .btn-auth-login, body.not-logged-in .btn-auth-register { display: inline-flex !important; }
body.logged-in .price-blurred, body.logged-in .price.price-blurred { filter: none !important; user-select: auto !important; }
body:not(.logged-in):not(.not-logged-in) .btn-auth-logout,
body:not(.logged-in):not(.not-logged-in) .btn-auth-dashboard { display: none; }

@media (max-width: 860px) { nav a.nav-link { display: none; } }
@media (max-width: 560px) {
  .btn-auth-login, .btn-auth-dashboard { display: none !important; }
  .logo-text { font-size: 20px; letter-spacing: 1.2px; }
  .logo-wrap { width: 44px; height: 44px; }
  .logo-svg { width: 34px; height: 34px; }
}

/* ═══ LAYOUT ═══ */
.page-wrap { max-width: var(--max); margin: 0 auto; padding: 130px 24px 80px; }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--testo-secondario);
  padding: 10px 20px; border-radius: 50px;
  text-decoration: none; font-weight: 500; font-size: 14px;
  border: 1px solid var(--bordo); transition: all 0.25s; margin-bottom: 40px;
}
.back-btn:hover { color: var(--ciano-vivid); border-color: var(--ciano-vivid); transform: translateX(-3px); }

.page-header {
  text-align: center; margin-bottom: 40px;
  max-width: 760px; margin-left: auto; margin-right: auto;
}
.page-header h1 { color: var(--ghiaccio); margin-bottom: 18px; }
.page-header h1 span {
  background: linear-gradient(120deg, #4FE3FF 0%, #2680E9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-header p { font-size: 18px; color: var(--testo-secondario); line-height: 1.75; }

/* CTA Configuratore */
.cta-configuratore {
  text-align: center; margin: 32px auto 80px;
  padding: 32px 28px; max-width: 760px;
  background: linear-gradient(135deg, rgba(38,128,233,0.12), rgba(79,227,255,0.05));
  border: 1px solid rgba(79, 227, 255, 0.3);
  border-radius: var(--radius); position: relative; overflow: hidden;
}
.cta-configuratore::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 227, 255, 0.7), transparent);
}
.cta-configuratore p {
  color: var(--testo-secondario); font-size: 15.5px;
  margin-bottom: 20px; line-height: 1.7;
}
.btn-configuratore {
  position: relative; display: inline-flex;
  align-items: center; justify-content: center; gap: 10px;
  padding: 16px 36px; border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700;
  text-decoration: none; background: var(--grad-brand); color: #02121d;
  isolation: isolate; transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 10px 30px rgba(38, 128, 233, 0.4);
  border: none; cursor: pointer;
}
.btn-configuratore::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--btn-angle), transparent 0%, rgba(79, 227, 255, 0.95) 12%, transparent 25%, transparent 50%, rgba(38, 128, 233, 0.95) 62%, transparent 75%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: btnSpin 4s linear infinite; opacity: 0.75; pointer-events: none;
}
@keyframes btnSpin { to { --btn-angle: 360deg; } }
.btn-configuratore:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(79, 227, 255, 0.5); }
.btn-configuratore:hover::before { opacity: 1; animation-duration: 1.6s; }

/* ═══ CATEGORIE ═══ */
.category { margin-bottom: 90px; }
.category-label {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--ciano-vivid);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 32px;
}
.category-label::before {
  content: ''; display: block; width: 36px; height: 3px;
  background: linear-gradient(90deg, var(--blu-medio), var(--ciano-vivid));
  border-radius: 2px; box-shadow: 0 0 16px rgba(79, 227, 255, 0.7);
}
.category-label .count {
  font-size: 13px; font-weight: 600; color: var(--testo-dim);
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: rgba(79, 227, 255, 0.06);
  border: 1px solid rgba(79, 227, 255, 0.2);
  letter-spacing: 0.05em;
}

.prezzi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 22px;
}

/* ═══ CARD ═══ */
.card {
  background: linear-gradient(180deg, var(--navy-light), var(--navy));
  padding: 30px 26px; border-radius: var(--radius);
  border: 1px solid var(--bordo);
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), border-color 0.4s, box-shadow 0.4s;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-brand); opacity: 0; transition: opacity 0.4s;
}
.card:hover {
  transform: translateY(-6px); border-color: var(--bordo-hover);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 40px rgba(79, 227, 255, 0.12);
}
.card:hover::before { opacity: 1; }
.card-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, rgba(38,128,233,0.25), rgba(79,227,255,0.15));
  border: 1px solid rgba(79, 227, 255, 0.3);
}
.card h4 { color: var(--ghiaccio); font-size: 17px; line-height: 1.3; margin-top: 4px; }
.card-desc {
  color: var(--testo-secondario); font-size: 13.5px;
  line-height: 1.6; flex: 1;
}

.price-wrap {
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap; margin-top: 6px;
}
.price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 800;
  background: linear-gradient(180deg, #ffffff 40%, #8aa4c8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.03em; line-height: 1;
  transition: filter 0.3s ease;
}
.price-prefix { font-family: 'Inter', sans-serif; font-size: 13px; color: var(--testo-dim); font-weight: 500; }
.price-suffix { font-family: 'Inter', sans-serif; font-size: 14px; color: var(--testo-secondario); font-weight: 500; }
.price-blurred { filter: blur(5px); user-select: none; }

.btn-card {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 700;
  text-decoration: none;
  border: 1.5px solid rgba(79, 227, 255, 0.4);
  background: rgba(10, 17, 30, 0.75);
  color: var(--ciano-vivid);
  cursor: pointer; transition: all 0.25s;
  width: 100%;
}
.btn-card:hover {
  background: rgba(38, 128, 233, 0.15); color: #fff;
  border-color: var(--ciano-vivid);
  box-shadow: 0 8px 24px rgba(79, 227, 255, 0.25);
}

/* ═══ CARD PACCHETTO ═══ */
.card-pack {
  border-color: rgba(245, 200, 66, 0.4);
  background: linear-gradient(160deg, #1a1400 0%, var(--navy) 100%);
  position: relative;
}
.card-pack::before {
  opacity: 1 !important;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
}
.card-pack .badge-pack {
  position: absolute; top: -1px; right: 20px;
  background: linear-gradient(135deg, #e0a800, var(--oro));
  color: #1a1400; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 0 0 10px 10px;
  box-shadow: 0 6px 16px rgba(245, 200, 66, 0.4);
}
.card-pack .price-old {
  font-size: 14px; color: var(--testo-dim);
  text-decoration: line-through; margin-bottom: 2px;
}
.card-pack .price {
  background: linear-gradient(180deg, #f5c842 40%, #b89200 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card-pack .risparmio {
  display: inline-block; font-size: 12px; font-weight: 700;
  color: var(--success); padding: 4px 12px;
  background: rgba(34, 211, 160, 0.1);
  border: 1px solid rgba(34, 211, 160, 0.3);
  border-radius: var(--radius-pill);
  margin-top: 6px; align-self: flex-start;
}
.btn-card-gold {
  background: linear-gradient(135deg, #e0a800 0%, var(--oro) 100%);
  color: #1a1400; border: none;
  box-shadow: 0 8px 24px rgba(245, 200, 66, 0.35);
}
.btn-card-gold:hover {
  color: #1a1400;
  background: linear-gradient(135deg, #f5c842 0%, #ffdd66 100%);
  box-shadow: 0 12px 32px rgba(245, 200, 66, 0.55);
}

/* ═══ BANNER LOGIN ═══ */
.login-prompt-banner {
  margin-top: 40px;
  background: linear-gradient(135deg, rgba(38,128,233,0.12), rgba(79,227,255,0.06));
  border: 1px solid rgba(79, 227, 255, 0.3);
  border-radius: var(--radius);
  padding: 22px 28px; text-align: center;
  color: var(--testo-secondario); font-size: 14.5px;
  transition: opacity 0.3s;
}
.login-prompt-banner a {
  color: var(--ciano-vivid); font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 227, 255, 0.5);
}

/* ═══ NOTA FINALE ═══ */
.final-note {
  text-align: center; margin-top: 80px;
  padding: 54px 36px;
  background: linear-gradient(180deg, var(--navy-light), var(--navy));
  border-radius: var(--radius);
  border: 1px solid var(--bordo);
  position: relative; overflow: hidden;
}
.final-note::before {
  content: ""; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 227, 255, 0.7), transparent);
}
.final-note p {
  font-size: 16px; color: var(--testo-secondario);
  margin-bottom: 28px; line-height: 1.8;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.final-note strong { color: var(--ghiaccio); }
.final-cta-row {
  display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
}
.final-cta-row .btn-card { width: auto; padding: 14px 32px; margin-top: 0; }

/* ═══ FOOTER ═══ */
footer {
  background: var(--navy);
  border-top: 1px solid var(--bordo);
  padding: 70px 0 30px; position: relative;
}
footer::before {
  content: ""; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 70%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 227, 255, 0.6), transparent);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 36px; } }
.footer-brand .logo-container { margin-bottom: 18px; }
.footer-brand p { color: var(--testo-secondario); font-size: 14.5px; line-height: 1.7; max-width: 340px; }
.footer-col h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--ghiaccio); margin-bottom: 18px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.footer-col a {
  display: block; color: var(--testo-secondario);
  text-decoration: none; font-size: 14.5px;
  margin-bottom: 11px;
  transition: color 0.25s, transform 0.25s;
}
.footer-col a:hover { color: var(--ciano-vivid); transform: translateX(3px); }
.footer-bottom {
  border-top: 1px solid var(--bordo);
  padding-top: 26px;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 14px;
  font-size: 13.5px; color: var(--testo-dim);
}
.footer-bottom .brand-name {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}
.footer-bottom .piva strong { color: var(--testo-secondario); font-weight: 600; }
.legal-links {
  margin-top: 22px; padding-top: 22px;
  border-top: 1px solid var(--bordo);
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: 6px 4px; font-size: 13.5px;
}
.legal-links a {
  color: var(--testo-dim); text-decoration: none;
  padding: 2px 10px;
  transition: color 0.25s, text-shadow 0.25s;
}
.legal-links a:hover { color: var(--ciano-vivid); text-shadow: 0 0 12px rgba(79, 227, 255, 0.6); }
.legal-links span { color: var(--testo-dim); opacity: 0.4; }

/* ═══ REVEAL ═══ */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* ═══ WHATSAPP FLOAT ═══ */
.whatsapp-float {
  position: fixed; bottom: 25px; right: 25px;
  background: linear-gradient(135deg, #25D366, #1ebe5b);
  color: #fff; width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 12px 32px rgba(37,211,102,0.55);
  z-index: 999; text-decoration: none;
  transition: transform 0.3s ease;
  animation: waFloat 3s ease-in-out infinite;
}
.whatsapp-float:hover {
  transform: scale(1.12);
  box-shadow: 0 18px 44px rgba(37,211,102,0.7), 0 0 0 8px rgba(37,211,102,0.15);
}
@keyframes waFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }