@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #000000;
  --bg2: #050505;
  --brand: #0022CF;
  --glow: #0022CF;
  --card: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.1);
  --border2: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --dim: #888888;
  --mute: #555555;
  --r: 18px;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #000000 0%, #050505 52%, #0b0b0b 100%);
}

/* Atmosfera index.html */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 72% 26%, rgba(0, 34, 207, 0.14), transparent 28%),
    radial-gradient(circle at 68% 62%, rgba(0, 34, 207, 0.1), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(0, 34, 207, 0.12), transparent 40%),
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.02), transparent 40%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 50% 50%, black 25%, transparent 80%);
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 clamp(16px, 4vw, 28px);
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.header::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

/* Logo image style */
.logo-img {
  display: block;
  height: 60px;
  width: auto;
  margin-left: 0;
  filter: drop-shadow(0 3px 14px rgba(0, 34, 207, 0.35));
}

.logo-img-auth {
  height: 70px;
  width: auto;
}

@media (max-width: 768px) {
  .header {
    min-height: 76px;
    height: auto;
    padding: 10px 12px;
    gap: 10px;
  }

  .logo {
    min-width: 0;
    flex: 1;
  }

  .logo-img {
    height: 42px;
    width: auto;
    max-width: 100%;
  }

  .logo-img-auth {
    height: 64px;
    width: auto;
  }

  #headerRight {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 52%;
  }

  #headerRight button {
    font-size: 0.62rem !important;
    padding: 6px 8px !important;
  }
}

/* LAYOUT & TYPOGRAPHY */
.wrap {
  max-width: 1100px;
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0;
}

@media(min-width: 768px) {
  .wrap {
    width: min(1100px, calc(100% - 64px));
  }
}

@media(min-width: 1024px) {
  .wrap {
    width: min(1100px, calc(100% - 88px));
  }
}

.page {
  padding: 40px 0 100px;
}

@media(min-width: 768px) {
  .page {
    padding: 60px 0 120px;
  }
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.page-sub {
  font-size: 1.05rem;
  color: var(--dim);
  margin-bottom: 40px;
  line-height: 1.8;
  max-width: 620px;
}

/* SECTION LABEL STYLE INDEX */
.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.section-label::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--mute);
}

/* CARD CON EFFETTO VETRO (INDEX STYLE) */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.01) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* alleggerito per il glassmorphism */
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 16px;
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 34, 207, 0.15), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 34, 207, 0.15);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg2);
  overflow: hidden;
  position: relative;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1) brightness(0.7);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card-thumb img {
  filter: grayscale(0%) contrast(1) brightness(1);
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover .play-overlay {
  opacity: 1;
}

.play-btn {
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* INPUTS & BUTTONS */
.search-input,
.filter-sel,
.fi,
.fa,
.fs,
.auth-input,
.series-input,
.fbtextarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.95rem;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.auth-input {
  margin-bottom: 16px;
}

.search-input:focus,
.filter-sel:focus,
.fi:focus,
.fa:focus,
.fs:focus,
.auth-input:focus,
.series-input:focus,
.fbtextarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.btn-pri,
.btn-sub,
.series-btn-save {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.auth-btn {
  background: var(--brand);
  color: #ffffff;
  border: none;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-display);
  width: 100%;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.btn-sub {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-pri:hover,
.auth-btn:hover,
.series-btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 34, 207, 0.3);
}

.btn-sub:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-pri:disabled,
.auth-btn:disabled,
.btn-sub:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* PREMIUM APP CARDS (REPLACING NEON BUTTONS) */
.neon-buttons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
  padding: 0;
}

@media(min-width: 640px) {
  .neon-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 60px;
  }
}

.neon-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r);
  padding: 30px 24px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.neon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 34, 207, 0.15), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.neon-btn:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 40px rgba(0, 34, 207, 0.15);
}

.neon-btn:hover::before {
  opacity: 0.8;
}

.neon-btn>* {
  position: relative;
  z-index: 1;
}

.neon-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 1.5rem;
  transition: all 0.4s ease;
}

.neon-icon svg {
  width: 24px;
  height: 24px;
  stroke: rgba(255, 255, 255, 0.8);
  transition: stroke 0.3s ease;
}

.neon-btn:hover .neon-icon {
  background: rgba(0, 34, 207, 0.15);
  border-color: rgba(0, 34, 207, 0.3);
  box-shadow: 0 0 20px rgba(0, 34, 207, 0.25);
}

.neon-btn:hover .neon-icon svg {
  stroke: #ffffff;
}

.neon-btn-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.neon-btn-sub {
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--dim);
}

/* AUTH & MODALS */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card,
.profile-card {
  background: rgba(15, 15, 15, 0.88);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

@media (min-width: 768px) {
  .auth-wrap {
    padding: 40px 24px;
  }

  .auth-card {
    max-width: 520px;
    padding: 56px 48px;
  }

  .profile-card {
    padding: 48px 40px;
  }

  .auth-card .auth-input,
  .auth-card .auth-btn {
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .auth-card {
    max-width: 560px;
    padding: 64px 56px;
  }
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.auth-sub {
  text-align: center;
  color: var(--dim);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .auth-title {
    font-size: 2rem;
  }

  .auth-sub {
    font-size: 1rem;
    margin-bottom: 36px;
  }

  .auth-input {
    padding: 14px 16px;
    font-size: 1rem;
  }

  .auth-btn {
    padding: 15px 24px;
    font-size: 1rem;
  }
}

.auth-toggle {
  text-align: center;
  margin-top: 24px;
  color: var(--dim);
  font-size: 0.9rem;
}

.auth-toggle a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

.auth-footer-back {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  padding: 12px 20px;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-footer-back:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .auth-footer-back {
    bottom: 16px;
    font-size: 0.85rem;
    padding: 10px 16px;
  }
}

.auth-error {
  background: rgba(0, 34, 207, 0.1);
  color: #0022CF;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 34, 207, 0.2);
}

/* MISC & UTILS */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.empty {
  grid-column: 1/-1;
  padding: 80px 20px;
  text-align: center;
  color: var(--dim);
}

/* CONTENT BOXES - PADDING INTERNO STANDARD */
.content-box {
  background: var(--card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: 32px;
}

/* FEEDBACK TATTILE */
.tap-success {
  animation: tap-success-pulse 0.4s ease;
}

@keyframes tap-success-pulse {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(0.95);
  }

  60% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.btn-saving {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-done {
  background: #0022CF !important;
  color: white !important;
  pointer-events: none;
}

.btn-done::after {
  content: ' ✓';
}

/* Toast migliorato: più grande e centrato su mobile */
@media (max-width: 768px) {
  .toast {
    left: 20px !important;
    right: 20px !important;
    bottom: 80px !important;
    text-align: center;
    font-size: 1rem !important;
    padding: 16px 20px !important;
  }
}

/* Card tap effect su mobile */
.card:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* Tutti i bottoni: effetto tap su mobile */
.btn-pri:active,
.btn-sub:active,
.btn-sm:active,
.auth-btn:active,
.neon-btn:active,
.fb-option:active,
.toggle-switch:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* SKELETON LOADING */
.skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.03) 25%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16/9;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-line-short {
  width: 60%;
}

.skeleton-line-long {
  width: 90%;
}

.skeleton-btn {
  height: 48px;
  border-radius: 8px;
  width: 100%;
}

/* LOADING OVERLAY per navigazione */
.nav-loading {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 999;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-loading.active {
  opacity: 1;
}

.nav-loading-bar {
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: nav-loading-move 0.8s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes nav-loading-move {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(350%);
  }
}

/* TRANSIZIONI TRA PAGINE */
#app {
  transition: opacity 0.15s ease;
}

#app.fade-out {
  opacity: 0;
}

#app.fade-in {
  opacity: 1;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #fff;
  color: #000;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.err {
  background: #0022CF;
  color: #fff;
}

/* EXERCISE PAGE */
.ex-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

@media(max-width: 900px) {
  .ex-layout {
    grid-template-columns: 1fr;
  }
}

.video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
}

.ex-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(161, 161, 170, 0.2) 0%, rgba(161, 161, 170, 0.1) 100%);
  border: 1px solid rgba(161, 161, 170, 0.4);
  color: #a1a1aa;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ex-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 16px 0;
}

.ex-desc {
  font-size: 1rem;
  color: var(--dim);
  line-height: 1.7;
}

.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.spec {
  background: var(--card);
  padding: 16px;
}

.spec-l {
  font-size: 0.75rem;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-weight: 600;
}

.spec-v {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
}

.sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sblock,
.my-series-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.sblock-title,
.my-series-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
  display: block;
}

/* ADMIN TABS */
.admin-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 32px;
  overflow-x: auto;
  max-width: 100%;
}

.atab {
  background: transparent;
  border: none;
  color: var(--dim);
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.atab.on,
.atab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-del {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-del:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ADMIN CARDS IMPROVED */
.admin-user-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.admin-user-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 34, 207, 0.05), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.admin-user-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.admin-user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-user-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-card-meta {
  font-size: 0.82rem;
  color: var(--dim);
  line-height: 1.5;
}

.admin-user-card-meta strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.admin-user-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.admin-user-card-actions .btn-sm {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  border-radius: 10px;
  font-size: 0.8rem;
}

.empty-user-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.empty-user-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

@media (max-width: 560px) {
  .admin-user-card-actions {
    flex-direction: column;
  }

  .admin-user-card-actions .btn-sm {
    width: 100%;
  }

  .admin-user-card-name {
    font-size: 1.05rem;
  }
}

/* ============================================
   SCHEDULE BUILDER STYLES (RESTORED)
============================================ */
.builder-day-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: clamp(16px, 4vw, 24px);
  margin-bottom: 24px;
  position: relative;
}

.builder-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.builder-day-icon {
  width: 32px;
  height: 32px;
  background: var(--brand);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.builder-ex-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.builder-ex-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.builder-grid-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

@media (min-width: 640px) {
  .builder-grid-inputs {
    grid-template-columns: repeat(4, 1fr);
  }
}

.builder-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.builder-input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.builder-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  transition: all 0.2s;
}

.builder-input:focus {
  border-color: var(--brand);
  background: rgba(0, 0, 0, 0.3);
}

.superset-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-top: 12px;
  transition: background 0.2s;
}

.superset-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.superset-label {
  font-size: 0.85rem;
  color: var(--dim);
  font-weight: 500;
}

.scheduleSuperSet:checked~.superset-label {
  color: #fff;
}

/* Prevent button clipping in dense admin rows on mobile */
@media(max-width: 560px) {
  .mobile-stack-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .mobile-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* TOGGLE SWITCH */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s ease;
  border: none;
}

.toggle-switch.active {
  background: #0022CF;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
  left: 22px;
}

/* FEEDBACK BUTTONS */
.fb-option {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-weight: 500;
  width: 100%;
}

.fb-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.fb-option.selected {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.fb-option.selected span {
  color: #000 !important;
}

/* PROFILE MODAL */
.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.profile-modal.show {
  display: flex;
}

.profile-modal .profile-card {
  width: 100%;
  max-width: 450px;
}

.profile-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.profile-close:hover {
  opacity: 0.7;
}

.profile-header {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  margin-top: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-label {
  color: var(--dim);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-value {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  max-width: 55%;
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #EF4444;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
  width: 100%;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ADMIN FORM STYLES */
.fg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.fl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.9rem;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.fa {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.85rem;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
  min-height: 100px;
  resize: vertical;
}

.fs {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.9rem;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.fi:focus,
.fa:focus,
.fs:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

option {
  background: var(--bg2);
  color: var(--text);
}

/* EXERCISE LIST */
.ex-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.ex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--card);
  padding: 16px 20px;
  transition: all 0.2s ease;
  flex-wrap: wrap;
}

.ex-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ex-row>div:first-child {
  flex: 1;
  min-width: 300px;
}

.ex-row-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.ex-row-meta {
  font-size: 0.75rem;
  color: var(--mute);
  letter-spacing: 0.02em;
}

.ex-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .ex-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ex-row-actions {
    width: 100%;
  }
}

/* ANIMAZIONI SCROLL */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up-delay-1 {
  transition-delay: 0.1s;
}

.fade-up-delay-2 {
  transition-delay: 0.2s;
}

.fade-up-delay-3 {
  transition-delay: 0.3s;
}

.fade-up-delay-4 {
  transition-delay: 0.4s;
}

/* Hero entrance animation */
.hero-animate {
  opacity: 0;
  transform: translateY(30px);
  animation: hero-enter 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-animate-delay-1 {
  animation-delay: 0.2s;
}

.hero-animate-delay-2 {
  animation-delay: 0.4s;
}

.hero-animate-delay-3 {
  animation-delay: 0.6s;
}

.hero-animate-delay-4 {
  animation-delay: 0.8s;
}

@keyframes hero-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Divider animato */
.divider-animate {
  width: 0;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.divider-animate.visible {
  width: 100%;
}

/* Smooth scroll per tutto il sito */
html {
  scroll-behavior: smooth;
}

/* ============================================
   MOBILE FIX GLOBALI LAYOUT
============================================ */
img,
iframe,
video,
canvas,
svg {
  max-width: 100%;
}

* {
  min-width: 0;
}

.wrap,
.page,
.content-box,
.card,
.auth-card,
.profile-card,
.sblock,
.my-series-block,
.ex-layout,
.sidebar,
.video-wrap,
.ex-row,
.ex-row>div,
.ex-row-actions,
.profile-row,
.grid,
.grid2 {
  max-width: 100%;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

select,
input,
textarea,
button {
  max-width: 100%;
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .wrap {
    width: min(100%, calc(100% - 24px));
    max-width: 100%;
  }

  .page {
    padding: 28px 0 90px;
  }

  .content-box,
  .card,
  .sblock,
  .my-series-block {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .auth-card,
  .profile-card {
    width: 100%;
    overflow: hidden;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .grid2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ex-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar {
    position: static;
    top: auto;
    width: 100%;
  }

  .video-wrap {
    width: 100%;
    max-width: 100%;
  }

  .specs {
    grid-template-columns: 1fr;
  }

  .spec {
    width: 100%;
  }

  .card-body,
  .content-box,
  .sblock,
  .my-series-block {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-title,
  .ex-title,
  .auth-title,
  .profile-header {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ex-desc,
  .profile-value,
  .auth-sub,
  .page-sub {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .chip,
  .ex-tag {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .admin-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .atab {
    flex: 0 0 auto;
  }

  .ex-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ex-row>div:first-child {
    min-width: 0;
    width: 100%;
  }

  .ex-row-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .profile-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .profile-value {
    max-width: 100%;
    text-align: left;
  }

  .neon-buttons-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .neon-btn {
    width: 100%;
    max-width: 100%;
    min-height: auto;
  }

  .series-form,
  [id^="fbNote-"] {
    width: 100%;
    max-width: 100%;
  }

  .fbtextarea,
  .series-input,
  .auth-input,
  .fi,
  .fa,
  .fs {
    width: 100%;
    max-width: 100%;
  }

  .btn-pri,
  .btn-sub,
  .auth-btn,
  .btn-sm,
  .series-btn-save {
    max-width: 100%;
  }

  .mobile-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .schedule-inline-2 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .schedule-day-head {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .admin-users-toolbar {
    grid-template-columns: 1fr !important;
  }

  .admin-users-toolbar .btn-pri,
  .admin-users-toolbar input {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .ex-title {
    font-size: 2rem;
    line-height: 1.1;
    margin: 18px 0 20px 0 !important;
  }

  .video-wrap {
    border-radius: 12px;
  }

  .ex-tags-row {
    gap: 6px !important;
  }

  .sidebar {
    margin-top: 4px;
  }

  .back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 768px) {
  [style*="display:flex"] {
    max-width: 100%;
  }

  [style*="display:flex"][style*="gap"]>* {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .reports-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
  }

  .reports-toolbar h3 {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  .reports-toolbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .reports-toolbar .btn-pri:last-child {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.auth-wrap {
  width: 100%;
}

.auth-card {
  margin: 0 auto;
}

/* ============================================
   FIX DEFINITIVO LOGIN DESKTOP
============================================ */
#authScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#authScreen .auth-card {
  width: 100%;
  max-width: 420px !important;
  margin: 0 auto;
}

@media (min-width: 768px) {
  #authScreen .auth-card {
    max-width: 520px !important;
    padding: 56px 48px !important;
  }
}

@media (min-width: 1200px) {
  #authScreen .auth-card {
    max-width: 560px !important;
    padding: 64px 56px !important;
  }
}

@media (min-width: 768px) {
  #authScreen .auth-sub {
    margin-bottom: 34px;
    font-size: 1rem;
  }

  #authScreen .auth-input {
    padding: 15px 16px;
    font-size: 1rem;
    margin-bottom: 14px;
  }

  #authScreen .auth-btn {
    padding: 15px 20px;
    font-size: 1rem;
    margin-top: 10px;
  }

  #authScreen .auth-toggle {
    margin-top: 22px;
    font-size: 0.95rem;
  }
}

/* ============================================
   MOBILE-FIRST SCHEDULE BLOCK BUILDER
============================================ */

.blocks-builder-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.block-builder-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr 38px;
  gap: 8px;
  align-items: center;
}

.block-builder-row .builder-input {
  min-height: 44px;
  font-size: 0.95rem;
  padding: 10px 12px;
}

.block-remove-btn {
  width: 38px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, 0.10);
  color: #EF4444;
  font-size: 1.15rem;
  cursor: pointer;
}

.add-block-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
}

.block-builder-labels {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr 38px;
  gap: 8px;
  margin-bottom: 6px;
}

.block-builder-labels span {
  font-size: 0.68rem;
  color: var(--dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 520px) {
  .builder-ex-card {
    padding: 14px;
    border-radius: 16px;
  }

  .block-builder-row {
    grid-template-columns: 0.72fr 1fr 1fr 34px;
    gap: 6px;
  }

  .block-builder-labels {
    grid-template-columns: 0.72fr 1fr 1fr 34px;
    gap: 6px;
  }

  .block-builder-row .builder-input {
    min-height: 42px;
    padding: 9px 9px;
    font-size: 0.9rem;
  }

  .block-remove-btn {
    width: 34px;
    height: 42px;
  }
}