/* onboarding-cinema.css
   Onboarding "a capitoli cinematografici":
   1) intro full-screen per modulo (blur + luce + type grande con reveal)
   2) spotlight sull'elemento reale + didascalia ANCORATA in basso (mai storta)
   Stile OpenAI-soft, accento peach. Attivo quando TabGuide gira con theme 'cinema'. */

:root {
  --tgc-peach: #ff9e64;
  --tgc-ink: #0f172a;
}

/* ============================================================
   1. CAPITOLO — intro full-screen
   ============================================================ */
.tg-cinema-backdrop {
  position: fixed; inset: 0; z-index: 100050;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 17, 21, 0.58);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
  opacity: 0; transition: opacity .55s ease;
  overflow: hidden;
}
.tg-cinema-backdrop.tg-in { opacity: 1; }

/* luce calda che deriva lentamente */
.tg-cinema-backdrop::before {
  content: ""; position: absolute; inset: -25%;
  background:
    radial-gradient(38% 48% at 28% 32%, rgba(255, 158, 100, 0.26), transparent 70%),
    radial-gradient(42% 52% at 76% 66%, rgba(255, 255, 255, 0.10), transparent 70%);
  animation: tgc-drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes tgc-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(0, -3%, 0) scale(1.06); }
}

.tg-cinema {
  position: relative; z-index: 2;
  text-align: center; color: #fff;
  max-width: 760px; padding: 0 32px;
  transform: translateY(16px) scale(.985); opacity: 0;
  transition: transform .75s cubic-bezier(.16, 1, .3, 1), opacity .7s ease;
}
.tg-cinema-backdrop.tg-in .tg-cinema { transform: none; opacity: 1; }

.tg-cinema-kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 800; letter-spacing: .28em; text-transform: uppercase;
  color: var(--tgc-peach); margin-bottom: 22px;
}
.tg-cinema-kicker svg { width: 15px; height: 15px; }

.tg-cinema-title {
  font-size: clamp(42px, 7.5vw, 80px); font-weight: 800; line-height: .98;
  letter-spacing: .045em; margin: 0 0 20px;
}
.tg-cinema-title .tg-w {
  display: inline-block; opacity: 0; filter: blur(14px); transform: translateY(10px);
  animation: tgc-word-in .85s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes tgc-word-in { to { opacity: 1; filter: blur(0); transform: none; } }

.tg-cinema-tagline {
  font-size: 19px; line-height: 1.5; color: rgba(255, 255, 255, .74);
  font-weight: 500; margin: 0 auto 36px; max-width: 540px;
  opacity: 0; animation: tgc-fade-up .8s ease .35s forwards;
}
@keyframes tgc-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tg-cinema-enter {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #111; border: none; border-radius: 999px;
  padding: 15px 28px; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .32);
  transition: transform .2s, box-shadow .2s;
  opacity: 0; animation: tgc-fade-up .8s ease .5s forwards;
}
.tg-cinema-enter:hover { transform: translateY(-2px); box-shadow: 0 18px 56px rgba(0, 0, 0, .42); }
.tg-cinema-enter:active { transform: translateY(0); }
.tg-cinema-enter svg { width: 17px; height: 17px; }

.tg-cinema-progress {
  margin-top: 28px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  opacity: 0; animation: tgc-fade-up .8s ease .6s forwards;
}

.tg-cinema-skip {
  position: absolute; top: 24px; right: 28px; z-index: 3;
  background: rgba(255, 255, 255, .12); color: #fff; border: none; border-radius: 999px;
  padding: 8px 16px; font-size: 12px; font-weight: 700; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .2s;
}
.tg-cinema-skip:hover { background: rgba(255, 255, 255, .22); }

/* ============================================================
   2. SPOTLIGHT — anello luminoso + didascalia ancorata
   ============================================================ */

/* Anello = buco luminoso. Il box-shadow gigante crea l'area scura TUTT'INTORNO,
   lasciando libero solo il rettangolo arrotondato esattamente sopra l'elemento.
   Così il "buco" combacia al pixel con l'anello: niente più ritagli storti. */
.tg-ring {
  position: fixed; z-index: 10001; pointer-events: none; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15, 17, 21, 0.52);
  opacity: 0;
  /* Solo opacity in transizione: top/left/width/height devono essere ISTANTANEI,
     altrimenti durante lo scroll l'anello "rincorre" e sembra disallineato. */
  transition: opacity .4s ease;
}
.tg-ring.tg-in { opacity: 1; }
/* bordo peach + bagliore, dentro e fuori al bordo del buco */
.tg-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 158, 100, .95),
    inset 0 0 22px rgba(255, 158, 100, .28),
    0 0 34px rgba(255, 158, 100, .28);
  animation: tgc-ring-pulse 2.2s ease-in-out infinite;
}
@keyframes tgc-ring-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}

/* Cinema: niente ritaglio rettangolare della maschera SVG (lo sostituisce l'anello). */
.tg-overlay[data-tg-theme="cinema"] .tg-mask-fill { fill: transparent !important; }

/* Velo uniforme per gli step senza elemento target (nessun anello → serve il dim). */
.tg-cinema-dim {
  position: fixed; inset: 0; z-index: 10000; pointer-events: none;
  background: rgba(15, 17, 21, 0.52);
  opacity: 0; transition: opacity .4s ease;
}
.tg-cinema-dim.tg-in { opacity: 1; }

/* didascalia FISSA in basso al centro */
.tg-dock {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%) translateY(14px);
  z-index: 10003; width: min(580px, calc(100vw - 32px));
  background: #fff; border-radius: 20px; padding: 22px 24px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .30), 0 2px 10px rgba(15, 23, 42, .10);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .5s cubic-bezier(.16, 1, .3, 1);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}
.tg-dock.tg-in { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* freccia/connettore che punta verso l'alto (all'elemento) */
.tg-dock-arrow {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 11px; overflow: hidden;
}
.tg-dock-arrow::before {
  content: ""; position: absolute; top: 4px; left: 3px;
  width: 16px; height: 16px; background: #fff; border-radius: 4px;
  transform: rotate(45deg); box-shadow: -2px -2px 6px rgba(15, 23, 42, .06);
}

.tg-dock-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tg-dock-dots { display: flex; gap: 5px; align-items: center; }
.tg-dock-dot { width: 7px; height: 7px; border-radius: 999px; background: #e2e8f0; transition: all .35s cubic-bezier(.16,1,.3,1); }
.tg-dock-dot.on { background: var(--tgc-peach); width: 20px; }
.tg-dock-dot.done { background: #cbd5e1; }
.tg-dock-meta {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #94a3b8; margin-left: auto;
}
.tg-dock-title { font-size: 18px; font-weight: 800; color: var(--tgc-ink); margin: 0 0 6px; line-height: 1.25; }
.tg-dock-desc { font-size: 14px; line-height: 1.55; color: #475569; margin: 0; }
.tg-dock-extra { margin-top: 12px; }

.tg-dock-foot { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.tg-dock-skip { background: none; border: none; color: #94a3b8; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.tg-dock-skip:hover { color: #64748b; }
.tg-dock-spacer { flex: 1; }
.tg-dock-btn {
  border: none; border-radius: 12px; padding: 11px 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .15s, background .2s;
}
.tg-dock-btn:active { transform: translateY(1px); }
.tg-dock-prev { background: #f1f5f9; color: var(--tgc-ink); }
.tg-dock-prev:hover { background: #e2e8f0; }
.tg-dock-next { background: var(--tgc-ink); color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.tg-dock-next:hover { background: #1e293b; }
.tg-dock-next svg { width: 15px; height: 15px; }

/* CTA tutorial dentro il dock */
.tg-dock .tg-tutorial-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; border-radius: 10px;
  padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.tg-dock .tg-tutorial-cta:hover { background: #ffedd5; }

@media (max-width: 640px) {
  .tg-dock { bottom: 16px; padding: 18px 18px; }
  .tg-cinema-title { letter-spacing: .02em; }
}
