/* ========================================
   STILE CONDIVISO - ASD Judo Ospitaletto
   Design moderno e responsive
   Palette colori migliorata
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Primary Colors */
  --primary: #0055FF;
  --primary-dark: #0044CC;
  --primary-darker: #003399;
  --primary-light: #3377FF;
  
  /* Secondary Colors */
  --secondary: #08101F;
  --secondary-light: #1A2748;
  --secondary-lighter: #2D3B5A;
  
  /* Accent Colors */
  --accent: #00D4AA;
  --accent-light: #33E0C0;
  
  /* Neutral Colors */
  --white: #FFFFFF;
  --off-white: #F4F6FF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  
  /* Semantic Colors */
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Top safe area for iOS (status bar / notch / dynamic island) */
.statusbar-safe-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: constant(safe-area-inset-top); /* iOS < 11.2 */
  height: env(safe-area-inset-top);
  background: var(--secondary);
  z-index: 1500;
  pointer-events: none;
  display: none;
}


/* Hide by default on browsers that do not support safe-area inset (no visual impact) */
@supports (padding: env(safe-area-inset-top)) {
  .statusbar-safe-area { display: block; }
}

html { background-color: var(--secondary) !important; 
  scroll-behavior: smooth; 
}

body {
  font-family: 'Barlow', sans-serif;
  color: var(--gray-700);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ========================================
   NAVIGATION
   ======================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 16, 31, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 85, 255, 0.2);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* header modal-open styles removed to restore original behavior */

/* Smooth transition for header changes */
header {
  transition: background 240ms ease, color 240ms ease, border-color 240ms ease;
}

.nav-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo-box {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--white);
  letter-spacing: 3px;
}

.nav-brand span { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-400);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--white);
}

.nav-links a.active {
  color: var(--primary);
}

.hamburger {
  display: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile Menu Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh; /* Fallback per browser vecchi */
  height: calc(var(--vh, 1vh) * 100); /* Fallback JS per browser senza dvh */
  height: 100dvh; /* Dynamic viewport height - si adatta alla toolbar di Safari */
  background: var(--secondary);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-overlay.active { right: 0; }

.close-menu {
  position: absolute;
  top: 20px;
  right: 2.5rem;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
}

.mobile-links {
  list-style: none;
  text-align: center;
}

.mobile-links li { margin: 1.5rem 0; }

.mobile-links a {
  color: var(--white);
  text-decoration: none;
  font-family: 'Bebas Neue';
  font-size: 2.5rem;
  letter-spacing: 2px;
  transition: color 0.2s ease;
}

.mobile-links a:hover {
  color: var(--primary);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--secondary);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -10px;
  filter: blur(0px);
  background: linear-gradient(135deg, rgba(8, 16, 31, 0.9) 0%, rgba(0, 85, 255, 0.6) 100%), var(--hero-bg-img, url('immagini/garaJudo.jpg'));
  background-size: cover;
  background-position: center;
}

.hero-content {
  position: relative;
  z-index: 5;
  padding: 0 4rem;
  max-width: 800px;
}

.hero h1 {
  font-family: 'Bebas Neue', 'Arial Narrow', 'Impact', sans-serif;
  font-size: clamp(3.2rem, 7vw, 6.2rem);
  color: var(--white);
  line-height: 0.92;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 400;
}

.hero h1 em {
  color: var(--primary);
  font-style: normal;
  display: block;
  font-family: 'Bebas Neue', 'Arial Narrow', 'Impact', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero p {
  color: var(--gray-300);
  font-size: 1.2rem;
  margin-top: 1.5rem;
  max-width: 500px;
  line-height: 1.6;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-cta {
  text-decoration: none;
  display: inline-block;
  width: auto;
  padding: 1.2rem 3rem;
  margin-top: 2rem;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  border: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: 4px;
}

.btn-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  text-decoration: none;
  display: inline-block;
  width: auto;
  padding: 1.2rem 3rem;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  border: 2px solid var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  cursor: pointer;
  border-radius: 4px;
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-login {
  width: 100%;
  padding: 1.2rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.btn-login:hover {
  background: var(--primary-dark);
}

/* ========================================
   SECTIONS
   ======================================== */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.section-subtitle {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2rem;
  display: block;
  font-size: 0.85rem;
}



/* ========================================
   EVENT MODAL & GALLERY - redesigned
   ======================================== */
.event-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,15,0.7);
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.event-modal {
  width: min(1100px, 98%);
  max-height: 92vh;
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  box-shadow: var(--shadow-xl);
  transform: translateY(0);
}

.event-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  z-index: 20;
}

.event-modal-image {
  width: 100%;
  height: 100%;
  min-height: 350px;
  background: var(--gray-100);
  position: relative;
}

.event-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-modal-body {
  padding: 2rem;
  overflow-y: auto;
}

.event-modal-title { font-size: 1.8rem; margin-bottom: 0.5rem; }
.event-modal-info { margin-bottom: 1rem; }

.event-modal-description { color: var(--gray-700); line-height: 1.7; }

/* Gallery column on the right */
.event-modal-gallery {
  padding: 1rem 1.5rem;
  border-left: 1px dashed rgba(0,0,0,0.03);
  background: linear-gradient(180deg, rgba(250,250,250,1) 0%, rgba(255,255,255,1) 100%);
}

.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.8rem;
  background: var(--gray-100);
}

.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.gallery-thumbs img {
  width: 72px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
  border: 2px solid transparent;
  transition: opacity 0.2s ease, transform 0.15s ease, border-color 0.15s ease;
}

.gallery-thumbs img:hover { opacity: 1; transform: translateY(-3px); }
.gallery-thumbs img.active { opacity: 1; border-color: var(--primary); }

/* Desktop: two-column modal adjustments */
@media (min-width: 1024px) {
  .event-modal { grid-template-columns: 1fr 380px; }
  .event-modal-body { padding: 2.5rem; }
}

/* Mobile: full screen modal and stacked layout */
@media (max-width: 768px) {
  .event-modal {
    width: 100%;
    height: 100vh;
    max-height: none;
    grid-template-columns: 1fr;
    border-radius: 0.6rem;
  }
  .event-modal-image { height: 40vh; min-height: 220px; }
  .event-modal-gallery { border-left: none; padding: 1rem; }
  .event-modal-body { padding: 1rem 1rem 2rem 1rem; }
  .event-modal-close { top: 10px; right: 10px; }
  .gallery-thumbs img { width: 84px; height: 56px; }
}

/* Small touch niceties */
.event-modal, .gallery-main, .event-modal-image { -webkit-tap-highlight-color: transparent; }

/* Ensure gallery images are keyboard focusable */
.gallery-thumbs img { outline: none; }
.gallery-thumbs img:focus { box-shadow: 0 0 0 3px rgba(0,85,255,0.12); border-color: var(--primary); }

/* ========================================
  SPONSOR SECTION
  ======================================== */
.sponsor-label {
  text-align: center;
  font-family: 'Barlow Condensed';
  font-size: 0.7rem;
  letter-spacing: 3px;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.sponsor-section {
  background: var(--white);
  padding: 2rem 0;
  border-bottom: 1px solid var(--gray-200);
  overflow: hidden;
}

.sponsor-track {
  display: flex;
  width: calc(300px * 20);
  animation: scroll 40s linear infinite;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-300px * 10)); }
}

.sponsor-item {
  width: 300px;
  flex-shrink: 0;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 50px;
}

.sponsor-item img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.sponsor-item img.sponsor-img-large,
.sponsor-item img[src*="terra&tavola"] {
  max-height: 100px;
  transform: scale(1.25);
}

.sponsor-item img.sponsor-img-monteverde,
.sponsor-item img[src*="monteverde"] {
  max-height: 90px;
  transform: scale(1.15);
}

.sponsor-item:hover img {
  transform: scale(1.05);
}

.sponsor-item:hover img.sponsor-img-large,
.sponsor-item:hover img[src*="terra&tavola"] {
  transform: scale(1.32);
}

.sponsor-item:hover img.sponsor-img-monteverde,
.sponsor-item:hover img[src*="monteverde"] {
  transform: scale(1.22);
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about-section {
  background: var(--off-white);
  padding: 6rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-image {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-image::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  width: 100%;
  height: 100%;
  border: 3px solid var(--primary);
  border-radius: 10px;
  z-index: 0;
}

.about-image img {
  position: relative;
  z-index: 1;
}

.about-content h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

.about-content p {
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* ========================================
   VALUES SECTION
   ======================================== */
.values-section {
  background: var(--white);
  padding: 6rem 4rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.value-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--white);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid var(--gray-200);
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.value-icon {
  width: 80px;
  height: 80px;
  background: var(--off-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

.value-card:hover .value-icon {
  background: var(--primary);
  color: var(--white);
}

.value-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.value-card p {
  color: var(--gray-500);
  line-height: 1.6;
}

/* ========================================
   STATS SECTION
   ======================================== */
.stats-section {
  background: var(--secondary);
  padding: 5rem 4rem;
  color: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  text-align: center;
}

.stat-item h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-item p {
  color: var(--gray-400);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ========================================
   CTA BANNER
   ======================================== */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 5rem 4rem;
  text-align: center;
  color: var(--white);
}

.cta-banner h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.cta-banner p {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  opacity: 0.95;
  line-height: 1.6;
}

.btn-cta-white {
  background: var(--white);
  color: var(--primary);
}

.btn-cta-white:hover {
  background: var(--off-white);
  color: var(--primary-dark);
}


/* ========================================
   AREA ACCESS / LOGIN SECTION
   ======================================== */
.area-section {
  background: var(--secondary);
  padding: 6rem 4rem;
  color: var(--white);
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel {
  max-width: 600px;
  margin: 2rem auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 3rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 85, 255, 0.3);
  backdrop-filter: blur(10px);
}

.login-desc {
  margin-bottom: 2rem;
  color: var(--gray-300);
  line-height: 1.6;
}

.pass-input {
  width: 100%;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--primary);
  color: var(--white);
  font-family: 'Barlow';
  outline: none;
  text-align: center;
  font-size: 1rem;
  border-radius: 6px;
  transition: border-color 0.2s ease;
}

.pass-input:focus {
  border-color: var(--primary-light);
}

.tech-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  text-align: left;
  margin-bottom: 2rem;
}

.feature-item {
  font-size: 0.9rem;
  color: var(--gray-300);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 85, 255, 0.1);
  border-radius: 6px;
}

.feature-item i {
  color: var(--primary);
}

.error-msg {
  color: var(--error);
  margin-top: 1rem;
  display: none;
  font-size: 0.9rem;
}

/* ========================================
   PAGE HERO
   ======================================== */
.page-hero {
  background: var(--secondary);
  padding: calc(68px + 4rem) 4rem 4rem;
  text-align: center;
}

.page-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
  color: var(--white);
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.page-hero p {
  color: var(--gray-300);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  background: var(--gray-900);
  padding: 4rem 2rem 2rem;
  color: var(--gray-400);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand-section .nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  color: var(--white);
  letter-spacing: 3px;
  margin-bottom: 1rem;
  display: block;
}

.footer-brand-section .nav-brand span {
  color: var(--primary);
}

.footer-brand-section p {
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.footer-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--white);
  letter-spacing: 2px;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-contact p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-contact i {
  color: var(--primary);
  font-size: 0.85rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer-social a {
  width: 40px;
  height: 40px;
  background: var(--secondary-light);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-social a.footer-social-wa:hover {
  background: #25D366;
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.footer-bottom .legal-info {
  margin-top: 0.5rem;
}

#openPrivacy {
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

#openPrivacy:hover {
  color: var(--primary);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .footer-brand-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

#openPrivacy {
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

#openPrivacy:hover {
  color: var(--primary);
}

/* ========================================
   PRIVACY MODAL
   ======================================== */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(8, 16, 31, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background-color: var(--white);
  margin: 4% auto;
  padding: 2.5rem;
  border-radius: 16px;
  width: 92%;
  max-width: 800px;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--gray-100);
}

/* Beautiful custom scrollbar for the modal content */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--gray-50);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
  border: 2px solid var(--gray-50);
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Legal modal tabs styling */
.legal-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 2rem;
  gap: 2.5rem;
}

.legal-tab-btn {
  background: none;
  border: none;
  padding: 0.85rem 0;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-400);
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  outline: none;
}

.legal-tab-btn:hover {
  color: var(--primary);
}

.legal-tab-btn.active {
  color: var(--primary);
}

.legal-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.legal-panel {
  display: none;
}

.legal-panel.active-panel {
  display: block;
}

.boring-text {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--gray-700);
  text-align: left;
}

.boring-text p {
  margin-bottom: 1.25rem;
}

.boring-text h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--secondary);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

.boring-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 1.8rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--gray-100);
}

.boring-text ul {
  list-style-type: none;
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.boring-text li {
  position: relative;
  margin-bottom: 0.65rem;
  color: var(--gray-600);
}

.boring-text li::before {
  content: '•';
  color: var(--primary);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.boring-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.boring-text a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Legal callout boxes */
.legal-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.legal-box p {
  margin-bottom: 0.5rem;
}
.legal-box p:last-child {
  margin-bottom: 0;
}

/* ========================================
   COOKIE BANNER (GDPR COMPLIANT)
   ======================================== */
.cookie-banner {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 860px;
  background: #09111e;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.75rem 2.25rem 1.6rem 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65);
  z-index: 9998;
  display: none;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.cookie-banner-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.cookie-banner-close:hover {
  color: var(--white);
  transform: scale(1.1);
}

.cookie-banner-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cookie-banner-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.cookie-banner-icon {
  color: #60a5fa;
  font-size: 1.15rem;
}

.cookie-banner-header strong {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cookie-banner-text p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  padding-right: 1.5rem;
}

.cookie-banner-text a {
  color: #60a5fa;
  text-decoration: underline;
}
.cookie-banner-text a:hover {
  color: var(--white);
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-cookie {
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: 'Barlow', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-cookie-accept {
  background: var(--primary);
  color: var(--white);
}
.btn-cookie-accept:hover {
  background: #0044cc;
}

.btn-cookie-reject {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-cookie-reject:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-cookie-settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: none;
  text-decoration: underline;
  padding: 0.65rem 0.75rem;
  font-weight: 600;
}
.btn-cookie-settings:hover {
  color: var(--white);
}

/* Cookie preferences toggle rows */
.cookie-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.cookie-pref-info {
  flex: 1;
  padding-right: 1.5rem;
}
.cookie-pref-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}
.cookie-pref-info p {
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

/* Switch Toggle UI */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(22px);
}
input:disabled + .slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========================================
   MAP CONTENT (STATIC & EMBED)
   ======================================== */
.map-static-link {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background: #f1f5f9;
  cursor: pointer;
}

.map-static-img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}

.map-static-link:hover .map-static-img {
  transform: scale(1.03);
  filter: brightness(0.95);
}

.map-static-badge {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  background: rgba(9, 17, 30, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  z-index: 3;
}

.map-static-link:hover .map-static-badge {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 85, 255, 0.4);
}

/* Contact form privacy consent box */
.privacy-consent-box {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.privacy-consent-box input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  min-height: 16px;
  margin: 3px 0 0 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.privacy-consent-box label {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--gray-600);
  cursor: pointer;
}

.privacy-consent-box label a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}
.privacy-consent-box label a:hover {
  color: var(--primary-dark);
}

@media (max-width: 576px) {
  .privacy-consent-box {
    gap: 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .privacy-consent-box input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    min-height: 14px;
    margin-top: 2px !important;
  }

  .privacy-consent-box label {
    font-size: 0.8rem;
    line-height: 1.35;
  }
}

@media (max-width: 768px) {
  .cookie-banner {
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    width: calc(100% - 1.5rem);
    max-width: 100%;
    padding: 1.25rem 1.25rem 1.15rem 1.25rem;
    border-radius: 14px;
  }
  .cookie-banner-close {
    top: 0.75rem;
    right: 0.85rem;
    font-size: 1.35rem;
  }
  .cookie-banner-content {
    gap: 1rem;
  }
  .cookie-banner-header {
    margin-bottom: 0.4rem;
  }
  .cookie-banner-header strong {
    font-size: 0.95rem;
  }
  .cookie-banner-text p {
    font-size: 0.82rem;
    line-height: 1.5;
    padding-right: 0.75rem;
  }
  .cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }
  .btn-cookie {
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
  }
  .btn-cookie-accept {
    flex: 1 1 auto;
  }
  .btn-cookie-reject {
    flex: 1 1 auto;
  }
  .btn-cookie-settings {
    flex: 1 1 100%;
    text-align: center;
    padding: 0.25rem;
    font-size: 0.8rem;
  }
}

.close-button {
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
}

.close-button:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: rotate(90deg);
}

/* ========================================
   FAQ SECTION
   ======================================== */
.faq-item {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.2s ease;
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.faq-item h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.faq-item p {
  color: var(--gray-500);
  line-height: 1.6;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  nav { padding: 0 1.5rem; }

  .hero-content,
  .corsi-section,
  .dove-info,
  .area-section,
  .contact-section,
  .page-hero,
  .values-section,
  .about-section,
  .stats-section,
  .cta-banner {
    padding: 4rem 1.5rem;
  }

  .dove-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .tech-features {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 100vh;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Mobile: Image below content */
  .about-image {
    order: 2;
    margin-top: 1.5rem;
  }

  .about-content {
    order: 1;
  }

  .about-image::before {
    display: none;
  }

  .about-content h2 {
    font-size: 2.5rem;
  }

  /* Mobile: Button spacing */
  .about-content div[style*="margin-top:2rem"] {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .about-content .btn-cta,
  .about-content .btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    margin-right: 0 !important;
    margin-bottom: 0;
  }

  .map-box iframe {
    min-height: 300px;
  }

  .stat-item h3 {
    font-size: 3rem;
  }

  .cta-banner h2,
  .stats-section h2 {
    font-size: 2rem;
  }

  /* Mobile: transform table into cards */
  .orari-table {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
  }

  .orari-table thead {
    display: none !important;
  }

  .orari-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .orari-table tr {
    display: flex;
    flex-direction: column;
    background: var(--white) !important;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  .orari-table td {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem !important;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700) !important;
    font-size: 1.15rem !important;
    line-height: 1.6;
  }

  .orari-table td:last-child {
    border-bottom: none;
  }

  .orari-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    min-width: 90px;
  }

  .orari-table tr:hover td {
    background: var(--white) !important;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 3rem;
  }
  
  .nav-brand {
    font-size: 1.1rem;
  }
  
  .btn-cta {
    padding: 1rem 2rem;
    font-size: 0.9rem;
  }
}

/* ========================================
   OPTIMIZATION & RESPONSIVE REFINEMENTS
   ======================================== */

/* Instagram real brand gradient color on hover */
.footer-social a[href*="instagram.com"]:hover,
.social-links a[href*="instagram.com"]:hover,
.social-icon[href*="instagram.com"]:hover,
.social-icon.ig:hover,
a.ig:hover {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeB 90%) !important;
  color: var(--white) !important;
  border-color: transparent !important;
  transform: translateY(-5px) scale(1.05) !important;
  box-shadow: 0 6px 20px rgba(214, 36, 159, 0.45) !important;
}

/* Mobile-specific hero safe spacing to prevent overlay under the fixed header */
@media (max-width: 768px) {
  .page-hero {
    padding: calc(68px + 2.5rem) 1.5rem 2.5rem !important;
  }
}

/* Safari mobile touch and scroll optimizations */
a, button, .event-card, .gallery-thumbs img, .social-icon {
  -webkit-tap-highlight-color: transparent;
}

.event-modal-body, .nav-overlay {
  -webkit-overflow-scrolling: touch;
}

/* Global focus zoom prevention on iOS devices */
@media screen and (max-width: 768px) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* Global scroll containment for active modals */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100% !important;
  width: 100% !important;
  position: fixed !important;
}
