/* =====================================================================
   NETFITNESS.IT — grafica
   Colori ripresi dal sito alessandralodifitness.com (nero, magenta, oro),
   con il rosa acceso dell'icona come colore di accento.
   ===================================================================== */

@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url(/fonts/montserrat-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url(/fonts/montserrat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url(/fonts/montserrat-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url(/fonts/montserrat-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap; src: url(/fonts/montserrat-latin-900-normal.woff2) format("woff2"); }

:root {
  --bg: #141014;          /* fondo */
  --bg-2: #1E181D;        /* nero del sito */
  --card: #262029;        /* nero-2 del sito */
  --linea: #3a3039;
  --rosa: #FF4DA6;        /* rosa "cartoon" (icona) */
  --rosa-ombra: #B0125F;  /* ombra netta dei pulsanti, effetto cartoon */
  --rosa-scuro: #A3246A;  /* magenta del sito */
  --rosa-chiaro: #E58DBB;
  --oro: #E4C07A;
  --testo: #F6F0EC;
  --grigio: #BDB1B7;
  --ok: #49c58a;
  --raggio: 14px;
  --sicuro-alto: env(safe-area-inset-top, 0px);
  --sicuro-basso: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--testo);
  font-family: "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px;            /* testo comodo da leggere */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
a { color: var(--rosa-chiaro); }
[hidden] { display: none !important; }

/* ---------- marchio ---------- */
.wordmark { font-weight: 900; letter-spacing: .06em; font-size: 22px; line-height: 1; white-space: nowrap; }
.wordmark .w-net { color: var(--rosa); }
.wordmark--big { font-size: 42px; }
.byline { font-size: 14px; color: var(--grigio); letter-spacing: .04em; margin-top: 8px; }
.byline strong { color: var(--testo); font-weight: 600; }

.splash { min-height: 100vh; display: grid; place-items: center; animation: respiro 1.6s ease-in-out infinite; }
@keyframes respiro { 50% { opacity: .55; } }

/* ---------- pulsanti e campi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--rosa); color: #140a10; font-weight: 800; font-size: 18px;
  cursor: pointer; text-decoration: none; transition: transform .1s, box-shadow .1s;
  box-shadow: 0 5px 0 var(--rosa-ombra);
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--rosa-ombra); }
.btn--ghost { box-shadow: none; }
.btn--ghost:active { transform: scale(.98); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn--full { width: 100%; }
.btn--ghost { background: transparent; color: var(--testo); border: 1.5px solid var(--linea); }
.btn--small { min-height: 42px; font-size: 15px; padding: 0 18px; }
.link-btn { background: none; border: 0; color: var(--rosa-chiaro); text-decoration: underline; cursor: pointer; padding: 8px 0; font-size: 15px; }

.field { display: block; margin: 0 0 16px; }
.field span { display: block; font-size: 14px; color: var(--grigio); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 56px; padding: 0 18px; border-radius: 12px;
  background: var(--card); border: 1.5px solid var(--linea); font-size: 18px; outline: none;
}
.field input:focus { border-color: var(--rosa); }
.field input.code { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 700; }

.msg { border-radius: 12px; padding: 12px 16px; font-size: 15px; margin: 0 0 16px; }
.msg--err { background: rgba(255, 77, 166, .12); border: 1px solid rgba(255, 77, 166, .45); }
.msg--info { background: rgba(228, 192, 122, .1); border: 1px solid rgba(228, 192, 122, .4); }

/* ---------- schermata di accesso ---------- */
.login {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(32px + var(--sicuro-alto)) 22px calc(32px + var(--sicuro-basso));
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 77, 166, .22), transparent 60%),
    linear-gradient(var(--bg), var(--bg));
}
.login__box { width: 100%; max-width: 420px; margin: 0 auto; }
.login__brand { text-align: center; margin-bottom: 40px; }
.login h1 { font-size: 24px; margin: 0 0 6px; font-weight: 800; }
.login p.sub { color: var(--grigio); margin: 0 0 24px; font-size: 16px; }
.login__foot { text-align: center; margin-top: 28px; font-size: 13px; color: var(--grigio); }

/* ---------- intestazione ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--sicuro-alto)) 18px 14px;
  background: linear-gradient(var(--bg) 70%, rgba(20, 16, 20, 0));
}
.menu-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); font-weight: 800; color: var(--rosa); cursor: pointer; }

.menu {
  position: fixed; top: calc(64px + var(--sicuro-alto)); right: 14px; z-index: 20;
  background: var(--card); border: 1px solid var(--linea); border-radius: var(--raggio);
  min-width: 230px; padding: 6px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.menu button { display: block; width: 100%; text-align: left; padding: 14px 14px; background: none; border: 0; border-radius: 10px; cursor: pointer; font-size: 16px; }
.menu button:hover { background: var(--bg-2); }
.menu .menu__who { padding: 10px 14px 12px; font-size: 13px; color: var(--grigio); border-bottom: 1px solid var(--linea); margin-bottom: 4px; }

/* ---------- copertina (hero) ---------- */
.hero {
  position: relative; margin: 0 14px; min-height: 340px; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 24px 22px;
  background: var(--card);
}
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .55; }
.hero__bg--vuoto { background: radial-gradient(90% 70% at 80% 10%, rgba(255, 77, 166, .55), transparent 60%), radial-gradient(80% 80% at 0% 100%, rgba(163, 36, 106, .7), transparent 60%), var(--bg-2); opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 25%, rgba(20, 16, 20, .92)); }
.hero > *:not(.hero__bg) { position: relative; z-index: 1; }
.hero__season { font-size: 13px; font-weight: 800; letter-spacing: .18em; color: var(--rosa); text-transform: uppercase; }
.hero__title { font-size: 34px; line-height: 1.1; font-weight: 900; margin: 6px 0 8px; }
.hero__meta { color: var(--grigio); font-size: 15px; margin-bottom: 18px; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- sezioni ---------- */
.section { padding: 26px 0 4px; }
.section h2 { font-size: 20px; font-weight: 800; margin: 0 18px 12px; }
.section h2 small { font-weight: 600; color: var(--grigio); font-size: 14px; margin-left: 6px; }

/* fila di miniature da scorrere */
.row { display: flex; align-items: flex-start; gap: 12px; scroll-padding: 0 18px; overflow-x: auto; padding: 4px 18px 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.tile { flex: 0 0 132px; scroll-snap-align: start; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.tile__img { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--card); }
.tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__num { position: absolute; left: 10px; bottom: 6px; font-size: 44px; font-weight: 900; line-height: 1; color: var(--testo); text-shadow: 0 2px 0 var(--rosa-ombra), 0 0 12px rgba(0,0,0,.6); }
.tile__badge { position: absolute; top: 8px; left: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .08em; background: var(--rosa); color: #140a10; border-radius: 6px; padding: 3px 6px; text-transform: uppercase; text-align: center; }
.tile__play { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(20, 16, 20, .7); display: grid; place-items: center; font-size: 14px; }
.tile__name { font-size: 14px; font-weight: 700; margin-top: 8px; line-height: 1.3; }
.tile__sum { font-size: 12px; color: var(--grigio); }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(80% 60% at 70% 20%, rgba(255, 77, 166, .35), transparent 70%), var(--card); }

/* elenco esercizi */
.list { margin: 0 14px; display: grid; gap: 10px; }
.item { display: flex; gap: 14px; align-items: center; width: 100%; background: var(--card); border: 1px solid var(--linea); border-radius: var(--raggio); padding: 10px; cursor: pointer; text-align: left; }
.item__thumb { flex: 0 0 64px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--bg-2); position: relative; }
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item__thumb .n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 26px; color: var(--rosa); }
.item__body { flex: 1; min-width: 0; }
.item__ep { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--rosa); text-transform: uppercase; }
.item__name { font-weight: 700; font-size: 17px; line-height: 1.3; }
.item__sum { font-size: 14px; color: var(--grigio); }
.item__go { font-size: 22px; color: var(--grigio); padding-right: 6px; }
.superset-label { margin: 10px 4px 0; font-size: 13px; font-weight: 800; letter-spacing: .1em; color: var(--oro); text-transform: uppercase; }

/* ---------- il mio pacchetto ---------- */
.card { margin: 0 14px; background: var(--card); border: 1px solid var(--linea); border-radius: var(--raggio); padding: 18px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linea); font-size: 16px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--grigio); }
.kv span:last-child { font-weight: 700; text-align: right; }
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.pill--ok { background: rgba(73, 197, 138, .15); color: var(--ok); }
.pill--wait { background: rgba(228, 192, 122, .15); color: var(--oro); }
.pill--late { background: rgba(255, 77, 166, .15); color: var(--rosa); }

/* ---------- schermate di stato (attesa, scaduto, non attivo) ---------- */
.state { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 30px 26px; max-width: 480px; margin: 0 auto; }
.state__icon { font-size: 54px; margin-bottom: 10px; }
.state h1 { font-size: 26px; font-weight: 900; margin: 0 0 10px; }
.state p { color: var(--grigio); margin: 0 0 16px; }
.countdown { font-size: 56px; font-weight: 900; color: var(--rosa); line-height: 1; margin: 10px 0 2px; }
.countdown-label { font-size: 14px; color: var(--grigio); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 20px; }

/* ---------- avviso installazione ---------- */
.install { margin: 18px 14px 0; background: linear-gradient(135deg, rgba(255, 77, 166, .16), rgba(163, 36, 106, .16)); border: 1px solid rgba(255, 77, 166, .35); border-radius: var(--raggio); padding: 14px 16px; font-size: 15px; display: flex; gap: 12px; align-items: flex-start; }
.install b { color: var(--testo); }
.install .x { margin-left: auto; background: none; border: 0; color: var(--grigio); font-size: 20px; cursor: pointer; padding: 0 4px; }

.admin-bar { margin: 0 14px 14px; padding: 12px 16px; border-radius: 12px; background: rgba(228, 192, 122, .1); border: 1px solid rgba(228, 192, 122, .4); font-size: 14px; }

.footer { text-align: center; color: var(--grigio); font-size: 12px; padding: 34px 20px calc(30px + var(--sicuro-basso)); }

/* ---------- finestra dell'episodio ---------- */
.episode { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.episode__top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--sicuro-alto)) 14px 10px; background: var(--bg); }
.episode__close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); font-size: 22px; cursor: pointer; }
.episode__count { font-size: 13px; font-weight: 800; letter-spacing: .14em; color: var(--rosa); text-transform: uppercase; }
/* video incorniciato come una pellicola: perforazioni rosa ai lati che sfumano in alto e in basso */
.video {
  --foro: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='34'%3E%3Crect x='4' y='9' width='14' height='16' rx='4' fill='%23FF4DA6'/%3E%3C/svg%3E");
  position: relative; width: fit-content; max-width: 100%; margin: 6px auto 0; padding: 14px 30px;
  background: #0b080b; border-radius: 22px;
}
.video::before, .video::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30px;
  background-image: var(--foro); background-repeat: repeat-y; background-position: center top; background-size: 22px 34px;
  opacity: .85;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
.video::before { left: 4px; }
.video::after { right: 4px; }
.video__screen { position: relative; aspect-ratio: 9 / 16; width: min(calc(100vw - 60px), calc(64vh * 9 / 16), 400px); margin: 0 auto; border-radius: 16px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 2px rgba(255, 77, 166, .25), 0 10px 30px rgba(0, 0, 0, .6); }
.video__screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .novideo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--grigio); text-align: center; padding: 20px; }
.episode__body { max-width: 560px; margin: 0 auto; padding: 18px 18px calc(30px + var(--sicuro-basso)); }
.episode__name { font-size: 26px; font-weight: 900; line-height: 1.15; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--linea); }
.chip--rosa { border-color: var(--rosa); color: var(--rosa); }
.chip--oro { border-color: var(--oro); color: var(--oro); }
.note { background: var(--card); border-left: 4px solid var(--rosa); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 16px; }
.note b { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--rosa); margin-bottom: 2px; }
.sets { width: 100%; border-collapse: collapse; font-size: 16px; margin-bottom: 20px; }
.sets th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--grigio); font-weight: 700; text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linea); }
.sets td { padding: 12px 6px; border-bottom: 1px solid var(--linea); }
.sets td:first-child { font-weight: 800; color: var(--rosa); width: 36px; }
.sets .warm { color: var(--oro); font-size: 13px; font-weight: 700; }
.episode__nav { display: flex; gap: 10px; }
.episode__nav .btn { flex: 1; padding: 0 12px; font-size: 17px; white-space: nowrap; }

@media (min-width: 900px) {
  .hero { min-height: 420px; max-width: 1100px; margin: 0 auto; }
  .section, .list, .card { max-width: 1100px; margin-left: auto; margin-right: auto; }
  .tile { flex-basis: 160px; }
}

/* =====================================================================
   AREA DI GESTIONE (admin.js)
   ===================================================================== */
.adm-tag { font-size: 11px; letter-spacing: .14em; color: var(--oro); font-weight: 800; margin-left: 6px; vertical-align: middle; }
.adm-tabs { display: flex; gap: 6px; padding: 0 14px 10px; position: sticky; top: calc(72px + var(--sicuro-alto)); z-index: 4; background: var(--bg); }
.adm-tabs button { flex: 1; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--linea); background: var(--card); font-weight: 700; cursor: pointer; }
.adm-tabs button.on { background: var(--rosa); color: #140a10; border-color: var(--rosa); }
.adm-body { padding-bottom: 20px; max-width: 900px; margin: 0 auto; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 14px 10px; flex-wrap: wrap; }
.adm-head h2 { margin: 0; font-size: 22px; font-weight: 900; }
.adm-head h2 small { color: var(--grigio); font-size: 15px; font-weight: 600; }
.adm-search { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--linea); font-size: 16px; outline: none; }
.adm-head .adm-search { flex: 1 1 220px; }
.adm-hint { color: var(--grigio); font-size: 14px; margin: 6px 14px 12px; }
.card .adm-hint { margin: 6px 0 12px; }
.adm-title { margin: 6px 14px 12px; font-size: 26px; font-weight: 900; }
.adm-body > .link-btn { margin: 4px 14px 0; }
.adm-card { margin-bottom: 14px; }
.adm-card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 800; }
.adm-card select, .adm-card .field input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; background: var(--bg-2); border: 1.5px solid var(--linea); font-size: 16px; }
.adm-card details summary { cursor: pointer; font-weight: 700; color: var(--rosa-chiaro); margin: 10px 0 14px; }
.adm-row { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-row .field { flex: 1 1 120px; }
.adm-check { display: flex !important; align-items: center; gap: 8px; padding-top: 22px; }
.adm-check input { width: 22px !important; min-height: 22px !important; }
.adm-alert { margin: 14px 14px 0; padding: 14px 16px; border-radius: var(--raggio); background: rgba(255, 77, 166, .12); border: 1.5px solid rgba(255, 77, 166, .55); }
.adm-alert--oro { background: rgba(228, 192, 122, .1); border-color: rgba(228, 192, 122, .5); }
.adm-alert b { display: block; margin-bottom: 6px; }
.adm-alert__row { padding: 8px 0; border-top: 1px solid var(--linea); cursor: pointer; font-size: 15px; }
.switch { display: flex; align-items: center; gap: 10px; margin: 14px 0; cursor: pointer; font-size: 16px; }
.switch input { display: none; }
.switch span { width: 52px; height: 30px; border-radius: 999px; background: var(--linea); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--testo); transition: left .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { left: 25px; }
.adm-item__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.adm-ico { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--linea); background: var(--bg-2); cursor: pointer; font-size: 16px; }
.adm-ico:disabled { opacity: .3; }
.adm-sets { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-sets th { text-align: left; color: var(--grigio); font-weight: 700; font-size: 12px; padding: 4px 3px; }
.adm-sets td { padding: 3px; }
.adm-sets input, .adm-sets select { width: 100%; min-width: 0; min-height: 40px; padding: 0 6px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--linea); font-size: 15px; }
.adm-sets td:first-child { color: var(--rosa); font-weight: 800; width: 22px; }
.adm-results { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; max-height: 320px; overflow-y: auto; }
.adm-chip { border: 1px solid var(--linea); background: var(--bg-2); border-radius: 999px; padding: 9px 14px; cursor: pointer; font-size: 14px; text-align: left; }
.adm-chip small { color: var(--grigio); }
.adm-save { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 12px 14px calc(12px + var(--sicuro-basso)); background: linear-gradient(rgba(20, 16, 20, 0), var(--bg) 30%); }
.adm-save .btn:first-child { flex: 1; }
.adm-es { cursor: default; }
.adm-guid { width: 100%; margin-top: 8px; min-height: 40px; padding: 0 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--linea); font-size: 13px; color: var(--grigio); }
.toast { position: fixed; left: 50%; top: calc(16px + var(--sicuro-alto)); transform: translateX(-50%); z-index: 100; background: var(--ok); color: #08130d; font-weight: 700; padding: 12px 20px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: 90vw; text-align: center; }
.toast--err { background: var(--rosa); color: #140a10; }

.adm-sets .adm-tipo { min-width: 64px; }
.adm-sets th:nth-child(2), .adm-sets td:nth-child(2) { width: 70px; }

.install__steps { margin: 8px 0 0; padding-left: 20px; }
.install__steps li { margin: 6px 0; }
.ico { width: 22px; height: 22px; vertical-align: -6px; color: var(--rosa); margin: 0 2px; }
