/* SupportFast Academy. Token e componenti dal design system del sito (Sito 3.0). */
@font-face { font-family: "Cabinet Grotesk"; font-weight: 700; font-display: swap; src: url("/fonts/CabinetGrotesk-Bold.woff2") format("woff2"); }
@font-face { font-family: "Cabinet Grotesk"; font-weight: 800; font-display: swap; src: url("/fonts/CabinetGrotesk-Extrabold.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/Poppins-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/Poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/Poppins-600-latin.woff2") format("woff2"); }

:root {
  --blue: #0063ed;
  --blue-hover: #004fc0;
  --blue-tint: #e8efff;
  --blue-tint-2: #e8f1ff;
  --blue-deep-text: #0050c4;
  --sky-100: #dde5ff;
  --sky-300: #b8c8ff;
  --ink: #232323;
  --text: #3a4150;
  --muted: #6b7280;
  --line: #e3e8f0;
  --header-line: #d9e2ef;
  --surface: #ffffff;
  --surface-mist: #f4f6fa;
  --surface-cool: #f0f4fa;
  --gradient-hero-panel: linear-gradient(160deg, #eef3ff 0%, #dde5ff 50%, #b8c8ff 100%);
  --font-display: "Cabinet Grotesk", "Poppins", sans-serif;
  --font-sans: "Poppins", system-ui, sans-serif;
  --radius-button: 7px;
  --radius-tab: 12px;
  --radius-shot: 15px;
  --radius-card: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 18px rgba(0, 30, 80, 0.04);
  --shadow-cover: 0 10px 28px rgba(0, 30, 80, 0.12);
  --shadow-toggle: 0 2px 8px rgba(0, 30, 80, 0.05);
  --shadow-toggle-on: 0 4px 12px rgba(0, 99, 237, 0.25);
  --gutter: 24px;
  --container: 1282px;
  --header: 64px;
  --fast: 0.2s;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 24px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--text); font: 400 16px/26px var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
em { font-style: normal; color: var(--blue); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-piena { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* Bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 28px; border-radius: var(--radius-button); border: 2px solid transparent; font: 700 19px/24px var(--font-display); white-space: nowrap; transition: background var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease; }
.btn-sm { height: 44px; padding: 0 20px; font-size: 16px; line-height: 20px; }
.btn-primario { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primario:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-chiaro { background: var(--blue-tint); border-color: var(--blue-tint); color: var(--blue-deep-text); }
.btn-chiaro:hover { background: var(--sky-100); border-color: var(--sky-100); }
.btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* Testata */
.testata { position: sticky; top: 0; z-index: 20; height: var(--header); background: var(--surface); border-bottom: 1px solid var(--header-line); }
.testata-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.marchio { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.marchio img { width: 150px; height: auto; }
.marchio span { padding-left: 12px; border-left: 1px solid var(--header-line); font: 700 17px/22px var(--font-display); color: var(--muted); }
.testata-azioni { display: flex; align-items: center; gap: 20px; justify-self: end; }
.testata-link { font: 700 16px/20px var(--font-display); color: var(--ink); transition: color var(--fast) ease; }
.testata-link:hover { color: var(--blue); }
/* Lingua: bandiera e sigla, menu con le due lingue (come nella guida) */
.lingua { position: relative; }
.lingua-bottone { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: var(--radius-tab); font: 600 15px/20px var(--font-sans); color: var(--text); transition: background var(--fast) ease, color var(--fast) ease; }
.lingua-bottone:hover, .lingua-bottone[aria-expanded="true"] { background: var(--surface-cool); color: var(--ink); }
.lingua-bandiera { width: 20px; height: 20px; flex: none; }
.lingua-freccia { transition: transform var(--fast) ease; }
.lingua-bottone[aria-expanded="true"] .lingua-freccia { transform: rotate(180deg); }
.lingua-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 184px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-tab); background: var(--surface); box-shadow: var(--shadow-cover); }
.lingua-voce { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 15px; line-height: 20px; color: var(--text); transition: background var(--fast) ease; }
.lingua-voce:hover { background: var(--surface-cool); color: var(--ink); }
.lingua-voce[aria-current] { background: var(--blue-tint); color: var(--blue-deep-text); font-weight: 600; }
.selettore { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-toggle); }
.selettore button { height: 38px; padding: 0 22px; border-radius: var(--radius-pill); font: 700 16px/20px var(--font-display); color: var(--muted); transition: background var(--fast) ease, color var(--fast) ease; }
.selettore button:hover { color: var(--blue); }
.selettore button[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: var(--shadow-toggle-on); }

/* Apertura: titolo a sinistra, in linea con le copertine; a destra l'avanzamento */
.apertura { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px 56px; max-width: var(--container); margin: 0 auto; padding: 56px var(--gutter) 0; }
.apertura h1 { max-width: 760px; font: 800 56px/1.06 var(--font-display); letter-spacing: -1.3px; color: var(--ink); text-wrap: balance; }
.apertura-lead { max-width: 640px; margin-top: 16px; font-size: 18px; line-height: 30px; text-wrap: pretty; }
.apertura-guida { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 14px; font-size: 16px; line-height: 24px; }
.link { display: inline-flex; padding: 4px 0; color: var(--blue); font: 700 18px/24px var(--font-display); border-bottom: 2px solid var(--sky-300); transition: color var(--fast) ease, border-color var(--fast) ease; }
.link:hover { color: var(--blue-hover); border-bottom-color: var(--blue-hover); }

.avanzamento { position: relative; display: flex; align-items: center; gap: 16px; min-width: 330px; padding: 16px 44px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-card); }
.anello { position: relative; flex: none; width: 76px; height: 76px; }
.anello svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.anello circle { fill: none; stroke-width: 3.2; }
.anello-fondo { stroke: var(--blue-tint); }
.anello-valore { stroke: var(--blue); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.25s ease; }
.anello b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 17px/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.avanzamento-testi b { display: block; font: 700 19px/24px var(--font-display); color: var(--ink); }
.avanzamento-testi span { display: block; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--muted); }
.azzera { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 15px; color: var(--muted); transition: background var(--fast) ease, color var(--fast) ease; }
.azzera:hover { background: var(--surface-cool); color: var(--ink); }

.riquadro { display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 20px; padding: 16px 20px; border: 1px solid var(--sky-100); border-radius: var(--radius-card); background: var(--blue-tint-2); text-align: left; transition: border-color var(--fast) ease, background var(--fast) ease; }
.riquadro:hover { border-color: var(--sky-300); background: var(--blue-tint); }
.riquadro-icona { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--radius-tab); background: var(--sky-100); color: var(--blue); font-size: 24px; }
.riquadro-testi { flex: 1; min-width: 0; }
.riquadro-testi b { display: block; font: 700 19px/24px var(--font-display); color: var(--ink); }
.riquadro-testi span { display: block; margin-top: 2px; font-size: 14px; line-height: 20px; }
.riquadro-freccia { font-size: 20px; color: var(--muted); transition: transform var(--fast) ease, color var(--fast) ease; }
.riquadro:hover .riquadro-freccia { transform: translateX(3px); color: var(--blue); }
.riquadro-altra { max-width: 772px; margin: 64px auto 0; display: flex; }

/* Argomenti: etichetta al centro fra due linee */
.catalogo { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 80px; }
.gruppo { padding-top: 56px; }
.gruppo-titolo { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; font: 700 16px/20px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.gruppo-titolo::before, .gruppo-titolo::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Lezioni: tutte della stessa misura */
.griglia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; }
.lez { display: flex; flex-direction: column; min-width: 0; }
.lez-cover { position: relative; display: block; overflow: hidden; border-radius: var(--radius-shot); box-shadow: 0 0 0 1px rgba(0, 30, 80, 0.08), var(--shadow-card); transition: box-shadow var(--fast) ease, transform var(--fast) ease; }
.lez-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.lez-cover:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(0, 99, 237, 0.25), var(--shadow-cover); }
.lez-play { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 18px; box-shadow: 0 6px 16px rgba(0, 30, 80, 0.2); transition: background var(--fast) ease, color var(--fast) ease, transform var(--fast) ease; }
.lez-play svg { margin-left: 2px; }
.lez-cover:hover .lez-play { background: var(--blue); color: #fff; transform: scale(1.06); }
.lez-spunta { position: absolute; top: 10px; right: 10px; display: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 18px; box-shadow: 0 0 0 3px #fff; }
.lez.fatta .lez-spunta { display: grid; }

.lez-info { display: flex; flex: 1; align-items: flex-start; gap: 12px; padding: 14px 4px 0; }
.lez-icona { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); font-size: 19px; transition: background var(--fast) ease, color var(--fast) ease; }
.lez.fatta .lez-icona { background: var(--blue); color: #fff; }
.lez-testi { display: flex; flex: 1; flex-direction: column; align-items: flex-start; align-self: stretch; min-width: 0; }
.lez-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 13px; line-height: 18px; color: var(--muted); }
.lez-meta b { font-weight: 600; color: var(--blue-deep-text); letter-spacing: 0.04em; }
.lez-durata { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.lez h3 { margin: 3px 0 6px; font: 700 18px/23px var(--font-display); color: var(--ink); }
.lez h3 a { transition: color var(--fast) ease; }
.lez h3 a:hover { color: var(--blue); }

.segna { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin-top: auto; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--blue); transition: color var(--fast) ease; }
.segna:hover { color: var(--blue-hover); text-decoration: underline; text-underline-offset: 3px; }
.segna .ico { display: none; font-size: 15px; }
.segna[aria-pressed="true"] { color: var(--blue-deep-text); }
.segna[aria-pressed="true"] .ico { display: block; }

/* Il video si apre sopra la pagina */
.player { width: min(1120px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: 0 40px 100px rgba(0, 15, 45, 0.45); overflow: auto; }
.player::backdrop { background: rgba(12, 20, 38, 0.72); }
.player[open] { animation: player-entra 0.2s ease; }
@keyframes player-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.player-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 24px 14px; }
.player-testa h2 { margin-top: 2px; font: 800 26px/32px var(--font-display); letter-spacing: -0.4px; color: var(--ink); text-wrap: balance; }
.player-ris { font-size: 14px; line-height: 20px; }
.player-chiudi { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -4px -8px 0 0; border-radius: 50%; font-size: 22px; color: var(--ink); transition: background var(--fast) ease; }
.player-chiudi:hover { background: var(--surface-cool); }
.player-video { position: relative; background: #0b1222; aspect-ratio: 16 / 9; }
.player-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-fine { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; background: var(--gradient-hero-panel); }
.player-fine-eti { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--blue-deep-text); }
.player-fine-titolo { max-width: 680px; margin-bottom: 18px; font: 800 36px/42px var(--font-display); letter-spacing: -0.6px; color: var(--ink); text-wrap: balance; }
.player-piede { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 12px 24px 14px; }
.player-piede .segna { margin: 0; font-size: 14px; }
.player-guida { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--blue); border-bottom: 1px solid var(--sky-300); }
.player-guida:hover { color: var(--blue-hover); border-bottom-color: var(--blue-hover); }
.player-nav { display: flex; gap: 10px; margin-left: auto; }

/* Su desktop il video prende tutta l'altezza e i dati stanno a destra: niente da scorrere */
@media (min-width: 1180px) and (min-height: 500px) and (min-aspect-ratio: 3 / 2) {
  .player { --pannello: clamp(300px, 22vw, 360px);--video-l: min(calc(100vw - 48px - var(--pannello)), calc((100dvh - 48px) * 16 / 9)); width: calc(var(--video-l) + var(--pannello)); max-height: none; overflow: hidden; }
  .player-box { display: grid; grid-template-columns: var(--video-l) var(--pannello); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "video testa" "video piede"; }
  .player-video { grid-area: video; }
  .player-testa { grid-area: testa; padding: 22px 20px 0 28px; }
  .player-testa h2 { margin-top: 6px; font-size: 24px; line-height: 30px; }
  .player-ris { margin-top: 6px; }
  .player-piede { grid-area: piede; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-end; gap: 16px; padding: 20px 28px 28px; overflow: auto; }
  .player-piede .segna, .player-guida { align-self: flex-start; }
  .player-nav { margin-left: 0; }
  .player-nav .btn { flex: 1; }
}
/* Tablet e finestre basse: video sopra, ma largo quanto basta per stare tutto nello schermo */
@media (min-width: 641px) and (max-width: 1179px), (min-width: 641px) and (max-height: 499px), (min-width: 641px) and (max-aspect-ratio: 3 / 2) {
  .player { width: min(1120px, calc(100vw - 48px), max(480px, calc((100dvh - 250px) * 16 / 9))); }
}

/* Schermi più stretti: stesse card, meno colonne */
@media (max-width: 1100px) {
  .griglia { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apertura { grid-template-columns: minmax(0, 1fr); }
  .apertura h1 { font-size: 44px; }
  .avanzamento { min-width: 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  /* Sul telefono dell'intestazione resta solo la bandiera della lingua */
  .testata-in { grid-template-columns: auto 1fr auto; gap: 8px; }
  .selettore { justify-self: center; }
  .testata-link, .testata-azioni .btn, .lingua-codice, .lingua-freccia { display: none; }
  .lingua-bottone { justify-content: center; width: 40px; padding: 0; }
  .marchio img { width: 126px; }
  .marchio span { display: none; }
  .selettore { padding: 2px; }
  .selettore button { height: 44px; padding: 0 16px; font-size: 15px; }
  .apertura { gap: 24px; padding-top: 32px; }
  .apertura h1 { font-size: 38px; letter-spacing: -0.8px; }
  .apertura-lead { font-size: 16px; line-height: 26px; }
  .anello { width: 64px; height: 64px; }
  .anello b { font-size: 15px; }
  .riquadro { padding: 14px; gap: 12px; }
  .riquadro-testi b { font-size: 17px; line-height: 22px; }
  .riquadro-altra { margin-top: 48px; }
  .gruppo { padding-top: 44px; }
  .gruppo-titolo { gap: 14px; margin-bottom: 20px; font-size: 14px; }
  .griglia { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .catalogo { padding-bottom: 56px; }
  .segna { min-height: 44px; }
  .player { width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .player-testa { padding: 14px 16px 12px; }
  .player-testa h2 { font-size: 21px; line-height: 26px; }
  .player-fine-titolo { font-size: 22px; line-height: 28px; margin-bottom: 8px; }
  .player-fine .btn { height: 44px; font-size: 16px; }
  .player-piede { padding: 10px 16px 16px; }
  .player-nav { width: 100%; margin-left: 0; }
  .player-nav .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
