:root {
  /* Colori */
  --color-primary: #50B86B; /* Verde fresco */
  --color-secondary: #F0EAD6; /* Beige chiaro, naturale */
  --color-accent: #C06C84; /* Rosa malva, per CTA */
  --color-text: #333333; /* Grigio scuro per il testo */
  --color-heading: #1A4314; /* Verde scuro per i titoli */
  --color-bg: #F7F5F0; /* Sfondo principale */
  --color-footer-bg: #2C3E50; /* Sfondo footer scuro */
  --color-light-text: #ffffff; /* Testo chiaro per sfondi scuri */

  /* Colori Sezioni */
  --section-bg-1: #F7F5F0;
  --section-bg-2: #E8F1F2;
  --section-bg-3: #FFFBE6;
  --section-bg-4: #D9EBE9;
  --section-bg-5: #E1F2E8;

  /* Tipografia */
  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Open Sans', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.65;

  /* Spacing */
  --spacing-unit: 8px;
  --spacing-xs: calc(var(--spacing-unit) * 1);   /* 8px */
  --spacing-sm: calc(var(--spacing-unit) * 2);   /* 16px */
  --spacing-md: calc(var(--spacing-unit) * 3);   /* 24px */
  --spacing-lg: calc(var(--spacing-unit) * 5);   /* 40px */
  --spacing-xl: calc(var(--spacing-unit) * 8);   /* 64px */
  --spacing-xxl: calc(var(--spacing-unit) * 12);  /* 96px */

  /* Visual Effects */
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  --transition-speed: 0.35s;
  --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--color-heading);
  line-height: 1.2;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

h1 {
  font-size: calc(var(--font-size-base) * 2.8); /* ~45px */
  letter-spacing: -0.03em;
}

h2 {
  font-size: calc(var(--font-size-base) * 2.2); /* ~35px */
  letter-spacing: -0.02em;
}

h3 {
  font-size: calc(var(--font-size-base) * 1.75); /* ~28px */
}

h4 {
  font-size: calc(var(--font-size-base) * 1.4); /* ~22px */
}

h5 {
  font-size: calc(var(--font-size-base) * 1.2); /* ~19px */
}

h6 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-base);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-speed) var(--transition-easing);
}

a:hover, a:focus {
  color: var(--color-accent);
  text-decoration: underline;
}

ul, ol {
  margin-left: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Base button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--border-radius-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition-speed) var(--transition-easing);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Primary Button */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-light-text);
}

.btn-primary:hover {
  background-color: color-mix(in srgb, var(--color-accent) 85%, black);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--color-primary);
  color: var(--color-light-text);
}

.btn-secondary:hover {
  background-color: color-mix(in srgb, var(--color-primary) 85%, black);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  box-shadow: none;
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-light-text);
  box-shadow: var(--shadow-sm);
}

/* Card styles with subtle 3D effect */
.card {
  background-color: var(--color-light-text);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-speed) var(--transition-easing), box-shadow var(--transition-speed) var(--transition-easing);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.05) 100%);
  border-radius: var(--border-radius-lg);
  z-index: 0;
  pointer-events: none;
}

/* Input fields and textareas */
.input, .textarea, .select {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid color-mix(in srgb, var(--color-text) 20%, white);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-secondary);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-light-text);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color var(--transition-speed) var(--transition-easing), box-shadow var(--transition-speed) var(--transition-easing);
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.textarea {
  resize: vertical;
  min-height: 120px;
}

/* Header styles (minimalista con effetti hover per la navigazione, logo centrato) */
.header {
  background-color: rgba(255, 255, 255, 0.8); /* Semi-trasparente per glassmorphism */
  backdrop-filter: blur(10px); /* Glassmorphism effect */
  -webkit-backdrop-filter: blur(10px);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--glass-shadow);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-primary);
  font-size: calc(var(--font-size-base) * 1.5);
  font-weight: 700;
  color: var(--color-heading);
  text-decoration: none;
  text-align: center;
  flex-grow: 1; /* Centra il logo */
}

.logo-link {
  display: block;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--spacing-lg);
}

.nav-item a {
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--color-text);
  padding: var(--spacing-xs) var(--spacing-sm);
  position: relative;
  overflow: hidden;
  transition: color var(--transition-speed), transform var(--transition-speed);
}

.nav-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
  transition: left var(--transition-speed) var(--transition-easing);
}

.nav-item a:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.nav-item a:hover::after {
  left: 0;
}

/* Mobile navigation toggle */
.nav-toggle {
  display: none; /* Hidden by default, shown on mobile */
  background: none;
  border: none;
  font-size: calc(var(--font-size-base) * 1.5);
  color: var(--color-heading);
  cursor: pointer;
  padding: var(--spacing-xs);
  z-index: 1001;
}

/* Hide navigation on small screens */
.nav-menu.hidden {
  display: none;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: var(--spacing-md) 0;
    box-shadow: var(--glass-shadow);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-speed) var(--transition-easing), opacity var(--transition-speed) var(--transition-easing);
  }

  .nav-menu[x-show="true"] { /* Alpine.js x-show state */
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-item {
    text-align: center;
    margin-bottom: var(--spacing-sm);
  }

  .nav-item a {
    display: block;
    padding: var(--spacing-sm);
    font-size: calc(var(--font-size-base) * 1.1);
  }

  .logo {
    flex-grow: 0; /* Reset flex-grow for mobile */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .header-container {
    justify-content: flex-end; /* Push toggle to the right */
  }
}

@media (min-width: 768px) {
  .nav-menu.hidden {
    display: flex !important; /* Ensure nav is visible on desktop */
  }
}

/* Footer styles (elegante, con link utili, icone social e copyright, sfondo scuro contrastante) */
.footer {
  background-color: var(--color-footer-bg);
  color: color-mix(in srgb, var(--color-light-text) 80%, black);
  padding: var(--spacing-xl) var(--spacing-md);
  font-size: calc(var(--font-size-base) * 0.9);
  line-height: 1.5;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--spacing-lg);
}

.footer-section {
  flex: 1 1 250px; /* Allow sections to grow but prefer 250px */
  margin-bottom: var(--spacing-md);
}

.footer-section h4 {
  color: var(--color-primary);
  font-size: calc(var(--font-size-base) * 1.1);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-section p {
  margin-bottom: var(--spacing-sm);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--spacing-xs);
}

.footer-links a {
  color: color-mix(in srgb, var(--color-light-text) 70%, black);
  transition: color var(--transition-speed) var(--transition-easing);
}

.footer-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.social-icon {
  color: var(--color-light-text);
  font-size: calc(var(--font-size-base) * 1.5);
  transition: color var(--transition-speed) var(--transition-easing), transform var(--transition-speed) var(--transition-easing);
}

.social-icon:hover {
  color: var(--color-primary);
  transform: translateY(-3px) scale(1.1);
}

.footer-bottom {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: color-mix(in srgb, var(--color-light-text) 60%, black);
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
  }

  .footer-section {
    text-align: center;
  }
}

/* Glassmorphism style for key elements (e.g., modals, special cards) */
.glass-element {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: var(--spacing-lg);
}

/* Section Backgrounds with text color adjustments */
.section-bg-1 {
  background-color: var(--section-bg-1);
  color: var(--color-text) !important;
}
.section-bg-1 h1, .section-bg-1 h2, .section-bg-1 h3, .section-bg-1 h4, .section-bg-1 h5, .section-bg-1 h6 {
  color: var(--color-heading) !important;
}
.section-bg-1 p, .section-bg-1 span, .section-bg-1 div {
  color: var(--color-text) !important;
}

.section-bg-2 {
  background-color: var(--section-bg-2);
  color: var(--color-text) !important;
}
.section-bg-2 h1, .section-bg-2 h2, .section-bg-2 h3, .section-bg-2 h4, .section-bg-2 h5, .section-bg-2 h6 {
  color: var(--color-heading) !important;
}
.section-bg-2 p, .section-bg-2 span, .section-bg-2 div {
  color: var(--color-text) !important;
}

.section-bg-3 {
  background-color: var(--section-bg-3);
  color: var(--color-text) !important;
}
.section-bg-3 h1, .section-bg-3 h2, .section-bg-3 h3, .section-bg-3 h4, .section-bg-3 h5, .section-bg-3 h6 {
  color: var(--color-heading) !important;
}
.section-bg-3 p, .section-bg-3 span, .section-bg-3 div {
  color: var(--color-text) !important;
}

.section-bg-4 {
  background-color: var(--section-bg-4);
  color: var(--color-text) !important;
}
.section-bg-4 h1, .section-bg-4 h2, .section-bg-4 h3, .section-bg-4 h4, .section-bg-4 h5, .section-bg-4 h6 {
  color: var(--color-heading) !important;
}
.section-bg-4 p, .section-bg-4 span, .section-bg-4 div {
  color: var(--color-text) !important;
}

.section-bg-5 {
  background-color: var(--section-bg-5);
  color: var(--color-text) !important;
}
.section-bg-5 h1, .section-bg-5 h2, .section-bg-5 h3, .section-bg-5 h4, .section-bg-5 h5, .section-bg-5 h6 {
  color: var(--color-heading) !important;
}
.section-bg-5 p, .section-bg-5 span, .section-bg-5 div {
  color: var(--color-text) !important;
}

/* Custom utility for Alpine.js transitions */
[x-cloak] { display: none !important; }

.fade-in {
  transition: opacity var(--transition-speed) var(--transition-easing);
}
.fade-in:not(.alpine-active) {
  opacity: 0;
}
.fade-in.alpine-active {
  opacity: 1;
}

.slide-down {
  transition: transform var(--transition-speed) var(--transition-easing), opacity var(--transition-speed) var(--transition-easing);
}
.slide-down:not(.alpine-active) {
  transform: translateY(-20px);
  opacity: 0;
}
.slide-down.alpine-active {
  transform: translateY(0);
  opacity: 1;
}

/* Scrollbar styles for a cleaner look */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-primary) 50%, transparent);
  border-radius: 5px;
  transition: background var(--transition-speed);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Example of a subtle 3D element (e.g., for icons or small decorative items) */
.element-3d {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
  transition: transform 0.5s ease-out;
}

.element-3d:hover {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1.05);
}

/* Modern link hover effect with bottom border */
.link-hover-underline {
  position: relative;
  display: inline-block;
}

.link-hover-underline::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--color-primary);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.link-hover-underline:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Smooth image loading (useful for lazy loading) */
img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: opacity 0.5s ease-in-out;
}

img:not([src]) {
  opacity: 0;
}

/* Placeholder for Alpine.js accordion/toggle content, ensuring smooth height transition */
[x-collapse] {
  transition: height var(--transition-speed) ease-in-out;
  overflow: hidden;
}

[x-collapse]:not(.alpine-active) {
  height: 0 !important;
}

[x-collapse].alpine-active {
  height: auto; /* Alpine.js handles the height calculation internally */
}


/* Cookie Banner Additional Styles for Tailwind */
.cookie-banner-hover-effect:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner-hover-effect:hover {
        transform: none;
    }
}