/* =====================================================================
   Voltare Pagina — accademia (modulo introduttivo)
   Stessi colori e caratteri della landing, sempre in chiaro. Piatto: niente sfumature né gradienti.
   ===================================================================== */
:root {
  --bg: #F7F2EA; --card: #FFFDF9; --soft: #EFE7DC;
  --ink: #0D2125; --muted: #586869; --line: rgba(13, 33, 37, .09); --line2: rgba(13, 33, 37, .16);
  --petrol: #0B2E33; --petrol2: #0E3A40; --champ: #F6D7B9; --copper: #B87C59; --copper-ink: #9A5F3D;
  --green: #2F7672; --green-bg: rgba(47, 118, 114, .1);
  --cta: #C8916A; --cta-hover: #D29B74; --cta-ink: #1B1009;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --r-md: 12px; --r-lg: 16px; --r-btn: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
img, video, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
main { flex: 1; outline: none; }
main.wrap { padding-top: 48px; padding-bottom: 64px; } /* aria tra la linea della barra e il primo elemento (.wrap da solo azzererebbe il padding verticale) */

/* testo */
.eyebrow { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--copper-ink); }
.h1 { margin: 0; font-size: clamp(1.7rem, 4.2vw, 2.5rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 750; }
.h1--lesson { font-size: clamp(1.45rem, 3.2vw, 2rem); }
.h2 { margin: 0; font-size: clamp(1.15rem, 2.4vw, 1.45rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
.lead { margin: 10px 0 0; color: var(--muted); font-size: 1.02rem; max-width: 60ch; }
.muted { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.lbl { display: block; font-size: .84rem; font-weight: 650; margin-bottom: 6px; }

/* bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--r-btn); border: 1px solid transparent;
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn small { font-weight: 600; color: var(--muted); font-size: .8rem; }
.btn--cta { background: var(--cta); color: var(--cta-ink); }
.btn--ghost { background: var(--card); border-color: var(--line2); }
.btn, .row, .sec__head { touch-action: manipulation; }
.btn--icon { padding: 0; width: 46px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn:active { transform: translateY(1px); }

/* barra in alto */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top__in { display: flex; align-items: center; gap: 14px; height: 64px; }
.top__mid { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* da computer logo al centro, avanzamento a destra; dal telefono tutto a sinistra */
@media (min-width: 641px) {
  .top__in { display: grid; grid-template-columns: 1fr auto 1fr; }
  .top__mid { grid-column: 2; }
  .top__prog { grid-column: 3; justify-self: end; }
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__mark { width: 30px; height: 30px; }
.brand__word { font-size: 18px; font-weight: 650; letter-spacing: -.035em; }
.brand__word i { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.2em; letter-spacing: -.01em; }
.top__tag { font-size: .78rem; font-weight: 650; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line2); }
.top__prog { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.top__prog b { color: var(--ink); }
.ring { width: 30px; height: 30px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring__bg { stroke: var(--soft); }
.ring__fg { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
@media (max-width: 520px) { .top__tag { display: none; } .brand__word { font-size: 16px; } }

/* copertina della sezione (come le miniature del corso tedesco) */
/* testi in unità del contenitore (cqw): restano in proporzione a qualsiasi larghezza della copertina */
.cover { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--petrol); color: var(--champ); container-type: inline-size; }
.cover__img { position: absolute; top: 0; right: 0; height: 100%; width: 46%; object-fit: cover; object-position: 58% 20%; }
.cover__txt { position: absolute; inset: 0 46% 0 0; display: flex; flex-direction: column; gap: 1.6cqw; padding: 6cqw 4cqw 6cqw 6cqw; z-index: 1; }
.cover__brand { display: inline-flex; align-items: center; gap: 1.2cqw; font-size: 3.4cqw; font-weight: 700; letter-spacing: .02em; opacity: .85; margin-bottom: auto; }
.cover__brand svg { width: 4.4cqw; height: 4.4cqw; }
.cover__k { font-size: 3cqw; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .65; }
.cover__t { font-family: var(--serif); font-size: 6.4cqw; line-height: 1.04; font-weight: 600; color: #F4EEE6; }
.cover__done { position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%; width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }
.cover__done svg { width: 20px; height: 20px; }

/* accesso */
.gate { display: grid; place-items: center; padding: 4vh 0; }
.gate__card { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(24px, 5vw, 40px); }
.gate__mark { width: 40px; height: 40px; margin-bottom: 18px; }
.gate .h1 { font-size: clamp(1.5rem, 4vw, 1.9rem); }
.gate__form { margin-top: 22px; }
.gate__row { display: flex; gap: 8px; }
.gate__field { flex: 1; min-width: 0; display: flex; }
/* altezza fissa e line-height "normal": Safari altrimenti mette testo e cursore troppo in basso */
.gate__field input { width: 100%; height: 46px; margin: 0; padding: 0 14px; font-size: 16px; line-height: normal; -webkit-appearance: none; appearance: none;
  border-radius: var(--r-btn); border: 1px solid var(--line2); background: #fff; }
.gate__field input:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px rgba(184, 124, 89, .18); }
.gate__msg { margin: 8px 0 0; min-height: 1.2em; font-size: .88rem; color: #A2453B; }
.gate__msg:empty { margin: 0; min-height: 0; }
/* email non trovata: il campo fa un breve "no" con la testa, diventa rosso per un attimo e torna normale; il messaggio resta */
.gate__field input { transition: border-color .6s var(--ease), background-color .6s var(--ease), box-shadow .6s var(--ease); }
.gate__field input.is-error { border-color: #C2554A; background-color: #FFF5F3; box-shadow: 0 0 0 3px rgba(194, 85, 74, .16); transition-duration: .12s; }
/* si muove il contenitore, non il campo: Safari dopo un movimento del campo a volte ridisegna il testo fuori posto */
.gate__field.is-shaking { animation: no-shake .46s cubic-bezier(.36, .07, .19, .97); }
@keyframes no-shake {
  0%, 100% { transform: none; }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-1.5px); }
}
.gate__msg.is-new { animation: msg-in .3s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gate__field.is-shaking, .gate__msg.is-new { animation: none; } }
.gate__or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: .8rem; }
.gate__or::before, .gate__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gate .btn--ghost { margin-top: 12px; }
@media (max-width: 420px) { .gate__row { flex-direction: column; } .gate__field { flex: none; } .gate__card { padding: 22px 18px; } }

/* elenco */
.hello { margin-bottom: 24px; }
.resume { display: grid; grid-template-columns: 200px 1fr auto; align-items: center; gap: 22px; padding: 14px 22px 14px 14px; margin-bottom: 28px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; transition: border-color .2s var(--ease); }
.resume__img { position: relative; border-radius: 10px; overflow: hidden; }
.resume__poster { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; object-fit: cover; }
.resume--done { grid-template-columns: 1fr; padding: 22px; }
@media (max-width: 720px) {
  .resume { grid-template-columns: 1fr; gap: 14px; padding: 12px 12px 16px; }
  .resume__body { padding: 0 6px; }
  .resume .btn { margin: 0 6px; }
}

.secs { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px clamp(8px, 2vw, 18px); }
.sec + .sec { border-top: 1px solid var(--line); }
.sec__head { display: grid; grid-template-columns: 200px 1fr 28px; align-items: center; gap: 22px; width: 100%; padding: 16px 6px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: var(--r-md); }
.sec__txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sec__t { font-size: clamp(1.02rem, 2.2vw, 1.3rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.22; }
.sec__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .92rem; color: var(--muted); }
.sec__count.is-done { color: var(--green); font-weight: 650; }
.sec__dur { display: inline-flex; align-items: center; gap: 5px; }
.sec__dur svg { width: 16px; height: 16px; }
.sec__chev { color: var(--muted); transition: transform .25s var(--ease); }
.sec__chev svg { width: 22px; height: 22px; }
.sec.is-open .sec__chev { transform: rotate(180deg); }
.sec > .list { display: none; margin: 0 0 14px; }
.sec.is-open > .list { display: block; }
@media (max-width: 640px) {
  .sec__head { grid-template-columns: 112px 1fr 22px; gap: 14px; padding: 12px 2px; }
  .sec__head .cover__brand, .sec__head .cover__k { display: none; }
  .sec__head .cover__txt { justify-content: center; }
  .sec__head .cover__t { font-size: 8.4cqw; }
  .sec__head .cover__done { width: 28px; height: 28px; }
  .sec__head .cover__done svg { width: 15px; height: 15px; }
  .sec__meta { font-size: .84rem; }
}

/* righe delle lezioni */
.list { list-style: none; padding: 0; margin: 0; }
.row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; font-size: .96rem; }
.row__ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line2); }
.row__ico svg { width: 15px; height: 15px; }
.row__d { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.row.is-done .row__ico { background: var(--green); border-color: var(--green); color: #fff; }
.row.is-current { background: var(--soft); font-weight: 700; }
.row.is-current .row__ico { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.row.is-current .row__ico svg { margin-left: 2px; }
.row.is-done.is-current .row__ico { background: var(--green); border-color: var(--green); }
.row.is-done.is-current .row__ico svg { margin-left: 0; }

/* lezione */
/* "Tutte le lezioni": piccolo bottone a pillola, stessa aria sopra e sotto */
.crumb { margin: 0 0 20px; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 14px 0 9px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card);
  font-size: .88rem; font-weight: 650; text-decoration: none; color: var(--ink); transition: border-color .2s var(--ease); }
.crumb svg { width: 18px; height: 18px; color: var(--muted); }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__soon { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: var(--petrol); color: #F4EEE6; padding: 20px; }
.player__soon .eyebrow { color: var(--champ); }
.player__soon p { margin: 0; }
.note { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--green-bg); color: var(--green); font-size: .94rem; }
.note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.note b { color: var(--ink); }
.note--booked { margin: 0 0 24px; padding: 14px 16px; font-size: .96rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.lesson__side { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.side__sec + .side__sec { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.side__t { margin: 8px 12px 4px; font-size: .84rem; font-weight: 700; line-height: 1.3; }
.side__t span { display: block; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--copper-ink); margin-bottom: 2px; }
.list--side .row { padding: 8px 10px; font-size: .88rem; }
@media (max-width: 960px) {
  .lesson { grid-template-columns: 1fr; }
  .lesson__side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  main.wrap { padding-top: 32px; }
  .top__in { height: 58px; }
  .lesson__side { position: static; top: auto; }
  .crumb { margin-bottom: 16px; }
  .player { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; }
  .actions .btn--cta, .actions #dl { flex: 1; }
}

/* piè di pagina */
.foot { border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.foot__in { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding-top: 18px; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.foot a { text-decoration: none; }

/* effetti al passaggio del mouse solo dove c'è un mouse: sul telefono non restano "accesi" dopo il tocco */
@media (hover: hover) {
  .btn--cta:hover { background: var(--cta-hover); }
  .btn--ghost:hover { border-color: var(--ink); }
  a.resume:hover { border-color: var(--line2); }
  .row:hover { background: var(--soft); }
  .crumb a:hover { border-color: var(--ink); }
  .foot a:hover { color: var(--ink); }
}
@media (max-width: 360px) {
  .top__prog span { display: none; }
  .actions .btn { padding: 0 14px; font-size: .9rem; }
  .actions small { display: none; }
}

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
