/* =========================================================
   Professional polish layer - Prof. Antonio Adinolfi website
   Obiettivo: migliorare comunicazione e UI senza modificare la logica JS.
   ========================================================= */

:root {
  --school-blue: #0b3b75;
  --school-blue-2: #1359a6;
  --school-ink: #0f172a;
  --school-muted: #64748b;
  --school-line: rgba(148, 163, 184, .28);
  --school-panel: rgba(255, 255, 255, .92);
  --school-glow: 0 24px 70px rgba(15, 23, 42, .14);
}

html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.site-header.hero-header-clean {
  position: sticky;
  top: 0;
  z-index: 150;
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, .08);
}

.clean-topbar {
  min-height: 72px;
  padding-inline: clamp(18px, 5vw, 76px) !important;
}

.brand-logo {
  max-width: min(210px, 52vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .10));
}

.hero-clean {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.hero-clean::before,
.hero-clean::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  z-index: -1;
  pointer-events: none;
}

.hero-clean::before {
  width: 460px;
  height: 460px;
  right: -120px;
  top: -180px;
  background: radial-gradient(circle, rgba(59, 130, 246, .24), transparent 65%);
}

.hero-clean::after {
  width: 360px;
  height: 360px;
  left: -130px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(34, 197, 94, .14), transparent 65%);
}

.hero-clean-inner {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  gap: clamp(28px, 6vw, 70px) !important;
}

.hero-eyebrow,
.hero-microcopy span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow {
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 13px;
  border: 1px solid rgba(11, 59, 117, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  color: var(--school-blue);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hero-clean-copy h1 {
  font-size: clamp(2rem, 4.2vw, 3.7rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -.04em !important;
  margin-bottom: 16px !important;
}

.hero-clean-copy p {
  max-width: 690px;
  font-size: clamp(1.06rem, 1.65vw, 1.38rem) !important;
  line-height: 1.55 !important;
  opacity: .94;
}

.hero-microcopy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-microcopy span {
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(11, 59, 117, .14);
  color: #123e70;
  font-size: .86rem;
  font-weight: 750;
}

.hero-clean-photo-wrap {
  position: relative;
}

.hero-clean-photo-wrap::before {
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(11, 59, 117, .26), rgba(56, 189, 248, .18));
  z-index: -1;
}

.hero-clean-photo {
  border-radius: 28px !important;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .22) !important;
}

.tabs-nav {
  top: 72px !important;
  padding: 10px clamp(14px, 5vw, 76px) !important;
  background: rgba(248, 250, 252, .86) !important;
  border-bottom: 1px solid rgba(148, 163, 184, .28) !important;
  backdrop-filter: blur(16px);
}

.tab-btn {
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 12px 18px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: .94rem !important;
  box-shadow: none !important;
}

.tab-btn.active {
  background: #ffffff !important;
  border-color: rgba(11, 59, 117, .20) !important;
  color: var(--school-blue) !important;
  box-shadow: 0 10px 28px rgba(11, 59, 117, .10) !important;
}

main.container {
  margin-top: 34px !important;
}

.profile-dashboard {
  gap: 22px !important;
}

.profile-feature-card,
.mini-info-card,
.info-card,
.glossario-native,
.login-wall-modern,
.weekly-detail,
.weekly-grid-wrap,
.didattica-subnav,
.didattica-content {
  box-shadow: var(--school-glow) !important;
}

.profile-feature-card,
.mini-info-card {
  border-radius: 26px !important;
}

.profile-feature-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88)),
    radial-gradient(circle at top right, rgba(59,130,246,.14), transparent 28%) !important;
}

.profile-feature-card h2 {
  font-size: clamp(1.8rem, 3vw, 3rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -.035em;
}

.profile-feature-card p,
.mini-info-card p {
  font-size: 1rem !important;
  line-height: 1.72 !important;
}

.feature-actions {
  gap: 12px !important;
  flex-wrap: wrap;
}

.hero-btn,
.btn-stem,
.weekly-nav-btn,
.site-theme-toggle {
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease !important;
}

.hero-btn:hover,
.btn-stem:hover,
.weekly-nav-btn:hover,
.site-theme-toggle:hover {
  transform: translateY(-2px) !important;
}

.hero-btn.primary {
  background: linear-gradient(135deg, var(--school-blue), var(--school-blue-2)) !important;
  box-shadow: 0 16px 34px rgba(11, 59, 117, .22) !important;
}

.section-intro {
  margin-bottom: 22px;
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.14), transparent 25%),
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.86));
  border: 1px solid rgba(148, 163, 184, .24);
  box-shadow: var(--school-glow);
}

.section-intro h2 {
  margin: 8px 0 8px;
  color: var(--school-ink);
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.section-intro p {
  margin: 0;
  color: #475569;
  max-width: 760px;
  line-height: 1.7;
}

.info-grid {
  gap: 20px !important;
}

.info-card {
  border-radius: 26px !important;
}

.info-card h3 {
  align-items: center;
}

.info-card a,
.news-item {
  text-underline-offset: 4px;
}

.glossario-hero h2,
.section-title {
  letter-spacing: -.025em;
}

.glossario-search {
  min-height: 52px;
  border-radius: 18px !important;
}

.glossario-alpha button {
  min-width: 38px;
  min-height: 38px;
  border-radius: 12px !important;
}

.didattica-layout {
  align-items: start;
}

.didattica-subnav {
  position: sticky;
  top: 150px;
}

.didattica-subnav a,
.submenu-toggle,
.submenu-list a {
  min-height: 46px;
}

.weekly-grid-wrap {
  border-radius: 24px !important;
}

.weekly-detail {
  border-radius: 22px !important;
}

.login-mini-badges span {
  border: 1px solid rgba(11, 59, 117, .12);
}

footer {
  margin-top: auto;
}

body.dark-theme .hero-eyebrow,
body.dark-theme .hero-microcopy span {
  background: rgba(15, 23, 42, .70);
  border-color: rgba(147, 197, 253, .22);
  color: #bfdbfe;
}

body.dark-theme .tabs-nav {
  background: rgba(2, 6, 23, .86) !important;
  border-bottom-color: rgba(51, 65, 85, .85) !important;
}

body.dark-theme .section-intro {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.16), transparent 25%),
    linear-gradient(180deg, rgba(15,23,42,.94), rgba(15,23,42,.86));
  border-color: rgba(51, 65, 85, .85);
}

body.dark-theme .section-intro h2 { color: #f8fafc; }
body.dark-theme .section-intro p { color: #cbd5e1; }

body.dark-theme .profile-feature-card {
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.16), transparent 28%),
    linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.88)) !important;
}

@media (max-width: 900px) {
  .hero-clean {
    min-height: auto;
    padding-block: 34px;
  }

  .hero-clean-inner {
    width: min(100% - 28px, 760px);
  }

  .tabs-nav {
    top: 66px !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    scrollbar-width: thin;
  }

  .tab-btn {
    flex: 0 0 auto;
  }

  .didattica-subnav {
    position: static;
  }
}

@media (max-width: 640px) {
  .clean-topbar {
    min-height: 66px;
  }

  .hero-clean-copy h1 {
    font-size: 2.7rem !important;
  }

  .hero-microcopy span {
    width: 100%;
    justify-content: center;
  }

  .section-intro,
  .profile-feature-card,
  .mini-info-card,
  .info-card {
    border-radius: 20px !important;
    padding: 22px !important;
  }
}

/* FIX contrasto sezione Glossario in tema scuro */
body.dark-theme .glossario-hero h2 {
  color: #f8fafc !important;
}

body.dark-theme .glossario-hero p {
  color: #dbeafe !important;
}

body.dark-theme .glossario-hero .kicker {
  background: rgba(59, 130, 246, 0.18) !important;
  border: 1px solid rgba(96, 165, 250, 0.35) !important;
  color: #93c5fd !important;
}

body.dark-theme .glossario-hero .kicker i {
  color: #93c5fd !important;
}
body.light-theme .glossario-hero h2 {
  color: #0f172a !important;
}

body.light-theme .glossario-hero p {
  color: #475569 !important;
}

/* FIX badge hero tagliato in alto */
.hero-clean {
  padding-top: clamp(34px, 4vw, 54px) !important;
}

.hero-clean-inner {
  align-items: center !important;
}

.hero-eyebrow {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
  transform: none !important;
  position: relative !important;
  top: 0 !important;
}

@media (max-width: 700px) {
  .hero-clean {
    padding-top: 28px !important;
  }
}

.hero-eyebrow,
.hero-microcopy {
  display: none !important;
}

/* =========================================================
   HERO V3 - variante elegante, creativa e pulita
   Incollare alla FINE di site-polish.css
   ========================================================= */

.hero-clean.hero-v3 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 520px;
  padding: clamp(58px, 7vw, 96px) 0 !important;
  background:
    linear-gradient(115deg, rgba(2, 6, 23, 0.98) 0%, rgba(8, 21, 45, 0.98) 42%, rgba(14, 62, 122, 0.96) 100%) !important;
}

.hero-clean.hero-v3::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 52% 48%, black 0%, transparent 74%);
  opacity: 0.42;
}

.hero-clean.hero-v3::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 20%, rgba(34, 211, 238, 0.18), transparent 26%),
    radial-gradient(circle at 82% 24%, rgba(59, 130, 246, 0.24), transparent 30%),
    radial-gradient(circle at 62% 88%, rgba(16, 185, 129, 0.10), transparent 32%);
}

.hero-v3-orb {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.hero-v3-orb-a {
  width: 320px;
  height: 320px;
  left: -120px;
  top: 40px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 68%);
}

.hero-v3-orb-b {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.22), transparent 70%);
}

.hero-v3-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(38px, 6vw, 88px);
  align-items: center;
}

.hero-v3-copy {
  max-width: 610px;
}

.hero-v3-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 15px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(191, 219, 254, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.hero-v3-kicker i {
  color: #60a5fa;
}

.hero-v3-copy h1 {
  margin: 0 0 18px !important;
  color: #ffffff !important;
  font-size: clamp(2.65rem, 5.2vw, 5.1rem) !important;
  line-height: 0.93 !important;
  letter-spacing: -0.064em !important;
  text-wrap: balance;
}

.hero-v3-lead {
  margin: 0 !important;
  max-width: 600px;
  color: rgba(226, 232, 240, 0.90) !important;
  font-size: clamp(1.1rem, 1.7vw, 1.42rem) !important;
  line-height: 1.62 !important;
}

.hero-v3-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero-v3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.hero-v3-btn:hover {
  transform: translateY(-2px);
}

.hero-v3-btn-primary {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
}

.hero-v3-btn-secondary {
  color: #eaf2ff !important;
  background: rgba(255,255,255,0.075) !important;
  border: 1px solid rgba(191, 219, 254, 0.20);
}

.hero-v3-btn-secondary:hover {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(191, 219, 254, 0.36);
}

.hero-v3-visual {
  display: flex;
  justify-content: center;
}

.hero-v3-photo-card {
  position: relative;
  width: min(100%, 600px);
  min-height: 390px;
  padding: 16px;
  border-radius: 38px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.045));
  border: 1px solid rgba(191, 219, 254, 0.20);
  box-shadow:
    0 34px 90px rgba(2, 6, 23, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
}

.hero-v3-photo-card::before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 30px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  pointer-events: none;
  z-index: 2;
}

.hero-v3-photo-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 56px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 66%);
  z-index: 0;
  pointer-events: none;
}

.hero-v3-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 390px;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 30px;
  box-shadow: none !important;
}

.hero-v3-glass-card {
  position: absolute;
  left: -28px;
  bottom: 34px;
  z-index: 4;
  width: min(330px, 74%);
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(5, 15, 32, 0.74);
  border: 1px solid rgba(191, 219, 254, 0.22);
  box-shadow: 0 20px 42px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(16px);
}

.hero-v3-glass-label {
  margin-bottom: 7px;
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.hero-v3-glass-card strong {
  display: block;
  color: #ffffff;
  font-size: 1.04rem;
  line-height: 1.32;
}

/* Tema chiaro */
body.light-theme .hero-clean.hero-v3 {
  background:
    radial-gradient(circle at 18% 20%, rgba(14, 165, 233, 0.11), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(59, 130, 246, 0.16), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eaf3ff 48%, #dbeafe 100%) !important;
}

body.light-theme .hero-v3-kicker {
  color: #0b3b75;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(11, 59, 117, 0.13);
}

body.light-theme .hero-v3-copy h1 {
  color: #0f172a !important;
}

body.light-theme .hero-v3-lead {
  color: #334155 !important;
}

body.light-theme .hero-v3-btn-secondary {
  color: #0b3b75 !important;
  background: rgba(255,255,255,0.82) !important;
  border-color: rgba(11, 59, 117, 0.13);
}

body.light-theme .hero-v3-photo-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.88), rgba(255,255,255,0.58));
  border-color: rgba(11, 59, 117, 0.13);
  box-shadow:
    0 34px 80px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.72);
}

body.light-theme .hero-v3-glass-card {
  background: rgba(255,255,255,0.90);
  border-color: rgba(11, 59, 117, 0.14);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

body.light-theme .hero-v3-glass-label {
  color: #1d4ed8;
}

body.light-theme .hero-v3-glass-card strong {
  color: #0f172a;
}

/* Responsive */
@media (max-width: 1050px) {
  .hero-v3-inner {
    grid-template-columns: 1fr;
  }

  .hero-v3-copy {
    max-width: 100%;
  }

  .hero-v3-visual {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .hero-clean.hero-v3 {
    min-height: auto;
    padding: 48px 0 56px !important;
  }

  .hero-v3-inner {
    width: min(100% - 28px, 760px);
  }

  .hero-v3-copy h1 {
    font-size: clamp(2.25rem, 10vw, 3.45rem) !important;
    line-height: 0.98 !important;
  }

  .hero-v3-actions {
    flex-direction: column;
  }

  .hero-v3-btn {
    width: 100%;
  }

  .hero-v3-photo-card {
    min-height: auto;
    padding: 12px;
    border-radius: 28px;
  }

  .hero-v3-photo {
    height: 300px;
    border-radius: 22px;
  }

  .hero-v3-glass-card {
    position: static;
    width: 100%;
    margin-top: 14px;
  }
}

/* =========================================================
   HERO V4 - compatta, istituzionale, non invasiva
   ========================================================= */

.hero-clean.hero-v4 {
  min-height: auto !important;
  padding: 34px 0 !important;
  overflow: hidden;
  background:
    linear-gradient(135deg, #020617 0%, #0b1f3f 52%, #0b3b75 100%) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.hero-v4-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: center;
}

.hero-v4-copy {
  min-width: 0;
}

.hero-v4-label {
  margin-bottom: 8px;
  color: #bfdbfe;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-v4-copy h1 {
  margin: 0 0 10px !important;
  color: #ffffff !important;
  font-size: clamp(2rem, 3.7vw, 3.35rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.04em !important;
}

.hero-v4-copy p {
  margin: 0 !important;
  max-width: 720px;
  color: #dbeafe !important;
  font-size: clamp(1rem, 1.25vw, 1.15rem) !important;
  line-height: 1.55 !important;
}

.hero-v4-photo-wrap {
  justify-self: end;
  width: 280px;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(191, 219, 254, 0.22);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.hero-v4-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: rgba(2, 6, 23, 0.35);
}

body.light-theme .hero-clean.hero-v4 {
  background:
    linear-gradient(135deg, #eff6ff 0%, #eaf3ff 52%, #dbeafe 100%) !important;
  border-bottom: 1px solid rgba(11, 59, 117, 0.12);
}

body.light-theme .hero-v4-label {
  color: #0b3b75;
}

body.light-theme .hero-v4-copy h1 {
  color: #0f172a !important;
}

body.light-theme .hero-v4-copy p {
  color: #334155 !important;
}

body.light-theme .hero-v4-photo-wrap {
  border-color: rgba(11, 59, 117, 0.14);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

@media (max-width: 760px) {
  .hero-clean.hero-v4 {
    padding: 28px 0 !important;
  }

  .hero-v4-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-v4-photo-wrap {
    justify-self: start;
    width: min(100%, 320px);
    height: 160px;
  }

  .hero-v4-copy h1 {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
  }
}
