/*
 * Welcome page di TOP Streaming (/welcome).
 *
 * Token, header, footer e controlli condivisi sono in /shared/ui-kit.css,
 * caricato prima di questo file. Le spaziature usano proprietà logiche, così
 * la pagina regge anche in arabo (dir="rtl") senza regole a parte.
 */

:root {
  /* Finta home di un’app di streaming */
  --media-home-bg: #0f0d19;
  --media-home-rail: #171427;
  --media-home-text: #eceaf6;
  --media-home-dim: #8f8aa8;
  --media-home-accent: #7b5bf5;
}

* { box-sizing: border-box; }

body.welcome {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

:where(.welcome) :is(h1, h2, h3) { margin: 0; text-wrap: balance; }
:where(.welcome) p { margin: 0; }
:where(.welcome) a { color: inherit; }
:where(.welcome) img { display: block; max-width: 100%; }
.welcome :focus-visible:not(:where(.welcome-platforms *)) { outline: 3px solid #ffd166; outline-offset: 3px; border-radius: 6px; }

/* ── Header (barra e marchio in /shared/ui-kit.css) ── */
.welcome-nav { display: flex; gap: 22px; font-size: 13.5px; font-weight: 600; }
.welcome-nav a { text-decoration: none; opacity: 0.92; white-space: nowrap; }
.welcome-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* ── Layout ─────────────────────────────────────────────── */
.welcome-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 26px 0;
  display: grid;
  gap: 28px;
}
.welcome-tray { background: var(--surface-tray); border-radius: var(--surface-radius); box-shadow: var(--surface-shadow); }
.welcome-section { display: grid; gap: 22px; }
.welcome-section__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 16px 40px;
  padding-inline: 8px;
}
.welcome h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.03em; line-height: 1.06; font-weight: 800; margin-top: 10px; }
.welcome-section__head p { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 42ch; }


/* ── Hero ───────────────────────────────────────────────── */
.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 36px;
  padding: 44px 40px;
  align-items: center;
}
.welcome-hero__copy { display: flex; flex-direction: column; justify-content: space-between; gap: 26px; align-self: stretch; min-width: 0; }
.welcome-hero h1 { font-size: clamp(38px, 5.2vw, 62px); line-height: 1; letter-spacing: -0.035em; font-weight: 800; }
.welcome-hero h1 span { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-hero__lead { margin-top: 20px; font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 46ch; }
.welcome-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.welcome-proof { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 26px; font-size: 12.5px; color: var(--muted); align-items: center; }
.welcome-proof b { color: var(--ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.welcome-proof i { width: 1px; height: 14px; background: rgba(0, 0, 0, 0.15); }

.welcome-stage { position: relative; min-width: 0; }
.welcome-stage__caption { margin-top: 16px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; justify-content: center; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ac47d; box-shadow: 0 0 0 3px rgba(58, 196, 125, 0.2); }

/* ── Home dell’app finta ────────────────────────────────── */
.media-home {
  background: var(--media-home-bg);
  color: var(--media-home-text);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  box-shadow: 0 24px 60px rgba(22, 15, 40, 0.35), 0 2px 6px rgba(22, 15, 40, 0.25);
  transform: rotate(-1.2deg);
}
[dir="rtl"] .media-home { transform: rotate(1.2deg); }
.media-home__rail { background: var(--media-home-rail); display: flex; flex-direction: column; align-items: center; gap: 14px; padding-block: 14px; }
.media-home__rail i { width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); display: block; }
.media-home__rail i.is-on { background: var(--media-home-accent); }
.media-home__rail i.media-home__avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #7b5bf5, #b34be0); margin-bottom: 6px; }
.media-home__main { padding-block: 14px 16px; padding-inline-start: 16px; min-width: 0; display: grid; gap: 16px; }
.media-home__search {
  margin-inline-end: 16px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  color: var(--media-home-dim);
  display: flex;
  align-items: center;
  padding-inline: 12px;
}
.media-row { display: grid; gap: 8px; min-width: 0; }
.media-row__head { display: flex; align-items: baseline; gap: 8px; padding-inline-end: 16px; font-size: 13px; font-weight: 700; min-width: 0; }
.media-row__head > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-row__head small { font-weight: 500; color: var(--media-home-dim); font-size: 11px; white-space: nowrap; }
.media-row__all { margin-inline-start: auto; font-size: 11px; color: var(--media-home-dim); font-weight: 600; white-space: nowrap; }
.media-row__strip { display: flex; gap: 8px; overflow: hidden; padding-inline-end: 16px; }
.brand-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #888); transform: translateY(-1px); }

.welcome-poster { position: relative; flex: 0 0 auto; width: var(--poster-w, 86px); aspect-ratio: 2 / 3; border-radius: 7px; overflow: hidden; background: #241f38; }
.welcome-poster img { width: 100%; height: 100%; object-fit: cover; }
.welcome-poster__rank {
  position: absolute;
  top: 5px;
  inset-inline-start: 5px;
  min-width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(10, 8, 18, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding-inline: 5px;
  font-variant-numeric: tabular-nums;
}

/* ── Card cataloghi ─────────────────────────────────────── */
.welcome-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.welcome-card { padding: 22px; display: grid; gap: 12px; align-content: start; }
.welcome-card__stack { display: flex; height: 120px; margin-bottom: 6px; }
.welcome-card__stack .welcome-poster { --poster-w: 74px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25); }
.welcome-card__stack .welcome-poster + .welcome-poster { margin-inline-start: -26px; }
.welcome-card__stack .welcome-poster:nth-child(1) { transform: rotate(-3deg); }
.welcome-card__stack .welcome-poster:nth-child(2) { transform: translateY(8px) rotate(3deg); }
.welcome-card__stack .welcome-poster:nth-child(3) { transform: translateY(16px) rotate(6deg); }
.welcome-card__kind { font-size: 10.5px; letter-spacing: 0.16em; font-weight: 700; color: var(--muted); }
.welcome-card h3 { font-size: 20px; letter-spacing: -0.02em; font-weight: 800; }
.welcome-card p { font-size: 14px; line-height: 1.55; color: var(--muted); }
.welcome-card__tag { justify-self: start; }

/* ── Come funziona ──────────────────────────────────────── */
.welcome-how { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px; padding: 36px 40px; align-items: start; }
.welcome-how > div > p { margin-top: 14px; color: var(--muted); font-size: 14.5px; line-height: 1.55; max-width: 40ch; }
.welcome-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* Passi incassati nel vassoio, come le sezioni della configurazione. */
.welcome-steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background: var(--surface-recessed);
  border-radius: var(--surface-box-radius);
  padding: 16px 18px;
  box-shadow: var(--surface-recessed-shadow);
}
/* Bolla di vetro viola delle icone della dashboard TOP Posters (schermata API key). */
.welcome-steps li > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.82), rgba(118, 75, 162, 0.84));
  border: 2px solid rgba(102, 126, 234, 0.3);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 2px 8px rgba(76, 29, 149, 0.16),
    0 10px 24px rgba(102, 126, 234, 0.26);
}
.welcome-steps h3 { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }
.welcome-steps p { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 3px; }

/* ── TOP Posters ────────────────────────────────────────── */
.welcome-tp { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px; padding: 36px 40px; align-items: center; }
.welcome-tp__copy { display: flex; flex-direction: column; justify-content: space-between; gap: 26px; align-self: stretch; min-width: 0; }
.welcome-tp__intro > p { margin-top: 14px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.welcome-options { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.welcome-options li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.45; }
.welcome-options li::before { content: "✦"; color: var(--brand-start); font-size: 12px; line-height: 1.7; }
.welcome-tp__note { font-size: 13px; line-height: 1.6; color: var(--brand-end); }

/* Carosello della landing v2 di TOP Posters: la posizione e la rotazione
   stanno sullo slot, il fluttuare sull'elemento interno, così cambiare
   immagine non fa ripartire il movimento. */
.welcome-gallery { position: relative; isolation: isolate; min-height: 460px; }
.welcome-gallery__orbit {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 10%;
  width: 440px;
  height: 440px;
  max-width: 90%;
  border: 1px solid rgba(185, 165, 220, 0.15);
  border-radius: 50%;
}
.welcome-gallery__orbit--inner {
  top: 50px;
  left: 19%;
  width: 340px;
  height: 340px;
  background: radial-gradient(ellipse, rgba(191, 169, 231, 0.17), transparent 70%);
}
.welcome-gallery__slot { position: absolute; aspect-ratio: 2 / 3; }
.welcome-gallery__float {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 13px;
  background: var(--surface-recessed);
  box-shadow: 0 16px 22px rgba(40, 35, 60, 0.19), 0 2px 4px rgba(40, 35, 60, 0.19);
  animation: welcome-float 7s ease-in-out infinite;
}
.welcome-gallery__float img { width: 100%; height: 100%; object-fit: cover; }
.welcome-gallery__slot--left { width: 180px; left: 0; top: 116px; transform: rotate(-11deg); }
.welcome-gallery__slot--right { width: 180px; right: -8px; top: 104px; transform: rotate(11deg); }
.welcome-gallery__slot--center { width: 226px; left: 50%; top: 65px; transform: translateX(-50%) rotate(-2deg); z-index: 2; }
.welcome-gallery__slot--center .welcome-gallery__float {
  box-shadow: 0 23px 32px rgba(40, 35, 60, 0.25), 0 2px 5px rgba(40, 35, 60, 0.21);
  animation-duration: 8.2s;
  animation-delay: -2.5s;
}
.welcome-gallery__slot--right .welcome-gallery__float { animation-duration: 6.8s; animation-delay: -4s; }
.welcome-gallery[data-layout="banner"] .welcome-gallery__slot { aspect-ratio: 16 / 9; }
.welcome-gallery[data-layout="banner"] .welcome-gallery__slot--left { width: 68%; top: 32px; left: 1%; transform: rotate(-9deg); }
.welcome-gallery[data-layout="banner"] .welcome-gallery__slot--right { width: 68%; top: 197px; right: 0; transform: rotate(8deg); }
.welcome-gallery[data-layout="banner"] .welcome-gallery__slot--center { width: 84%; top: 118px; }
.welcome-gallery[data-paused="true"] .welcome-gallery__float { animation-play-state: paused; }
.welcome-gallery__caption {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
#welcome-gallery-pause {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #cec5dd;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  color: #736187;
  font-size: 11px;
  cursor: pointer;
}
#welcome-gallery-pause:hover { background: #ece7f7; }
@keyframes welcome-float {
  0%, 100% { transform: translateY(5px); }
  50% { transform: translateY(-6px); }
}

/* ── FAQ ────────────────────────────────────────────────── */
.welcome-faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px; padding: 36px 40px; align-items: start; }
.welcome-faq__list { display: grid; gap: 10px; }
.welcome-faq__item { background: var(--surface); border-radius: var(--surface-box-radius); box-shadow: var(--surface-shadow); padding-inline: 18px; }
.welcome-faq__item[open] { background: var(--surface-recessed); box-shadow: var(--surface-recessed-shadow); }
.welcome-faq__item summary {
  cursor: pointer;
  list-style: none;
  padding-block: 15px;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.welcome-faq__item summary::-webkit-details-marker { display: none; }
.welcome-faq__item summary::after { content: "+"; margin-inline-start: auto; font-size: 20px; line-height: 1; color: var(--brand-end); }
.welcome-faq__item[open] summary::after { content: "–"; }
.welcome-faq__divider { margin-bottom: 14px; }
.welcome-faq__item p { padding-bottom: 16px; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1120px) {
  .welcome-nav { display: none; }
}

@media (max-width: 960px) {
  .welcome-hero,
  .welcome-how,
  .welcome-tp,
  .welcome-faq { grid-template-columns: minmax(0, 1fr); padding: 28px 20px; }
  .welcome-hero { gap: 40px; }
  .media-home,
  [dir="rtl"] .media-home { transform: none; }
  .welcome-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .welcome-gallery { min-height: 380px; }
  .welcome-gallery__slot--left { width: 125px; top: 96px; }
  .welcome-gallery__slot--right { width: 125px; right: 0; top: 93px; }
  .welcome-gallery__slot--center { width: 170px; top: 50px; }
  .welcome-gallery__float { border-width: 2px; border-radius: 10px; }
  .welcome-gallery[data-layout="banner"] .welcome-gallery__slot--left { top: 40px; width: 73%; }
  .welcome-gallery[data-layout="banner"] .welcome-gallery__slot--center { top: 100px; width: 88%; }
  .welcome-gallery[data-layout="banner"] .welcome-gallery__slot--right { top: 160px; width: 73%; }
  .welcome-header-cta { display: none; }
  .welcome-poster { --poster-w: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-gallery__float { animation: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .welcome-poster { transition: transform 0.25s ease; }
  .media-row__strip .welcome-poster:hover { transform: translateY(-3px); }
}
