/* Import sistema colori */
@import './color-variables.css';

/* Font Setup - Conthrax SB per titoli */
@font-face {
  font-family: 'Conthrax SB';
  src: url('./resource/font/conthrax_sb.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Font Setup - Orbitron (usa formati esistenti con fallback multipli) */
@font-face {
  font-family: 'Orbitron';
  src: url('./resource/font/orbitron-light-webfont.woff') format('woff'),
       url('./resource/font/orbitron-light-webfont.ttf') format('truetype'),
       url('./resource/font/Orbitron Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Orbitron';
  src: url('./resource/font/orbitron-medium-webfont.woff') format('woff'),
       url('./resource/font/orbitron-medium-webfont.ttf') format('truetype'),
       url('./resource/font/Orbitron Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Orbitron';
  src: url('./resource/font/orbitron-bold-webfont.woff') format('woff'),
       url('./resource/font/orbitron-bold-webfont.ttf') format('truetype'),
       url('./resource/font/Orbitron Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Orbitron';
  src: url('./resource/font/orbitron-black-webfont.woff') format('woff'),
       url('./resource/font/orbitron-black-webfont.ttf') format('truetype'),
       url('./resource/font/Orbitron Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Fallback: usa Google Fonts Orbitron se i file locali non sono disponibili */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@300;500;700;900&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

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

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  background-image: var(--background-image);
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-base), 
              background-image var(--transition-base),
              color var(--transition-base);
}

/* Typography - Variabili per dimensioni titoli - Responsive con clamp() */
:root {
  --heading-h1-size: clamp(1.5rem, 4vw, 1.75rem);
  --heading-h1-weight: 300;
  --heading-h1-line-height: 1.3;
  
  --heading-h2-size: clamp(1.125rem, 3vw, 1.25rem);
  --heading-h2-weight: 300;
  --heading-h2-line-height: 1.3;
  
  --heading-h3-size: clamp(1rem, 2.5vw, 1.125rem);
  --heading-h3-weight: 300;
  --heading-h3-line-height: 1.3;
  
  --heading-h4-size: clamp(0.9375rem, 2vw, 1rem);
  --heading-h4-weight: 300;
  --heading-h4-line-height: 1.3;
  
  /* Responsive spacing variables */
  --spacing-xs-mobile: 0.5rem;
  --spacing-sm-mobile: 0.75rem;
  --spacing-md-mobile: 1rem;
  --spacing-lg-mobile: 1.25rem;
  --spacing-xl-mobile: 1.5rem;
  --spacing-2xl-mobile: 2rem;
  --spacing-3xl-mobile: 2.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Conthrax SB', 'Orbitron', sans-serif;
  line-height: var(--heading-h1-line-height);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--heading-h1-size);
  font-weight: var(--heading-h1-weight);
  line-height: var(--heading-h1-line-height);
}

h2 {
  font-size: var(--heading-h2-size);
  font-weight: var(--heading-h2-weight);
  line-height: var(--heading-h2-line-height);
}

h3 {
  font-size: var(--heading-h3-size);
  font-weight: var(--heading-h3-weight);
  line-height: var(--heading-h3-line-height);
}

h4 {
  font-size: var(--heading-h4-size);
  font-weight: var(--heading-h4-weight);
  line-height: var(--heading-h4-line-height);
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

/* Layout */
main, .section, .login-container {
  flex: 1 0 auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, var(--spacing-lg));
}

.section {
  padding: clamp(var(--spacing-xl), 5vw, var(--spacing-3xl)) 0;
}

/* Header Navigation - Apple Style */
#header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  width: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  height: 60px;
  background: transparent;
  overflow: visible;
}

#header.scrolled {
  padding: 20px 20px;
  min-height: 64px;
  height: auto;
  overflow: visible;
}

.apple-nav {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
  overflow: visible;
  will-change: transform, border-radius;
  box-shadow: none;
}

/* Dark mode support */
[data-theme="dark"] .apple-nav {
  background: transparent;
  border: none;
}

.apple-nav.scrolled {
  height: 100%;
  max-width: min(1024px, calc(100% - 40px));
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 32px;
  border: none;
  overflow: visible;
  isolation: isolate;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .apple-nav.scrolled {
  background: rgba(0, 0, 0, 0.85);
  border: none;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 44px;
  gap: var(--spacing-lg);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 60px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: none;
  border-radius: 0;
  overflow: visible;
  will-change: transform, border-radius;
}

[data-theme="dark"] .nav-container {
  background: rgba(0, 0, 0, 0.72);
  border: none;
}

.apple-nav.scrolled .nav-container,
#header.scrolled .nav-container {
  padding: 0 28px;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: none;
  height: 48px;
}

[data-theme="dark"] .apple-nav.scrolled .nav-container,
[data-theme="dark"] #header.scrolled .nav-container {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Logo - Stile Apple */
.logo {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.logo:hover {
  opacity: 0.7;
}

.apple-nav.scrolled .logo {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-nav.scrolled .logo img {
  height: 34px;
}

/* Navigation Menu - Stile Apple */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 0;
  align-items: center;
  flex: 1;
  justify-content: center;
  margin: 0;
  padding: 0;
  height: auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-nav.scrolled .nav-menu {
  gap: 0;
}

.nav-menu li {
  display: flex;
  align-items: center;
}

.nav-link {
  color: var(--text-primary);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 10px 18px;
  border-radius: 0;
  position: relative;
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  opacity: 0.88;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
}

.apple-nav.scrolled .nav-link {
  font-size: 13px;
  padding: 8px 14px;
  letter-spacing: -0.01em;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 32px);
  height: 0.5px;
  background: currentColor;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
  transform-origin: center;
}

.apple-nav.scrolled .nav-link::after {
  bottom: 2px;
  width: calc(100% - 20px);
  height: 0.5px;
}

.nav-link:hover {
  color: var(--text-primary);
  opacity: 1;
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

.nav-link.active {
  color: var(--text-primary);
  opacity: 1;
  font-weight: 500;
}

.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

/* Header Actions - Stile Apple */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto; /* Allinea a destra */
}

.apple-nav.scrolled .header-actions {
  gap: 4px;
}

/* Language Selector - Stile Apple */
.header-actions .lang-selector {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  padding: 10px 4px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  background-image: none;
  padding-right: 20px;
  min-width: 54px;
  height: auto;
  opacity: 0.88;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
}

.apple-nav.scrolled .header-actions .lang-selector {
  font-size: 13px;
  padding: 8px 4px;
  padding-right: 18px;
  min-width: 50px;
}

.lang-selector:hover {
  opacity: 1;
}

.lang-selector:focus {
  outline: none;
}

/* Theme Toggle - Stile Apple */
.header-actions .theme-toggle {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  padding: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  position: relative;
  margin: 0;
  opacity: 0.88;
}

.apple-nav.scrolled .header-actions .theme-toggle {
  font-size: 16px;
  padding: 8px;
  width: auto;
  height: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.2s ease;
  opacity: 0.88;
}

.theme-toggle:hover {
  opacity: 1;
}

.theme-toggle svg {
  display: block;
  color: var(--text-primary);
}

.theme-toggle::before {
  display: none;
}

.theme-toggle:hover {
  opacity: 1;
  transform: none;
  background-color: transparent;
  border-color: transparent;
}

.theme-toggle:active {
  transform: none;
}

.theme-toggle:focus {
  outline: none;
}

.theme-icon {
  display: inline-block;
  transition: var(--transition-fast);
  font-size: 1rem;
  line-height: 1;
}

/* Auth Menu / Login Link - Stile Apple */
.header-actions #auth-menu {
  display: flex;
  align-items: center;
}

.header-actions #auth-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

.header-actions #auth-menu a,
.header-actions #auth-menu button.logout-btn,
.header-actions #auth-menu span {
  color: var(--text-primary);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 10px 12px;
  border-radius: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  text-decoration: none;
  opacity: 0.88;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  background: transparent;
  border: none;
  cursor: pointer;
  margin: 0;
}

.header-actions #auth-menu a.user-profile-link {
  margin-right: 0;
}

.header-actions #auth-menu a:hover {
  opacity: 1;
  color: var(--accent-primary);
}

.header-actions #auth-menu button.logout-btn:hover {
  opacity: 1;
}

.header-actions #auth-menu button.logout-btn:hover svg {
  opacity: 1;
}

.apple-nav.scrolled .header-actions #auth-menu a,
.apple-nav.scrolled .header-actions #auth-menu button.logout-btn,
.apple-nav.scrolled .header-actions #auth-menu span {
  font-size: 13px;
  padding: 8px 10px;
}

.header-actions #auth-menu a:hover {
  opacity: 1;
}

/* Mobile Menu Toggle - Stile Apple */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.2s ease;
  width: auto;
  height: auto;
  align-items: center;
  justify-content: center;
  opacity: 0.88;
}

.mobile-menu-toggle:hover {
  opacity: 1;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-lg);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.hero-content h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-2xl);
}

/* Buttons - Touch optimized (min 44x44px on mobile) */
.btn {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
  text-align: center;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: var(--accent-primary);
  color: #FFFFFF !important;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-accent);
}

.btn-primary:active,
.btn-primary:focus {
  color: #FFFFFF !important;
}

.btn-secondary {
  background: var(--accent-secondary);
  color: var(--text-inverse) !important;
}

.btn-secondary:hover {
  background: var(--accent-secondary-hover);
  color: var(--text-inverse) !important;
  transform: translateY(-2px);
}

.btn-secondary:active,
.btn-secondary:focus {
  color: var(--text-inverse) !important;
}

/* Cards - Responsive grid optimized for mobile */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-2xl);
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
}

/* Form Styles */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
  color: var(--text-primary);
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.input-modern {
  width: 100%;
  padding: clamp(0.875rem, 2vw, var(--spacing-md));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: clamp(16px, 4vw, 1rem);
  font-family: inherit;
  transition: var(--transition-base);
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.input-modern:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-modern:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary);
}

textarea.input-modern {
  resize: vertical;
  min-height: clamp(100px, 20vw, 150px);
}

/* Select dropdown optimization for mobile */
select.input-modern,
select {
  width: 100%;
  padding: clamp(0.875rem, 2vw, var(--spacing-md));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: clamp(16px, 4vw, 1rem);
  font-family: inherit;
  transition: var(--transition-base);
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  background-size: 12px;
  padding-right: calc(var(--spacing-xl) + 12px);
}

[data-theme="dark"] select.input-modern,
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

select.input-modern:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Checkbox and Radio optimization for touch */
input[type="checkbox"],
input[type="radio"] {
  min-width: 20px;
  min-height: 20px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  accent-color: var(--accent-primary);
}

/* Mobile: larger touch targets for checkboxes/radio */
@media (max-width: 768px) {
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
    width: 24px;
    height: 24px;
  }
  
  /* Ensure labels with checkboxes/radio have adequate spacing */
  label:has(input[type="checkbox"]),
  label:has(input[type="radio"]) {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    cursor: pointer;
  }
}

/* Iscrizioni Badge */
.iscrizioni-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.iscrizioni-aperte {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.iscrizioni-chiuse {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: var(--spacing-md);
}

/* Footer - Modern & Compact */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-xl) 0 var(--spacing-md) 0;
  margin-top: auto;
  position: relative;
  width: 100%;
  flex-shrink: 0;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--border-color) 20%, 
    var(--border-color) 80%, 
    transparent 100%);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.footer-section p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
}

.footer-section a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  font-size: 0.875rem;
}

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

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: var(--spacing-xs);
}

.footer-section ul li a {
  display: inline-block;
  padding: 2px 0;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
  margin-top: var(--spacing-md);
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 1024px) {
  .nav-menu {
    gap: var(--spacing-sm);
  }
  
  .nav-menu a {
    font-size: 0.875rem;
    padding: var(--spacing-xs);
  }
}

@media (max-width: 1024px) {
  .nav-container {
    padding: 0 24px;
  }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
  }
  
  .hero {
    min-height: 70vh;
    padding: var(--spacing-2xl) var(--spacing-md);
  }
  
  .social-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Mobile Large (480px - 768px) */
@media (max-width: 768px) {
  .apple-nav {
    height: 56px;
  }
  
  .apple-nav.scrolled {
    height: 40px;
  }
  
  .apple-nav.scrolled .nav-container {
    padding: 0 16px;
  }
  
  .nav-container {
    padding: 0 16px;
  }
  
  .logo {
    font-size: 15px;
  }
  
  .mobile-menu-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
  }
  
  .nav-menu {
    display: none;
  }
  
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 20px;
    gap: 0;
    z-index: var(--z-modal);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  
  [data-theme="dark"] .nav-menu.active {
    background: rgba(0, 0, 0, 0.95);
  }
  
  .nav-menu.active li {
    width: 100%;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  }
  
  [data-theme="dark"] .nav-menu.active li {
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-menu.active .nav-link {
    padding: 16px;
    width: 100%;
    display: block;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .header-actions {
    display: none; /* Nascondi su mobile, metti nel menu */
  }
  
  .nav-menu .mobile-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  }
  
  [data-theme="dark"] .nav-menu .mobile-actions {
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-menu .mobile-actions .lang-selector,
  .nav-menu .mobile-actions .theme-toggle {
    width: 100%;
    min-height: 44px;
    height: auto;
  }
  
  .nav-menu .mobile-actions #auth-menu {
    width: 100%;
  }
  
  .nav-menu .mobile-actions #auth-menu a {
    width: 100%;
    padding: var(--spacing-md);
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hero {
    min-height: 60vh;
    padding: var(--spacing-xl) var(--spacing-md);
  }
  
  .hero-content h1 {
    font-size: clamp(1.75rem, 8vw, 2rem);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-content p {
    font-size: clamp(0.9375rem, 3vw, 1rem);
    margin-bottom: var(--spacing-lg);
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .card {
    padding: var(--spacing-md);
  }
  
  .btn {
    padding: var(--spacing-md) var(--spacing-lg);
    width: 100%;
    max-width: 100%;
  }
  
  /* Footer Responsive */
  .footer {
    padding: var(--spacing-lg) 0 var(--spacing-sm) 0;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    text-align: center;
  }
  
  .footer-section h3 {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
  }
  
  .footer-section p,
  .footer-section a {
    font-size: 0.8125rem;
  }
  
  .footer-bottom {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
  }
  
  .footer-bottom p {
    font-size: 0.75rem;
  }
  
  .social-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-sm);
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
}

/* Mobile Small (< 480px) */
@media (max-width: 480px) {
  .apple-nav {
    height: 52px;
  }
  
  .apple-nav.scrolled {
    height: 38px;
  }
  
  .logo {
    font-size: 14px;
  }
  
  .apple-nav.scrolled .logo {
    font-size: 13px;
  }
  
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .hero {
    min-height: 50vh;
    padding: var(--spacing-lg) var(--spacing-sm);
  }
  
  .hero-content h1 {
    font-size: clamp(1.5rem, 7vw, 1.75rem);
  }
  
  .hero-content p {
    font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
  }
  
  .card {
    padding: var(--spacing-sm);
  }
  
  .section {
    padding: var(--spacing-lg) 0;
  }
  
  .social-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
  }
  
  .input-modern {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Touch Optimization - Increased spacing between interactive elements */
@media (max-width: 768px) {
  /* Ensure adequate spacing between clickable elements (minimum 8px) */
  .btn + .btn,
  .card + .card,
  a + a,
  button + button {
    margin-top: var(--spacing-sm);
  }
  
  /* Visual feedback for touch interactions */
  .btn:active,
  .card:active,
  a:active,
  button:active,
  .nav-link:active {
    transform: scale(0.98);
    opacity: 0.9;
    transition: transform 0.1s ease, opacity 0.1s ease;
  }
  
  /* Improved tap highlight - subtle but visible */
  a,
  button,
  .btn,
  .card,
  .nav-link,
  input[type="checkbox"],
  input[type="radio"],
  select {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
  
  /* Ensure links and buttons have adequate spacing */
  .nav-link {
    margin: var(--spacing-xs) 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Card hover effects reduced on mobile (touch devices) */
  .card:hover,
  .social-item:hover {
    transform: none;
  }
  
  /* Buttons full width on mobile for easier tapping */
  .btn:not(.btn-inline):not(.btn-sm) {
    width: 100%;
    max-width: 100%;
  }
  
  /* Increase spacing in card grids for easier tapping */
  .card-grid {
    gap: var(--spacing-md);
  }
  
  /* Ensure all interactive elements meet minimum touch target size */
  .mobile-menu-toggle,
  .theme-toggle,
  .lang-selector,
  .btn,
  button,
  a.btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Social Wall */
.social-wall {
  padding: var(--spacing-3xl) 0;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: var(--spacing-md);
}

.social-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  transition: var(--transition-base);
}

.social-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.social-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Performance Mobile - Optimize animations and images */
@media (max-width: 768px) {
  /* Reduce animations on mobile for better performance */
  .card:hover,
  .social-item:hover {
    transform: none;
  }
  
  /* Optimize image loading */
  img {
    loading: lazy;
    decoding: async;
  }
  
  /* Reduce backdrop-filter usage on mobile for better performance */
  .apple-nav,
  .nav-container {
    backdrop-filter: saturate(150%) blur(15px);
    -webkit-backdrop-filter: saturate(150%) blur(15px);
  }
}

/* Accessibilità - High Contrast & Reduced Motion */
@media (prefers-contrast: high) {
  .navbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-elevated);
    border-bottom-width: 2px;
  }
  
  .lang-selector,
  .theme-toggle,
  .mobile-menu-toggle {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-elevated);
    border-width: 2px;
  }
  
  .nav-menu a {
    font-weight: 600;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .navbar,
  .navbar-content,
  .nav-menu a,
  .lang-selector,
  .theme-toggle {
    transition: none;
  }
  
  .nav-menu a::after {
    transition: none;
  }
  
  .navbar.scrolled {
    transition: none;
  }
  
  .card:hover,
  .social-item:hover,
  .btn:hover {
    transform: none;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

