/* theme.css
 
/* -------------------------
   THEME TOKENS
   ------------------------- */
:root{
  /* Base */
  --bg:#0b0f14;
  --text:#e8eef6;
  --muted:#9aa7b7;
  --border:rgba(255,255,255,.10);
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:16px;

  /* Brand */
  --accent:#4ea1ff;
  --accent2:#6ef0c2;

  /* Stato */
  --danger:#ff5d5d;
  --ok:#41d17c;

  /* Superfici */
  --card-bg: rgba(255,255,255,.03);
  --card-bg-soft: rgba(255,255,255,.02);
  --chip-bg: rgba(255,255,255,.03);

  /* Page background */
  --page-bg:
    radial-gradient(900px 500px at 15% 10%, rgba(78,161,255,.18), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(110,240,194,.12), transparent 55%),
    var(--bg);

  /* Header */
  --header-bg: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));

  /* Buttons */
  --btn-bg: linear-gradient(90deg, var(--accent), #7a5cff);
  --btn-shadow: 0 8px 20px rgba(78,161,255,.22);

  /* Carousel */
  --carousel-bg:#0a0f16;
  --carousel-overlay: linear-gradient(
    90deg,
    rgba(0,0,0,.62),
    rgba(0,0,0,.08) 55%,
    rgba(0,0,0,.45)
  );

  /* Inputs */
  --input-bg: rgba(0,0,0,.25);
  --input-focus: rgba(78,161,255,.65);

  /* Package cards */
  --pkg-bg: rgba(255,255,255,.02);
  --pkg-bg-hover: rgba(255,255,255,.03);
  --pkg-border-hover: rgba(255,255,255,.16);

  /* Pills */
  --pill-green-border: rgba(110,240,194,.35);
  --pill-green-text: rgba(110,240,194,.95);
  --pill-green-bg: rgba(110,240,194,.08);

  --pill-blue-border: rgba(78,161,255,.45);
  --pill-blue-text: rgba(205,231,255,.98);
  --pill-blue-bg: rgba(78,161,255,.10);

  /* Selection glow */
  --selected-border: rgba(78,161,255,.55);
  --selected-glowA: rgba(78,161,255,.22);
  --selected-glowB: rgba(110,240,194,.14);

  /* Effects gradients */
  --glow-grad:
    radial-gradient(600px 220px at 15% 20%, rgba(78,161,255,.18), transparent 60%),
    radial-gradient(520px 240px at 85% 0%, rgba(110,240,194,.12), transparent 55%);

  --pay-grad:
    radial-gradient(700px 260px at 20% 0%, rgba(78,161,255,.10), transparent 55%),
    radial-gradient(700px 260px at 90% 0%, rgba(110,240,194,.08), transparent 55%);
}

/* -------------------------
   RESET / BASE
   ------------------------- */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height:1.4;
}
a{ color:inherit; }
.container{ max-width:1100px; margin:0 auto; padding:24px; }

/* Focus accessibile */
:focus-visible{
  outline: 2px solid rgba(78,161,255,.75);
  outline-offset: 3px;
  border-radius: 12px;
}

/* -------------------------
   HEADER
   ------------------------- */
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 22px;
  border:1px solid var(--border);
  background: var(--header-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  backdrop-filter: blur(8px);
  z-index: 10;
}
.brand{ display:flex; flex-direction:column; gap:4px; }
.brand h1{ margin:0; font-size:18px; letter-spacing:.2px; }
.brand p{ margin:0; color: var(--muted); font-size:13px; }
.ctaTop{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.chip{
  border:1px solid var(--border);
  padding:8px 10px;
  border-radius:999px;
  font-size:13px;
  color: var(--muted);
  background: var(--chip-bg);
}

/* Buttons */
.btn{
  appearance:none;
  border:0;
  cursor:pointer;
  padding:10px 14px;
  border-radius:999px;
  background: var(--btn-bg);
  color:white;
  font-weight:650;
  box-shadow: var(--btn-shadow);
  transition: transform .12s ease, box-shadow .25s ease, filter .25s ease;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:hover{
  filter: brightness(1.05);
  box-shadow: 0 10px 26px rgba(78,161,255,.28),
              0 0 0 1px rgba(255,255,255,.08) inset;
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.7; cursor:not-allowed; transform:none; }
.btn.secondary{
  background: rgba(255,255,255,.06);
  box-shadow:none;
  border:1px solid var(--border);
}

/* -------------------------
   LAYOUT GRID
   ------------------------- */
.grid{
  display:grid;
  gap:18px;
  grid-template-columns: 1.2fr .8fr;
  margin-top:18px;
}
@media (max-width: 920px){
  header{ position:static; }
  .grid{ grid-template-columns:1fr; }
}

/* -------------------------
   CARD
   ------------------------- */
.card{
  border:1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.cardHeader{ padding:16px 18px; border-bottom:1px solid var(--border); }
.cardHeader h2{ margin:0; font-size:16px; }
.cardHeader p{ margin:6px 0 0; color: var(--muted); font-size:13px; }
.cardBody{ padding:16px 18px; }

.cardSoft{
  box-shadow:none;
  background: var(--card-bg-soft);
}

.sectionTitle{ margin:0 0 8px; font-size:22px; letter-spacing:.2px; }
.sectionText{ margin:0; color: rgba(255,255,255,.86); }
.sectionStrong{ font-weight:800; }

.divider{ height:1px; background: var(--border); margin:14px 0; }
footer{ margin:18px 0 6px; color: var(--muted); font-size:12px; text-align:center; }
.tiny{ font-size:12px; color: var(--muted); }
.terms{ margin-top:12px; }
.summaryRight{ text-align:right; }

/* -------------------------
   CAROUSEL (CLS FIX)
   ------------------------- */
.carousel{
  position:relative;
  width:100%;
  background: var(--carousel-bg);
  overflow:hidden;
  aspect-ratio: 16 / 10;
}
.slides{
  display:flex;
  align-items:stretch;
  height: 100%;
  transition: transform .45s ease;
  will-change: transform;
}
.slide{
  min-width:100%;
  position:relative;
  flex: 0 0 100%;
  height: 100%;
}
.slide img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  filter: contrast(1.05) saturate(1.05);
}
.slideOverlay{
  position:absolute;
  inset:0;
  background: var(--carousel-overlay);
  pointer-events:none;
}
.caption{
  position:absolute;
  left:18px; bottom:16px; right:18px;
  display:flex;
  flex-direction:column;
  gap:6px;
  max-width:72%;
  pointer-events:none;
}
.caption strong{ font-size:18px; }
.caption span{ color: rgba(255,255,255,.82); font-size:13px; }

.navBtn{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:44px; height:44px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.35);
  color:white;
  cursor:pointer;
  display:grid;
  place-items:center;
  backdrop-filter: blur(6px);
  z-index:2;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.navBtn:hover{
  background: rgba(0,0,0,.52);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset,
              0 10px 26px rgba(0,0,0,.4);
}
.navBtn:active{ transform: translateY(-50%) scale(.98); }
.navPrev{ left:12px; }
.navNext{ right:12px; }

.dots{
  position:absolute;
  left:0; right:0; bottom:10px;
  display:flex;
  justify-content:center;
  gap:8px;
  z-index:2;
}
.dot{
  width:9px; height:9px;
  border-radius:999px;
  background: rgba(255,255,255,.35);
  border:1px solid rgba(255,255,255,.25);
  cursor:pointer;
  transition: transform .15s ease, background .2s ease;
}
.dot:hover{ transform: scale(1.15); }
.dot.active{ background: white; }

/* -------------------------
   PACKAGES
   ------------------------- */
.packages{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.pkgInput{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.pkgCard{
  border:1px solid var(--border);
  background: var(--pkg-bg);
  border-radius:14px;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  isolation:isolate;
  opacity: .92;
  transition: transform .18s ease, border-color .18s ease, box-shadow .25s ease, background .25s ease, opacity .2s ease, filter .2s ease;
}

/* glow ambient */
.pkgCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: var(--glow-grad);
  opacity:0;
  transition: opacity .25s ease;
  z-index:-1;
}

.pkgCard:hover{
  transform: translateY(-2px);
  border-color: var(--pkg-border-hover);
  box-shadow: 0 16px 34px rgba(0,0,0,.38),
              0 0 0 1px rgba(255,255,255,.06) inset;
  background: var(--pkg-bg-hover);
  opacity: .98;
}
.pkgCard:hover::before{ opacity:.9; }

.pkgTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.pkgTitleWrap{ display:flex; flex-direction:column; gap:4px; }
.pkgTitle{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  font-weight:850;
  letter-spacing:.2px;
}
.pkgSub{ color: var(--muted); font-size:13px; }
.pkgRight{
  text-align:right;
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-end;
  min-width:120px;
}
.pkgPrice{ font-weight:950; font-size:18px; }

.pill{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--pill-green-border);
  color: var(--pill-green-text);
  background: var(--pill-green-bg);
  white-space:nowrap;
}
.pill.blue{
  border-color: var(--pill-blue-border);
  color: var(--pill-blue-text);
  background: var(--pill-blue-bg);
}
.best{
  border:1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.06);
}

.features{
  margin:0;
  padding-left:18px;
  color: rgba(255,255,255,.86);
  display:grid;
  gap:6px;
}
.features li{ line-height:1.35; }

.pkgHint{ font-size:12px; color: rgba(255,255,255,.75); }

/* Selezionato: protagonista */
.pkgCard.selected{
  opacity: 1;
  border-color: var(--selected-border);
  background: rgba(255,255,255,.04);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 0 1px rgba(78,161,255,.18),
    0 18px 42px rgba(0,0,0,.48),
    0 0 42px rgba(78,161,255,.22),
    0 0 28px rgba(110,240,194,.14);
}
.pkgCard.selected::before{ opacity: 1; }

/* Non selezionati quando esiste una selezione */
.packages.hasSelection .pkgCard:not(.selected){
  opacity: .78;
  filter: saturate(.95);
}

/* -------------------------
   SVG LASER DASH (segue il bordo del rect)
   Trigger: .pkgCard.selected.chase
   ------------------------- */
.pkgChase{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:6;
}
.pkgChaseBase{
  stroke:none !important;
  opacity:0 !important;
  fill:none;
}
.pkgChaseRun{
  fill:none;
  stroke: url(#pkgNeonGrad);
  stroke-width: 2.8;
  stroke-linecap: round;
  /* dash “laser” */
  stroke-dasharray: 36 260;
  stroke-dashoffset: 0;
  opacity: 0;
  filter:
    drop-shadow(0 0 10px rgba(78,161,255,.85))
    drop-shadow(0 0 18px rgba(110,240,194,.55));
}
.pkgCard.selected.chase .pkgChaseRun{
  opacity: 1;
  animation: dash-run 1.05s linear infinite;
}
@keyframes dash-run{
  to{ stroke-dashoffset: -296; }
}

/* -------------------------
   FORM
   ------------------------- */
.formRow{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width:560px){ .formRow{ grid-template-columns:1fr; } }

label{
  display:block;
  font-size:13px;
  color: var(--muted);
  margin-bottom:6px;
}
input, select{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  outline:none;
}
input:focus, select:focus{ border-color: var(--input-focus); }

/* -------------------------
   STRIPE / PAY BOX
   ------------------------- */
.payBox{
  border:1px solid var(--border);
  background: var(--card-bg-soft);
  border-radius:14px;
  padding:12px;
  margin-top:12px;
  position:relative;
  overflow:hidden;
}
.payBox::after{
  content:"";
  position:absolute;
  inset:-1px;
  background: var(--pay-grad);
  pointer-events:none;
}
.payBoxInner{ position:relative; z-index:1; }
.payTitle{ font-weight:900; margin-bottom:10px; }
.hint{ color: var(--muted); font-size:13px; margin-top:8px; }

.stripePlaceholder{
  margin-top:10px;
  padding:10px 12px;
  border:1px dashed rgba(255,255,255,.14);
  border-radius:12px;
  color: rgba(255,255,255,.82);
  font-size:13px;
}
.codeLike{ opacity:.9; }

/* -------------------------
   SUMMARY
   ------------------------- */
.summary{
  display:flex;
  flex-direction:column;
  gap:10px;
  border-radius:14px;
  padding:14px;
  border:1px solid var(--border);
  background: var(--card-bg-soft);
}
.summaryRow{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color: rgba(255,255,255,.88);
}
.summaryRow small{ color: var(--muted); }
.total{ font-size:18px; font-weight:950; }

.buyBtn{ width:100%; margin-top:14px; }

/* -------------------------
   MESSAGES
   ------------------------- */
.msg{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  display:none;
}
.msg.ok{
  display:block;
  border:1px solid rgba(65,209,124,.4);
  background: rgba(65,209,124,.10);
  color: rgba(220,255,235,.95);
}
.msg.err{
  display:block;
  border:1px solid rgba(255,93,93,.45);
  background: rgba(255,93,93,.08);
  color: rgba(255,220,220,.96);
}

/* -------------------------
   INFO CARDS (Incluso/Contatti)
   ------------------------- */
.infoCard{
  padding:14px;
  border-radius:14px;
  position:relative;
  overflow:hidden;
}
.infoCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: var(--glow-grad);
  opacity:.18;
  pointer-events:none;
}
.infoHead{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:12px;
  position:relative;
  z-index:1;
}
.infoIcon{
  width:34px;
  height:34px;
  border-radius:12px;
  display:grid;
  place-items:center;
  font-weight:900;
  color: rgba(205,231,255,.98);
  background: rgba(78,161,255,.12);
  border: 1px solid rgba(78,161,255,.25);
}
.infoIcon svg{ display:block; }
.infoIconAlt{
  color: rgba(110,240,194,.95);
  background: rgba(110,240,194,.10);
  border-color: rgba(110,240,194,.22);
}
.infoTitleWrap{ display:flex; flex-direction:column; gap:2px; }
.infoTitle{ font-weight:900; letter-spacing:.2px; }
.infoSub{ font-size:12px; color: var(--muted); }

.infoList{
  margin:0;
  padding:0;
  list-style:none;
  display:grid;
  gap:8px;
  position:relative;
  z-index:1;
}
.infoList li{
  display:flex;
  gap:10px;
  align-items:flex-start;
  color: rgba(255,255,255,.88);
  line-height:1.35;
}
.infoList li::before{
  content:"✔";
  flex:0 0 auto;
  font-size:12px;
  margin-top:2px;
  color: rgba(110,240,194,.95);
  filter: drop-shadow(0 6px 12px rgba(110,240,194,.10));
}

/* Contatti: CTA */
.contactActions{
  display:grid;
  gap:10px;
  position:relative;
  z-index:1;
}
.contactBtn{
  text-decoration:none;
  display:grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap:10px;
  row-gap:2px;
  align-items:center;

  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  transition: transform .15s ease, border-color .2s ease, background .2s ease, box-shadow .25s ease;
}
.contactBtnIcon{
  grid-row: 1 / span 2;
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.92);
  font-weight:800;
  transition: transform .15s ease;
}
.contactBtnIcon svg{ display:block; }
.contactBtnMeta{ font-size:12px; color: var(--muted); }

.contactBtn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.04);
  box-shadow: 0 14px 28px rgba(0,0,0,.35),
              0 0 0 1px rgba(255,255,255,.05) inset;
}
.contactBtn:hover .contactBtnIcon{ transform: translateY(-1px); }
.contactBtn:active{ transform: translateY(0px); }

.contactBtn:nth-child(1) .contactBtnIcon{
  background: rgba(78,161,255,.12);
  border-color: rgba(78,161,255,.22);
  color: rgba(205,231,255,.98);
}
.contactBtn:nth-child(2) .contactBtnIcon{
  background: rgba(110,240,194,.10);
  border-color: rgba(110,240,194,.22);
  color: rgba(110,240,194,.95);
}

/* -------------------------
   COOKIE BANNER (FIX hidden)
   ------------------------- */
.cookieBanner{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
  z-index: 9999;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
}

/* ✅ Fix definitivo: hidden deve nascondere davvero */
.cookieBanner[hidden]{
  display:none !important;
}

.cookieCard{
  width: min(760px, 100%);
  border: 1px solid var(--border);
  background: rgba(17, 24, 38, .88);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(0,0,0,.55);
  padding: 16px 16px 14px;
}

.cookieTop{ display:grid; gap:6px; }
.cookieTitle{ font-weight: 950; letter-spacing: .2px; }
.cookieSub{ color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.35; }

.cookieActions{
  display:flex;
  gap:10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.cookieLinks{
  margin-top: 10px;
  opacity: .9;
}
.cookieLinks a{ text-decoration:none; }
.cookieLinks a:hover{ text-decoration: underline; }

.cookiePrefs{
  display:grid;
  gap:10px;
  margin-top: 12px;
}

.cookieToggle{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
}
.cookieToggle input{
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.cookieToggle small{ color: var(--muted); font-size: 12px; }

/* -------------------------
   Reduced motion
   ------------------------- */
@media (prefers-reduced-motion: reduce){
  *{
    transition:none !important;
    animation:none !important;
    scroll-behavior:auto !important;
  }
}