:root {
  /* Colori */
  --color-primary: #50B498;
  --color-secondary: #A7E6CA;
  --color-accent: #3A4F5B; /* Utilizzato per contrasto nel footer o elementi specifici */
  --color-text-dark: #3A4F5B;
  --color-text-light: #F9FBF8;
  --color-bg: #F9FBF8;
  --color-button: #50B498;
  --color-button-hover: #409D80;

  /* Colori Sezioni */
  --section-bg-1: #F3F7F0;
  --section-bg-2: #EAF0E7;
  --section-bg-3: #F0F5ED;
  --section-bg-4: #E4F4D9;
  --section-bg-5: #EDF7E7;
  --section-bg-6: #E7EFEF;
  --section-bg-7: #F0EAF5;
  --section-bg-8: #F5F5ED;

  /* Tipografia */
  --font-primary: 'Montserrat', sans-serif; /* Moderno e pulito */
  --font-secondary: 'Lora', serif; /* Accogliente e naturale */
  --font-size-base: 18px;
  --line-height-base: 1.7;

  /* Spaziatura */
  --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-2xl: calc(var(--spacing-unit) * 12);  /* 96px */

  /* Effetti Visivi */
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-organic: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Forme organiche */

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.1); /* Per glassmorphism */

  --transition-speed: 0.3s;
  --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-dark);
  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-secondary);
  color: var(--color-accent);
  line-height: 1.2;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

h1 {
  font-size: 3.5em;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--color-primary);
}

h2 {
  font-size: 2.5em;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.8em;
}

h4 {
  font-size: 1.4em;
}

h5 {
  font-size: 1.2em;
}

h6 {
  font-size: 1em;
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-speed) var(--transition-easing);
}

a:hover {
  color: var(--color-button-hover);
  text-decoration: underline;
}

ul, ol {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Utilities for sections with dynamic background */
.section-bg-1 {
  background-color: var(--section-bg-1);
  color: var(--color-text-dark) !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, .section-bg-1 p, .section-bg-1 span, .section-bg-1 div, .section-bg-1 a {
  color: var(--color-text-dark) !important;
}

.section-bg-2 {
  background-color: var(--section-bg-2);
  color: var(--color-text-dark) !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, .section-bg-2 p, .section-bg-2 span, .section-bg-2 div, .section-bg-2 a {
  color: var(--color-text-dark) !important;
}

.section-bg-3 {
  background-color: var(--section-bg-3);
  color: var(--color-text-dark) !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, .section-bg-3 p, .section-bg-3 span, .section-bg-3 div, .section-bg-3 a {
  color: var(--color-text-dark) !important;
}

.section-bg-4 {
  background-color: var(--section-bg-4);
  color: var(--color-text-dark) !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, .section-bg-4 p, .section-bg-4 span, .section-bg-4 div, .section-bg-4 a {
  color: var(--color-text-dark) !important;
}

.section-bg-5 {
  background-color: var(--section-bg-5);
  color: var(--color-text-dark) !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, .section-bg-5 p, .section-bg-5 span, .section-bg-5 div, .section-bg-5 a {
  color: var(--color-text-dark) !important;
}

.section-bg-6 {
  background-color: var(--section-bg-6);
  color: var(--color-text-dark) !important;
}
.section-bg-6 h1, .section-bg-6 h2, .section-bg-6 h3, .section-bg-6 h4, .section-bg-6 h5, .section-bg-6 h6, .section-bg-6 p, .section-bg-6 span, .section-bg-6 div, .section-bg-6 a {
  color: var(--color-text-dark) !important;
}

.section-bg-7 {
  background-color: var(--section-bg-7);
  color: var(--color-text-dark) !important;
}
.section-bg-7 h1, .section-bg-7 h2, .section-bg-7 h3, .section-bg-7 h4, .section-bg-7 h5, .section-bg-7 h6, .section-bg-7 p, .section-bg-7 span, .section-bg-7 div, .section-bg-7 a {
  color: var(--color-text-dark) !important;
}

.section-bg-8 {
  background-color: var(--section-bg-8);
  color: var(--color-text-dark) !important;
}
.section-bg-8 h1, .section-bg-8 h2, .section-bg-8 h3, .section-bg-8 h4, .section-bg-8 h5, .section-bg-8 h6, .section-bg-8 p, .section-bg-8 span, .section-bg-8 div, .section-bg-8 a {
  color: var(--color-text-dark) !important;
}


/* Reusable Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 1em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--border-radius-md); /* Coerente con lo stile accogliente */
  user-select: none;
  transition: all var(--transition-speed) var(--transition-easing);
  box-shadow: var(--shadow-sm);
  will-change: transform, box-shadow;
}

.btn-primary {
  background-color: var(--color-button);
  color: var(--color-text-light);
  border-color: var(--color-button);
}

.btn-primary:hover {
  background-color: var(--color-button-hover);
  border-color: var(--color-button-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Card */
.card {
  background-color: rgba(255, 255, 255, 0.7); /* Base per glassmorphism */
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform var(--transition-speed) var(--transition-easing), box-shadow var(--transition-speed) var(--transition-easing);
  position: relative;
  overflow: hidden; /* Per le forme organiche di overlay */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

/* Glassmorphism overlay for organic shapes */
.card::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at 10% 20%, rgba(var(--color-primary-rgb), 0.1) 0%, transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(var(--color-secondary-rgb), 0.1) 0%, transparent 50%);
  border-radius: var(--border-radius-organic);
  opacity: 0.8;
  z-index: -1;
  transition: transform 0.8s var(--transition-easing);
}

.card:hover::before {
  transform: scale(1.05) rotate(5deg);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--color-accent);
}

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1em;
  line-height: 1.5;
  color: var(--color-text-dark);
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  border-radius: var(--border-radius-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075);
  transition: border-color var(--transition-speed) var(--transition-easing), box-shadow var(--transition-speed) var(--transition-easing);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-primary);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--color-primary-rgb), 0.25);
}

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-xl);
  background-color: var(--color-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-logo {
  font-family: var(--font-secondary);
  font-size: 1.8em;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-left: var(--spacing-lg);
}

.nav-link {
  color: var(--color-text-dark);
  font-weight: 500;
  padding: var(--spacing-xs) 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-speed) var(--transition-easing);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Footer */
.footer {
  background-color: var(--footer_bg_color_hex);
  color: var(--color-text-light);
  padding: var(--spacing-xl) var(--spacing-xl);
  text-align: center;
  font-size: 0.9em;
}

.footer a {
  color: var(--color-secondary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Alpine.js specific styles */
[x-cloak] {
  display: none !important;
}

.fade-enter-active, .fade-leave-active {
  transition: opacity var(--transition-speed) var(--transition-easing);
}
.fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
  opacity: 0;
}

.slide-up-enter-active, .slide-up-leave-active {
  transition: transform var(--transition-speed) var(--transition-easing), opacity var(--transition-speed) var(--transition-easing);
}
.slide-up-enter, .slide-up-leave-to {
  transform: translateY(20px);
  opacity: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5em;
  }
  h2 {
    font-size: 1.8em;
  }
  body {
    font-size: 16px;
  }
  .nav {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-md);
  }
  .nav-menu {
    flex-direction: column;
    width: 100%;
    margin-top: var(--spacing-md);
    display: none; /* Hidden by default for mobile, Alpine.js will control visibility */
  }
  .nav-menu.hidden {
    display: none !important; /* Ensure it's hidden when Alpine.js says so */
  }
  .nav-menu.flex {
    display: flex !important; /* Ensure it's shown when Alpine.js says so */
  }
  .nav-item {
    margin: var(--spacing-xs) 0;
  }
  .nav-link {
    width: 100%;
    padding: var(--spacing-sm) 0;
    text-align: center;
  }
  .card {
    padding: var(--spacing-lg);
  }
}

@media (min-width: 768px) {
  .nav-menu.hidden {
    display: flex !important; /* Always show nav menu on desktop */
  }
}

/* Keyframes for animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Example usage for scroll animations (if used with JS library like AOS) */
.aos-animate[data-aos="fade-up"] {
  animation: slideUp 0.8s var(--transition-easing) forwards;
}
.aos-animate[data-aos="fade-in"] {
  animation: fadeIn 0.8s var(--transition-easing) forwards;
}
.aos-animate[data-aos="zoom-in"] {
  animation: scaleIn 0.8s var(--transition-easing) forwards;
}

/* Custom styles for organic shapes and natural feel */
.shape-divider-bottom {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.shape-divider-bottom svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 100px; /* Adjust as needed */
}

.shape-divider-bottom .shape-fill {
  fill: var(--color-bg); /* Or the next section's background color */
}

/* Example of a custom organic button */
.btn-organic {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--border-radius-organic); /* Organic shape */
  transition: all var(--transition-speed) var(--transition-easing);
  box-shadow: var(--shadow-md);
  will-change: transform, box-shadow;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-organic:hover {
  background-color: var(--color-button-hover);
  transform: scale(1.03) rotate(-1deg);
  box-shadow: var(--shadow-lg);
}

/* Generic container for content centering and padding */
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

section {
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

/* Specific styles for elements to ensure text visibility */
.text-dark {
  color: var(--color-text-dark) !important;
}

.text-light {
  color: var(--color-text-light) !important;
}

.text-primary {
  color: var(--color-primary) !important;
}

.text-secondary {
  color: var(--color-secondary) !important;
}

.text-accent {
  color: var(--color-accent) !important;
}

/* General accessibility focus states */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}


/* 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;
    }
}