/* ==========================================================================
   STUDIO MALAGOLI - PREMIUM ORGANIC LIGHT MODE DESIGN SYSTEM & STYLESHEET
   Inspired by Flinta Framer Design: Generous Spacing, Clean Centering, Fluid Scale
   ========================================================================== */

/* Tipografie servite dal sito stesso (font variabili: un file copre tutti i pesi) */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('assets/fonts/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('assets/fonts/cinzel-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('assets/fonts/urbanist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Urbanist';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('assets/fonts/urbanist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Colors - Modern Organic Light Theme */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F3FAF5; /* Soft Mint Gray for cards and sections */
  --bg-accent-green: #E5FFE9; /* Soft Light Green for Hero & Logos */
  --brand-emerald: #007528; /* Forest Green Accent */
  --action-mint: #007528;
  --action-mint-hover: #005d1f;
  --text-primary: #111827; /* Dark Charcoal */
  --text-secondary: #4B5563; /* Medium Gray */
  --text-light: #9CA3AF;
  --border-color: #E5E7EB;
  --border-hover: #D1D5DB;
  
  /* Fonts */
  --font-sans: 'Urbanist', system-ui, -apple-system, sans-serif;
  --font-heading: 'Cinzel', Georgia, serif;
  
  /* Spacing Scale (Airy and proportional, Flinta-like) */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2.5rem;    /* 40px */
  --space-xl: 4rem;      /* 64px */
  --space-2xl: 6.5rem;   /* 104px */
  --space-3xl: 9rem;     /* 144px */
  
  /* Fluid Spacing & Padding */
  --section-padding: clamp(4.5rem, 8vw, 7.5rem);
  --container-padding: clamp(1.5rem, 5vw, 3.5rem);
  
  /* Layout Options */
  --max-width: 1200px;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-xl: 32px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-subtle: 0 4px 30px rgba(0, 0, 0, 0.02);
  --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.03);
  --shadow-modal: 0 30px 60px rgba(17, 24, 39, 0.08);

  /* Linguaggio visivo Framer (approvato da Pierino) — colori misurati sulle schermate */
  --forest-950: #051A0E;
  --forest-900: #072414;
  --forest-800: #0C3019;
  --forest-700: #07471D;
  --forest-card: #102B1B;
  --mint-accent: #8EF0A8;        /* seconda riga del titolo, eyebrow su scuro */
  --mint-soft: #DCF5E3;
  --grad-forest: radial-gradient(120% 140% at 100% 0%, #0B4A20 0%, #0A3519 38%, #072414 72%, #051A0E 100%);
  --radius-block: 32px;
  --header-h: 64px;
  --header-top: 12px;
  --header-offset: calc(var(--header-h) + var(--header-top) + 16px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Filtro verde sulle foto (Blocco 4): 0 = naturale, 1 = massimo. Scelto da David: 70 % */
  --photo-tint: 0.7;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ciò che è nascosto resta nascosto, anche se una classe imposta display:flex/grid */
[hidden] {
  display: none !important;
}

html {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  /* Le ancore si fermano sotto l'header flottante (un solo valore per tutto il sito) */
  scroll-padding-top: var(--header-offset);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  overflow-x: clip;
  background-color: var(--bg-primary);
}

/* Foco visibile da tastiera in tutto il sito */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-emerald);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Sui blocchi scuri l'anello di focus diventa menta, altrimenti non si vedrebbe */
[data-header-dark] :focus-visible {
  outline-color: var(--mint-accent);
}

::selection {
  background-color: rgba(0, 117, 40, 0.18);
  color: var(--text-primary);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3rem, 6.5vw, 5.25rem);
  font-weight: 850;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

p {
  font-size: clamp(1.05rem, 1.15vw, 1.25rem);
  margin-bottom: var(--space-md);
  font-weight: 400;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

.section-alt {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.text-center {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 117, 40, 0.06);
  color: var(--brand-emerald);
  padding: 0.5rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  border: 1px solid rgba(0, 117, 40, 0.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 2.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition-property: background-color, color, border-color, box-shadow, transform, opacity;
  transition-duration: 0.4s;
  transition-timing-function: var(--ease-out);
  text-decoration: none;
  width: fit-content;
}

.btn-primary {
  background-color: var(--action-mint);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 117, 40, 0.15);
}

.btn-primary:hover {
  background-color: var(--action-mint-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 117, 40, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-emerald);
  border: 1px solid var(--brand-emerald);
}

.btn-outline:hover {
  background-color: #E5FFE9;
  border-color: #E5FFE9;
  color: #007528;
}

.btn-full {
  width: 100%;
}

/* Pulsante "pillola" con cerchio e freccia (linguaggio Framer) */
.btn-pill {
  gap: 0.85rem;
  min-height: 48px;
  padding: 0.3rem 0.3rem 0.3rem 1.35rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: transform 0.4s var(--ease-out), background-color 0.3s ease;
}

.btn-arrow svg {
  transition: transform 0.4s var(--ease-out);
}

.btn-pill:hover .btn-arrow {
  transform: scale(1.06);
}

.btn-pill:hover .btn-arrow svg {
  transform: translateX(2px);
}

.btn-pill:active {
  transform: scale(0.98);
}

.btn-pill--primary {
  background-color: var(--brand-emerald);
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(0, 117, 40, 0.22);
}

.btn-pill--primary .btn-arrow {
  background-color: rgba(255, 255, 255, 0.16);
}

.btn-pill--primary:hover {
  background-color: var(--action-mint-hover);
  box-shadow: 0 10px 26px rgba(0, 117, 40, 0.28);
}

.btn-pill--ghost-dark {
  background-color: rgba(5, 26, 14, 0.35);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn-pill--ghost-dark .btn-arrow {
  background-color: rgba(255, 255, 255, 0.12);
}

.btn-pill--ghost-dark:hover {
  background-color: rgba(5, 26, 14, 0.55);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-pill--light {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-pill--light .btn-arrow {
  background-color: #E5F6EA;
  color: var(--brand-emerald);
}

.btn-pill--light:hover {
  border-color: #B9DCC4;
}

@media (prefers-reduced-motion: reduce) {
  .btn-pill:hover .btn-arrow,
  .btn-pill:hover .btn-arrow svg,
  .btn-pill:active {
    transform: none;
  }
}

/* ==========================================================================
   HEADER — pillola flottante (vetro chiaro; grigio traslucido sopra i blocchi scuri)
   ========================================================================== */
.header {
  position: fixed;
  top: var(--header-top);
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 clamp(0.75rem, 3vw, 2rem);
  pointer-events: none;
}

main {
  padding-top: var(--header-offset);
}

.has-hero main {
  padding-top: 0;
}

.header-pill {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1180px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 0.5rem 0 0.6rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.07), 0 1px 2px rgba(17, 24, 39, 0.04);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: background-color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
  animation: header-in 0.8s var(--ease-out) 0.05s both;
}

.header.is-over-dark .header-pill {
  background-color: rgba(214, 220, 216, 0.86);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.header.is-scrolled:not(.is-over-dark) .header-pill {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.1), 0 1px 2px rgba(17, 24, 39, 0.05);
}

@keyframes header-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: none; }
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: none;
  min-height: 44px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 999px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-emerald);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  line-height: 1;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
  color: var(--brand-emerald);
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.6vw, 1.6rem);
  flex: 1;
  min-width: 0;
}

.nav-link {
  position: relative;
  padding: 0.6rem 0.3rem;
  color: #1F2937;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  border-radius: 8px;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background-color: var(--brand-emerald);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--brand-emerald);
}

.nav-link[aria-current="true"] {
  color: var(--brand-emerald);
}

.nav-link[aria-current="true"]::after {
  opacity: 1;
  transform: none;
}

.header-cta {
  flex: none;
}

.nav-cta-mobile {
  display: none;
}

/* Pulsante menu (solo schermi stretti) */
.mobile-nav-toggle {
  display: none;
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background-color: var(--brand-emerald);
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.mobile-nav-toggle:hover {
  background-color: var(--action-mint-hover);
}

.mobile-nav-toggle span {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background-color: #FFFFFF;
  transition: transform 0.35s var(--ease-out), top 0.35s var(--ease-out);
}

.mobile-nav-toggle span:first-child {
  top: 19px;
}

.mobile-nav-toggle span:last-child {
  top: 27px;
}

.mobile-nav-toggle[aria-expanded="true"] span:first-child {
  top: 23px;
  transform: rotate(45deg);
}

.mobile-nav-toggle[aria-expanded="true"] span:last-child {
  top: 23px;
  transform: rotate(-45deg);
}

@media (max-width: 1100px) {
  .mobile-nav-toggle {
    display: block;
  }

  .header-cta {
    display: none;
  }

  /* Il menu diventa una scheda sotto la pillola */
  .nav-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem;
    border-radius: 24px;
    background-color: #FFFFFF;
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.25s ease, transform 0.35s var(--ease-out), visibility 0s linear 0.35s;
  }

  .nav-menu {
    max-height: calc(100dvh - var(--header-h) - var(--header-top) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s ease, transform 0.35s var(--ease-out), visibility 0s;
  }

  .nav-link {
    padding: 0.95rem 1rem;
    font-size: 1.05rem;
    border-radius: 14px;
  }

  .nav-link:hover {
    background-color: var(--bg-secondary);
  }

  .nav-link::after {
    left: auto;
    right: 1.1rem;
    top: 50%;
    bottom: auto;
    margin: -2px 0 0;
  }

  .nav-cta-mobile {
    display: inline-flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.4rem;
  }
}

/* Telefono in orizzontale: menu su due colonne per restare tutto visibile */
@media (max-width: 1100px) and (max-height: 520px) {
  .nav-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.5rem;
  }

  .nav-link {
    padding: 0.7rem 1rem;
  }

  .nav-cta-mobile {
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  .hero-badge {
    letter-spacing: 0.1em;
    padding-right: 0.75rem;
  }
}

@media (max-width: 420px) {
  .logo-text {
    font-size: 1rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-pill {
    animation: none;
  }
  .nav-menu,
  .nav-menu.is-open,
  .mobile-nav-toggle span {
    transition: none;
  }
}

/* ==========================================================================
   FILTRO VERDE SULLE FOTO (Blocco 4) — una sola variabile: --photo-tint
   1) la foto perde colore, 2) velo verde salvia in multiply, 3) velo verde in "color"
   Il ritratto di Pierino NON usa questa classe (resta naturale).
   ========================================================================== */
.photo-tint {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.photo-tint img {
  filter: grayscale(var(--photo-tint)) contrast(calc(1 + var(--photo-tint) * 0.05));
}

.photo-tint::before,
.photo-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.photo-tint::before {
  z-index: 1;
  background-color: #7FA98A;
  mix-blend-mode: multiply;
  opacity: calc(var(--photo-tint) * 0.95);
}

.photo-tint::after {
  z-index: 2;
  background-color: #2F6B3E;
  mix-blend-mode: color;
  opacity: calc(var(--photo-tint) * 0.35);
}

/* ==========================================================================
   HERO — scuro a tutta larghezza, angoli inferiori arrotondati, titolo in due colori
   ========================================================================== */
.hero-section {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: min(100svh, 1000px);
  padding: calc(var(--header-offset) + 3rem) 0 clamp(4rem, 10vh, 7rem);
  border-radius: 0 0 var(--radius-block) var(--radius-block);
  overflow: hidden;
  background-color: var(--forest-950);
  color: #FFFFFF;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% center;
  filter: saturate(0.8);
}

/* Velo verde scuro: più denso a sinistra, dove sta il testo */
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 26, 14, 0.94) 0%, rgba(5, 26, 14, 0.78) 34%, rgba(5, 26, 14, 0.32) 68%, rgba(5, 26, 14, 0.18) 100%),
    linear-gradient(0deg, rgba(5, 26, 14, 0.75) 0%, rgba(5, 26, 14, 0) 46%);
}

.hero-content-block {
  position: relative;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
  padding: 0.35rem 1rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--brand-emerald);
  color: #FFFFFF;
}

.hero-headline {
  margin: 0 0 1.5rem;
  font-family: var(--font-heading);
  font-size: clamp(2.35rem, 5.4vw, 4.75rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.hero-accent {
  color: var(--mint-accent);
}

.hero-subtitle {
  max-width: 34em;
  margin: 0 0 2.25rem;
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 1.45vw, 1.4rem);
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Indicatore di scorrimento */
.hero-scroll {
  position: absolute;
  right: max(var(--container-padding), calc((100vw - var(--max-width)) / 2 + var(--container-padding)));
  bottom: clamp(4rem, 10vh, 7rem);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 44px;
  height: 68px;
  padding-top: 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.85);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.hero-scroll:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background-color: rgba(255, 255, 255, 0.06);
}

.hero-scroll svg {
  animation: hero-scroll-bob 2.2s var(--ease-out) infinite;
}

@keyframes hero-scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  55% { transform: translateY(14px); opacity: 0.35; }
}

/* Unico momento animato all'apertura: il contenuto sale con leggero ritardo */
.hero-content-block > * {
  animation: hero-rise 0.9s var(--ease-out) both;
}

.hero-content-block > :nth-child(1) { animation-delay: 0.15s; }
.hero-content-block > :nth-child(2) { animation-delay: 0.25s; }
.hero-content-block > :nth-child(3) { animation-delay: 0.38s; }
.hero-content-block > :nth-child(4) { animation-delay: 0.5s; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Il titolo è il contenuto principale (LCP): sale ma è visibile da subito */
.hero-content-block > .hero-headline {
  animation-name: hero-rise-visible;
}

@keyframes hero-rise-visible {
  from { transform: translateY(14px); }
  to { transform: none; }
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 0;
    padding: calc(var(--header-offset) + 3.5rem) 0 3.5rem;
    border-radius: 0 0 24px 24px;
  }

  .hero-section::before {
    background:
      linear-gradient(180deg, rgba(5, 26, 14, 0.55) 0%, rgba(5, 26, 14, 0.82) 55%, rgba(5, 26, 14, 0.94) 100%);
  }

  .hero-badge {
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-actions .btn-pill {
    width: 100%;
    justify-content: space-between;
  }

  .hero-scroll {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content-block > *,
  .hero-scroll svg {
    animation: none;
  }
}

/* ==========================================================================
   CLIENTI — nomi reali in Cinzel verde, separatori a rombo, scorrimento continuo
   ========================================================================== */
.marquee-section {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  background-color: var(--bg-primary);
}

.marquee {
  position: relative;
  overflow: hidden;
  /* bordi che sfumano */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.marquee-inner {
  display: flex;
  width: max-content;
  animation: marquee-scroll 60s linear infinite;
}

.marquee:hover .marquee-inner,
.marquee.is-paused .marquee-inner {
  animation-play-state: paused;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: clamp(1.75rem, 3vw, 2.75rem);
  margin: 0;
  padding: 0 clamp(0.875rem, 1.5vw, 1.375rem);
  list-style: none;
}

.marquee-item {
  display: flex;
  align-items: center;
  flex: none;
  min-height: 44px;
}

/* Testo reale: verde pieno (≈5:1 su bianco), niente trasparenza */
.marquee-name {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #2D7A47;
  transition: color 0.3s ease;
}

.marquee-item:hover .marquee-name {
  color: var(--brand-emerald);
}

/* Separatore a rombo */
.marquee-sep {
  flex: none;
  width: 6px;
  height: 6px;
  background-color: var(--brand-emerald);
  transform: rotate(45deg);
  opacity: 0.55;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Pausa (richiesta WCAG 2.2.2 per i contenuti in movimento) */
.marquee-toggle {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.marquee-toggle::after {
  content: "";
  position: absolute;
  inset: -6px; /* area di tocco 44 px */
}

.marquee-section:hover .marquee-toggle,
.marquee-toggle:focus-visible,
.marquee-toggle[aria-pressed="true"] {
  opacity: 1;
}

.marquee-toggle:hover {
  color: var(--brand-emerald);
  border-color: #B9DCC4;
}

.marquee-toggle .icon-play,
.marquee-toggle[aria-pressed="true"] .icon-pause {
  display: none;
}

.marquee-toggle[aria-pressed="true"] .icon-play {
  display: block;
}

/* Movimento ridotto: loghi fermi, centrati su più righe */
/* Senza animazioni (es. Windows con "Effetti animazione" disattivati): elenco statico composto.
   Desktop: 2 righe da 5 nomi con i rombi solo tra un nome e l'altro. Sotto i 1024px: griglia a 2 colonne. */
@media (prefers-reduced-motion: reduce) {
  .marquee {
    -webkit-mask-image: none;
            mask-image: none;
  }
  .marquee-inner {
    width: auto;
    animation: none;
    justify-content: center;
  }
  .marquee-track[aria-hidden="true"],
  .marquee-toggle {
    display: none;
  }
  .marquee-track {
    flex-wrap: wrap;
    justify-content: center;
    column-gap: clamp(0.75rem, 1.4vw, 1.5rem);
    row-gap: 0.25rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
  }
  .marquee-name {
    font-size: clamp(0.75rem, 0.92vw, 0.98rem);
    letter-spacing: 0.02em;
  }
  /* Rombo dopo il 5° nome = a capo; l'ultimo rombo non serve */
  .marquee-track > .marquee-sep:nth-child(10) {
    flex-basis: 100%;
    height: 0;
    opacity: 0;
  }
  .marquee-track > .marquee-sep:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 1023px) {
  .marquee-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
    row-gap: 0.25rem;
    max-width: 640px;
  }
  .marquee-track > .marquee-sep {
    display: none;
  }
  .marquee-item {
    justify-content: center;
    text-align: center;
  }
  .marquee-name {
    white-space: normal;
    font-size: 0.8rem;
    line-height: 1.35;
  }
}

@media (max-width: 768px) {
  .marquee-inner {
    animation-duration: 45s;
  }
}

/* Block 3: Sobre el Estudio */
.about-section {
  background-color: var(--bg-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

/* La foto accompagna il testo mentre si scorre (solo desktop) */
.about-media {
  position: sticky;
  top: calc(var(--header-offset) + 1rem);
}

/* Doppia cornice: bordo sottile esterno + foto arrotondata (ritratto naturale, senza filtro) */
.about-frame {
  padding: 8px;
  border-radius: 30px;
  border: 1px solid #D5E8DB;
  background-color: var(--bg-primary);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.08);
}

.about-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 22px;
}

.about-name {
  margin: 0 0 1.5rem;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.about-text-content p {
  margin: 0 0 1.15rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary);
}

.about-text-content .about-lead {
  margin-bottom: 1.75rem;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Frase messa in evidenza (stesso testo dell'originale) */
.about-text-content .about-quote {
  margin: 2rem 0 1.25rem;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 2px solid var(--brand-emerald);
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.about-text-content .about-areas {
  margin-top: 1.5rem;
  font-weight: 500;
  color: var(--brand-emerald);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1;
  color: var(--brand-emerald);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ==========================================================================
   SERVIZI — schede bianche grandi impilate (effetto "mazzo" su desktop)
   ========================================================================== */
.services-section {
  background-color: var(--bg-secondary);
}

.services-head {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.services-heading {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.08;
}

.services-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.services-intro {
  max-width: 30em;
  margin: 0;
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
}

.services-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.service-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch;
  padding: 10px 10px 10px clamp(1.5rem, 3.5vw, 2.75rem);
  border-radius: var(--radius-block);
  background-color: var(--bg-primary);
  box-shadow: 0 28px 70px rgba(17, 24, 39, 0.08), 0 2px 6px rgba(17, 24, 39, 0.04);
}

.service-card-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.service-eyebrow {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Nome del servizio + sottotitolo: se non ci stanno, il sottotitolo va a capo intero */
.service-cat,
.service-sub {
  white-space: nowrap;
}

.service-sub {
  font-weight: 500;
}

/* Se il sottotitolo va a capo, il punto separatore sparisce (lo decide main.js) */
.service-eyebrow.is-wrapped .service-dot {
  display: none;
}

/* Contenuto pieghevole (aperto su desktop e tablet; su mobile lo gestisce main.js) */
.service-collapse {
  display: grid;
  grid-template-rows: 1fr;
}

.service-collapse-inner {
  min-height: 0;
}

.service-media-wrap > .service-collapse-inner {
  display: flex;
}

.service-media-wrap .service-card-media {
  flex: 1;
}

.service-card-title {
  margin: 0 0 1rem;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  line-height: 1.2;
}

.service-card-desc {
  margin: 0;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary);
}

.service-card-media {
  min-height: 380px;
  border-radius: 24px;
  background-color: var(--forest-900);
}

.service-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Elenco dei punti sotto il paragrafo */
.service-features {
  display: grid;
  gap: 0.55rem;
  margin: 1.5rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--border-color);
  list-style: none;
}

.service-features li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.service-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 15px;
  height: 15px;
  background-color: var(--brand-emerald);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Effetto "mazzo di carte": ogni scheda si ferma un po' più in basso della precedente */
@media (min-width: 992px) and (min-height: 760px) {
  .service-card {
    position: sticky;
    top: calc(var(--header-offset) + (var(--i) - 1) * 14px);
  }
}

@media (max-width: 991px) {
  .services-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .service-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px;
  }

  .service-card-text {
    padding: 1.5rem 1rem 1.75rem;
  }

  .service-card-media {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
}

/* Mobile: elenco leggero a fisarmonica (niente schede né effetto impilato) */
@media (max-width: 767px) {
  .services-stack {
    gap: 0;
    border-top: 1px solid #DCE8E0;
  }

  .service-card {
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    border-bottom: 1px solid #DCE8E0;
  }

  .service-card-text {
    padding: 1.35rem 0 0;
  }

  .service-eyebrow {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
  }

  .service-card-title {
    margin: 0;
    font-size: 1.25rem;
  }

  .service-card:not(.is-collapsible) .service-card-title {
    margin-bottom: 1rem;
  }

  .service-toggle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 44px;
    padding: 0.2rem 0 1.15rem;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
  }

  /* "+" piccolo che ruota in "×" */
  .service-plus {
    position: relative;
    flex: none;
    width: 14px;
    height: 14px;
    margin-top: 0.4em;
    transition: transform 0.4s var(--ease-out);
  }

  .service-plus::before,
  .service-plus::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    height: 1.5px;
    margin-top: -0.75px;
    border-radius: 1px;
    background-color: var(--brand-emerald);
  }

  .service-plus::after {
    transform: rotate(90deg);
  }

  .service-card.is-open .service-plus {
    transform: rotate(45deg);
  }

  .service-card.is-collapsible .service-collapse {
    transition: grid-template-rows 0.45s var(--ease-out), opacity 0.35s ease;
  }

  .service-card.is-collapsible:not(.is-open) .service-collapse {
    grid-template-rows: 0fr;
    opacity: 0;
  }

  .service-collapse-inner {
    overflow: hidden;
  }

  .service-card-desc {
    font-size: 0.95rem;
  }

  .service-features {
    margin-top: 1.1rem;
    padding-top: 1rem;
  }

  .service-card-media {
    margin: 0.1rem 0 1.5rem;
    border-radius: 16px;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .service-card.is-collapsible .service-collapse,
  .service-plus {
    transition: none;
  }
}

/* Eyebrow (etichetta sopra i titoli, linguaggio Framer) */
.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-emerald);
}

.eyebrow--on-dark {
  color: var(--mint-accent);
}

/* ==========================================================================
   METODO — blocco verde scuro con righello, 4 schede traslucide
   ========================================================================== */
/* Blocco scuro condiviso (Metodo, Contatti) */
.dark-block {
  position: relative;
  margin: clamp(1rem, 3vw, 2.5rem) 0;
  border-radius: var(--radius-block);
  background: var(--grad-forest);
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.method-section {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 6.5rem);
}

/* Righello: tacche fini ogni 20 px, tacca lunga ogni 180 px (lo strumento di misura del "controllo") */
.method-ruler {
  height: 26px;
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
  background-image:
    linear-gradient(to right, rgba(142, 240, 168, 0.4) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 180px 26px, 20px 12px;
  background-repeat: repeat-x;
  background-position: left top, left 7px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 85%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 85%, transparent 100%);
}

.method-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.method-heading {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.08;
  color: #FFFFFF;
}

.method-intro {
  max-width: 30em;
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.9rem, 1.6vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.method-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.5rem 2rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background-color: rgba(255, 255, 255, 0.035);
  transition: transform 0.5s var(--ease-out), border-color 0.4s ease, background-color 0.4s ease;
}

.method-card:hover {
  transform: translateY(-5px);
  border-color: rgba(142, 240, 168, 0.32);
  background-color: rgba(255, 255, 255, 0.06);
}

.method-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.method-num {
  font-family: var(--font-heading);
  font-size: clamp(3.4rem, 5vw, 4.4rem);
  font-weight: 400;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px rgba(142, 240, 168, 0.75);
  transition: color 0.4s ease;
}

.method-card:hover .method-num {
  color: rgba(142, 240, 168, 0.12);
}

/* Punto + linea che collega le fasi */
.method-line {
  position: relative;
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(142, 240, 168, 0.6), rgba(142, 240, 168, 0));
}

.method-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background-color: var(--mint-accent);
  box-shadow: 0 0 0 4px rgba(142, 240, 168, 0.14);
}

.method-phase {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint-accent);
}

.method-title {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  line-height: 1.25;
  color: #FFFFFF;
}

.method-desc {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

/* Comparsa delle schede quando la sezione entra nello schermo (attivata da main.js) */
.js-reveal .method-card {
  opacity: 0;
  transform: translateY(22px);
}

.js-reveal.is-visible .method-card {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.8s var(--ease-out), border-color 0.4s ease, background-color 0.4s ease;
}

.js-reveal.is-visible .method-card:nth-child(2) { transition-delay: 0.08s; }
.js-reveal.is-visible .method-card:nth-child(3) { transition-delay: 0.16s; }
.js-reveal.is-visible .method-card:nth-child(4) { transition-delay: 0.24s; }

.js-reveal.is-visible .method-card:hover {
  transform: translateY(-5px);
  transition-delay: 0s;
}

@media (max-width: 1100px) {
  .method-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dark-block {
    margin: 1rem 0;
    border-radius: 24px;
  }
  .method-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .method-ruler {
    background-size: 120px 26px, 15px 12px;
  }
}

/* Mobile: griglia 2×2 leggibile anche a 360 px (niente parole spezzate) */
@media (max-width: 560px) {
  .method-grid {
    gap: 0.6rem;
  }

  .method-card {
    padding: 1rem 0.8rem 1.15rem;
    border-radius: 16px;
    hyphens: manual;
    overflow-wrap: normal;
    word-break: normal;
  }

  .method-card-top {
    gap: 0.45rem;
    margin-bottom: 0.9rem;
  }

  .method-num {
    font-size: 2.5rem;
  }

  .method-line::before {
    width: 6px;
    height: 6px;
    margin-top: -3px;
    box-shadow: 0 0 0 3px rgba(142, 240, 168, 0.14);
  }

  .method-phase {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }

  .method-title {
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
    letter-spacing: 0;
  }

  .method-desc {
    font-size: 0.82rem;
    line-height: 1.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .method-card,
  .js-reveal .method-card,
  .js-reveal.is-visible .method-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   FORMAZIONE — testo e foto a sinistra, fisarmonica a destra
   ========================================================================== */
.training-section {
  background-color: var(--bg-primary);
}

.training-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

/* Senza foto: l'introduzione resta accanto alla fisarmonica mentre si scorre */
.training-intro {
  position: sticky;
  top: calc(var(--header-offset) + 1rem);
}

.training-heading {
  margin: 0 0 1.25rem;
  font-size: clamp(2.1rem, 3.8vw, 3.2rem);
  line-height: 1.08;
}

.training-intro-desc {
  max-width: 26em;
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Fisarmonica */
.accordion-container {
  border-top: 1px solid var(--border-color);
}

.accordion-item {
  border-bottom: 1px solid var(--border-color);
}

.accordion-heading {
  margin: 0;
  font-size: inherit;
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  padding: 1.35rem 0.25rem;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
}

.accordion-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: #E3F6E8;
  color: var(--brand-emerald);
}

.accordion-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

/* "+" in cerchio che diventa "−" all'apertura */
.accordion-plus {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #C9D6CE;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.accordion-plus::before,
.accordion-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  margin: -0.75px 0 0 -7px;
  background-color: var(--text-primary);
  transition: transform 0.35s var(--ease-out), background-color 0.3s ease;
}

.accordion-plus::after {
  transform: rotate(90deg);
}

.accordion-header:hover .accordion-plus,
.accordion-item.is-open .accordion-plus {
  border-color: var(--brand-emerald);
}

.accordion-item.is-open .accordion-plus::before,
.accordion-item.is-open .accordion-plus::after {
  background-color: var(--brand-emerald);
}

.accordion-item.is-open .accordion-plus::after {
  transform: rotate(0deg);
}

/* Apertura fluida senza animare l'altezza (grid 0fr → 1fr) */
.accordion-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease-out);
}

.accordion-item.is-open .accordion-collapse {
  grid-template-rows: 1fr;
}

.accordion-body {
  min-height: 0;
  overflow: hidden;
}

.accordion-desc {
  margin: 0;
  padding: 0 3.5rem 1.6rem calc(48px + 1.1rem + 0.25rem);
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-secondary);
}

@media (max-width: 991px) {
  .training-layout-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .training-intro {
    position: static;
  }
}

@media (max-width: 560px) {
  .accordion-tile {
    width: 42px;
    height: 42px;
  }

  .accordion-desc {
    padding: 0 0.25rem 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .accordion-collapse,
  .accordion-plus::before,
  .accordion-plus::after {
    transition: none;
  }
}

/* ==========================================================================
   PUBBLICAZIONI — schede con intestazione menta, illustrazione PDF, livello a barre
   (le classi usate da shop.js restano invariate)
   ========================================================================== */
.shop-section {
  background-color: var(--bg-secondary);
}

.shop-intro-header {
  max-width: 780px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.shop-heading {
  margin: 0 0 1.25rem;
  font-size: clamp(2.1rem, 3.8vw, 3.2rem);
  line-height: 1.08;
}

.shop-intro {
  margin: 0 auto;
  max-width: 40em;
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
}

.publications-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 1.6vw, 1.5rem);
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 26px;
  background-color: var(--bg-primary);
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.07), 0 1px 3px rgba(17, 24, 39, 0.05);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 64px rgba(17, 24, 39, 0.11), 0 1px 3px rgba(17, 24, 39, 0.05);
}

/* Intestazione menta (senza illustrazione): fa da base all'etichetta di livello */
.pricing-visual {
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(160deg, #E6F7EA 0%, #D2EEDA 100%);
}

/* Livello con barre "di segnale" */
.card-badge {
  position: absolute;
  top: 26px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.75rem 0.38rem 0.6rem;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(7, 71, 29, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1F4D2E;
}

.level-bars .on { fill: var(--brand-emerald); }
.level-bars .off { fill: #C9DCCF; }

.pricing-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.4rem 1rem 1rem;
}

.pricing-title {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

.pricing-desc {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
}

.card-pricing-footer {
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-color);
}

.pricing-price-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.price-numeric {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: lining-nums tabular-nums;
}

.price-pages {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.publications-grid .btn-buy-dispensa {
  justify-content: space-between;
  font-size: 0.95rem;
}

.btn-buy-dispensa.is-unavailable {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.card-delivery {
  margin: 0.7rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  text-align: center;
  color: var(--text-secondary);
}

/* Avvertenza sui contenuti: una riga che si apre (details/summary) */
.publications-disclaimer {
  max-width: 72ch;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  text-align: center;
}

.publications-disclaimer summary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4F5D56;
  list-style: none;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.publications-disclaimer summary::-webkit-details-marker {
  display: none;
}

.publications-disclaimer summary:hover {
  color: var(--brand-emerald);
  background-color: rgba(0, 117, 40, 0.06);
}

.disclaimer-chevron {
  transition: transform 0.3s var(--ease-out);
}

.publications-disclaimer[open] .disclaimer-chevron {
  transform: rotate(180deg);
}

.publications-disclaimer p {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #68746E; /* il grigio più chiaro con contrasto 4,5:1 sul fondo menta */
}

.publications-disclaimer[open] p {
  animation: disclaimer-in 0.35s ease both;
}

@keyframes disclaimer-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .disclaimer-chevron { transition: none; }
  .publications-disclaimer[open] p { animation: none; }
}

@media (max-width: 1100px) {
  .publications-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: carosello orizzontale (si vede una scheda intera e un pezzo della successiva) */
@media (max-width: 767px) {
  .publications-grid {
    display: flex;
    gap: 0.9rem;
    margin-inline: calc(var(--container-padding) * -1);
    padding: 0.5rem var(--container-padding) 1.25rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--container-padding);
    scrollbar-width: none;
  }

  .publications-grid::-webkit-scrollbar {
    display: none;
  }

  .publications-grid:focus-visible {
    outline: 2px solid var(--brand-emerald);
    outline-offset: -2px;
    border-radius: 12px;
  }

  .publications-grid .pricing-card {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }

  .publications-grid .pricing-card:hover {
    transform: none;
  }
}

/* Puntini del carosello (creati da main.js, solo su mobile) */
.carousel-dots {
  display: none;
}

@media (max-width: 767px) {
  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 0.25rem;
  }
}

.carousel-dot {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.carousel-dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 999px;
  background-color: #B9CFC0;
  transition: width 0.3s var(--ease-out), margin 0.3s var(--ease-out), background-color 0.3s ease;
}

.carousel-dot[aria-current="true"]::before {
  width: 22px;
  margin-left: -11px;
  background-color: var(--brand-emerald);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--brand-emerald);
  outline-offset: -6px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-dot::before { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-card,
  .pricing-card:hover,
  }

/* ==========================================================================
   CONTATTI — blocco scuro, testi chiari, modulo in scheda bianca con doppia cornice
   ========================================================================== */
.contact-section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.contact-info h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.08;
  color: #FFFFFF;
}

.contact-info > p:not(.eyebrow) {
  max-width: 34em;
  margin-bottom: 2.25rem;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.contact-details-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--mint-accent);
}

.contact-detail-content h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

.contact-detail-content p {
  margin: 0;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.45;
  color: #FFFFFF;
}

.contact-detail-content a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.contact-detail-content a:hover {
  text-decoration: underline;
  color: var(--mint-accent);
}

/* Doppia cornice: bordo traslucido esterno + scheda bianca */
.contact-form-frame {
  padding: 10px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Form Styling — contatti (condiviso con il checkout) */
.contact-form {
  --field-error: #B42318;
  --field-error-bg: #FEF3F2;
  position: relative;
  background-color: var(--bg-primary);
  border-radius: 22px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  color: var(--text-secondary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem var(--space-md);
  margin-bottom: 1.25rem;
}

.form-group-full {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-optional {
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px: evita lo zoom automatico di iOS */
  font-weight: 500;
  line-height: 1.4;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid #7A9284;
  background-color: #F6FBF7;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
  color: #5C6B63;
  font-weight: 400;
}

.form-control:hover {
  border-color: #4F6A5B;
}

.form-control:focus {
  outline: none;
}

.form-control:focus-visible {
  background-color: #FFFFFF;
  border-color: var(--brand-emerald);
  box-shadow: 0 0 0 1px var(--brand-emerald), 0 0 0 4px rgba(0, 117, 40, 0.16);
}

.form-control[aria-invalid="true"] {
  border-color: var(--field-error, #B42318);
  background-color: var(--field-error-bg, #FEF3F2);
}

.form-control[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 1px var(--field-error, #B42318), 0 0 0 4px rgba(180, 35, 24, 0.14);
}

textarea.form-control {
  resize: vertical;
  min-height: 132px;
}

.form-hint {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.field-error {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--field-error, #B42318);
}

.field-error:empty {
  display: none;
}

.field-error::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 0.15em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1zm0 3.5a.9.9 0 0 0-.9.9v3.2a.9.9 0 0 0 1.8 0V5.4a.9.9 0 0 0-.9-.9zm0 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1zm0 3.5a.9.9 0 0 0-.9.9v3.2a.9.9 0 0 0 1.8 0V5.4a.9.9 0 0 0-.9-.9zm0 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Selettore Privato / Azienda */
.segmented {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
  min-width: 0;
}

.segmented legend {
  display: block;
  margin-bottom: 0.6rem;
}

.segmented-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 12px;
  background-color: #DDEFE2;
  isolation: isolate;
}

.segmented-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #35604A;
  cursor: pointer;
  user-select: none;
  transition: color 0.25s ease;
}

.segmented-option:hover {
  color: var(--text-primary);
}

.segmented-input:checked + .segmented-option {
  color: var(--brand-emerald);
}

.segmented-input:focus-visible + .segmented-option {
  outline: 2px solid var(--brand-emerald);
  outline-offset: 2px;
}

.segmented-thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 9px;
  background-color: var(--bg-primary);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 2px 8px rgba(0, 61, 21, 0.08);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.segmented-input:nth-of-type(2):checked ~ .segmented-thumb {
  transform: translateX(100%);
}

/* Campi azienda: apertura morbida senza animare l'altezza */
.company-fields {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.company-fields.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.company-fields-inner {
  min-height: 0;
  overflow: hidden;
}

/* Honeypot */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.contact-form .checkbox-group {
  margin-bottom: 0.35rem;
}

.checkbox-input {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--brand-emerald);
  margin-top: calc(0.75rem + 1px);
  cursor: pointer;
}

.checkbox-input:focus-visible {
  outline: 2px solid var(--brand-emerald);
  outline-offset: 2px;
}

.checkbox-input[aria-invalid="true"] {
  outline: 2px solid var(--field-error, #B42318);
  outline-offset: 2px;
}

.checkbox-label {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  user-select: none;
  cursor: pointer;
}

.checkbox-label a,
.checkbox-help a {
  color: var(--brand-emerald);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkbox-help {
  margin: -0.5rem 0 0.5rem calc(20px + 0.75rem);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.contact-form .checkbox-group + .checkbox-help + .field-error {
  margin: 0 0 0.5rem calc(20px + 0.75rem);
}

.form-alert {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid #FBCFC9;
  background-color: var(--field-error-bg, #FEF3F2);
  color: #7A271A;
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-alert a {
  color: inherit;
  font-weight: 600;
}

/* Pulsante con stato di invio */
.form-submit {
  position: relative;
  margin-top: var(--space-md);
  gap: 0.6rem;
}

.form-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: form-spin 0.7s linear infinite;
}

.form-submit[aria-busy="true"],
.form-submit[aria-busy="true"]:hover {
  cursor: progress;
  opacity: 0.85;
  transform: none;
}

.form-submit[aria-busy="true"] .form-spinner {
  display: inline-block;
}

.btn-pill.form-submit {
  justify-content: center;
  gap: 0.75rem;
  min-height: 48px;
  font-size: 1rem;
}

/* Contatti: pillola compatta (larga quanto il contenuto); su mobile a tutta larghezza, contenuto centrato */
.contact-submit {
  width: auto;
  margin-top: var(--space-md);
  padding-left: 1.6rem;
}

@media (max-width: 767px) {
  .contact-submit {
    width: 100%;
    padding-left: 0.3rem; /* stesso margine ai due lati: testo + icona esattamente al centro */
  }

  .contact-submit .form-submit-label {
    padding-left: 0.5rem;
  }
}

.btn-pill.form-submit .btn-arrow {
  width: 44px;
  height: 44px;
}

.form-submit[aria-busy="true"] .btn-arrow svg {
  display: none;
}

@keyframes form-spin {
  to { transform: rotate(360deg); }
}

/* Stato di successo */
.form-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: var(--space-md) 0;
  outline: none;
  animation: form-success-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-success-icon {
  color: var(--brand-emerald);
}

.form-success-icon path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: form-check-draw 0.5s 0.25s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.form-success-title {
  outline: none;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.form-success p {
  max-width: 46ch;
  color: var(--text-secondary);
  line-height: 1.6;
}

.form-success strong {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brand-emerald);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--action-mint-hover);
}

.btn-text:focus-visible {
  outline: 2px solid var(--brand-emerald);
  outline-offset: 3px;
  border-radius: 2px;
}

@keyframes form-success-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes form-check-draw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .segmented-thumb,
  .company-fields,
  .form-control {
    transition: none;
  }
  .form-success,
  .form-success-icon path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .form-spinner {
    animation-duration: 1.6s;
  }
}

/* ==========================================================================
   FOOTER — colonne con eyebrow verdi e marchio gigante in filigrana
   ========================================================================== */
.footer {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  padding: clamp(3.5rem, 7vw, 6rem) 0 2rem;
  overflow: hidden;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  text-decoration: none;
}

.footer-desc {
  max-width: 300px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
}

.footer-title {
  margin: 0.4rem 0 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-emerald);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links .footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font-size: 0.95rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--brand-emerald);
}

/* Colonna DATI: il paragrafo ha uno stile in linea nell'HTML, qui si uniforma */
.footer-top > div:not(.footer-brand) p {
  margin-bottom: 0;
  font-size: 0.95rem !important;
  line-height: 1.85 !important;
}

/* Desktop e tablet (3 colonne): i link hanno la stessa altezza di riga di DATI e stanno in fondo
   alla colonna, così "Contatti" è allineato con "Cell.: …" */
@media (min-width: 769px) {
  .footer-top > div:has(.footer-links) {
    display: flex;
    flex-direction: column;
  }

  .footer-links {
    margin-top: auto;
  }

  .footer-links .footer-link {
    display: block;
    min-height: 0;
    font-size: 0.95rem;
    line-height: 1.85;
  }
}

/* Marchio in filigrana: grafica SVG decorativa (aria-hidden) che riempie la larghezza del contenitore */
.footer-wordmark {
  display: block;
  width: 100%;
  height: auto;
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  user-select: none;
}

.footer-wordmark text {
  font-family: var(--font-heading);
  font-size: 120px;
  font-weight: 700;
  fill: #E8F2EA;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.footer-copyright {
  font-size: 0.85rem;
  color: #5F6B66; /* 5,6:1 su bianco (prima #9CA3AF, 2,5:1) */
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.footer-legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font-size: 0.85rem;
  color: #5F6B66;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal-link:hover {
  color: var(--brand-emerald);
}

/* ==========================================================================
   FLOATING CHECKOUT MODAL SYSTEM - Glassmorphic Light Theme
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1rem;
}

.modal-overlay:not(.active) {
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.4s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS (Fluid Transitions & Flexbox/Grid Logic)
   ========================================================================== */

/* Laptop Breakpoint */
@media (max-width: 992px) {
  :root {
    --section-padding: clamp(4rem, 7vw, 6.5rem);
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-media {
    position: static;
    max-width: 520px;
  }
  
  

  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
  

  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group-full {
    grid-column: span 1;
  }

  .contact-form {
    padding: 1.5rem 1.25rem;
    border-radius: 18px;
  }

  .contact-form-frame {
    padding: 6px;
    border-radius: 24px;
  }

  /* Su mobile il telefono (facoltativo) va dopo l'email */
  .form-group:has(#contact-phone) {
    order: 1;
  }
  .form-group:has(#contact-message) {
    order: 2;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .footer-bottom {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  
}

/* ==========================================================================
   POLICY PRIVACY PAGE LAYOUT
   ========================================================================== */
.policy-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background-color: var(--bg-primary);
  min-height: 70vh;
}

.policy-content-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: clamp(2rem, 4vw, 3.5rem);
  box-shadow: var(--shadow-subtle);
  max-width: 900px;
  margin: 0 auto;
}

.policy-content-card h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

.policy-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.policy-body h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #007528;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

.policy-body p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-sm);
  font-size: 1rem;
}

.policy-body ul {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}

.policy-body li {
  margin-bottom: 0.35rem;
}

.policy-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-bottom: var(--space-sm);
  color: #007528;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.policy-back-btn:hover {
  color: #005d1f;
  transform: translateX(-3px);
}

/* ==========================================================================
   PRIVACY POLICY MODAL SYSTEM
   ========================================================================== */
.privacy-modal {
  background-color: #FFFFFF;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 620px;
  max-height: 75vh;
  box-shadow: var(--shadow-modal);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .privacy-modal {
  transform: scale(1) translateY(0);
}

.privacy-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.privacy-modal-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.privacy-modal-body {
  padding: 1.25rem 1.35rem;
  overflow-y: auto;
  scroll-behavior: smooth;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  -webkit-overflow-scrolling: touch;
}

.privacy-modal-body h4 {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-emerald);
  margin-top: 1.15rem;
  margin-bottom: 0.35rem;
}

.privacy-modal-body h4:first-child {
  margin-top: 0;
}

.privacy-modal-body p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.privacy-modal-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.privacy-modal-body li {
  margin-bottom: 0.3rem;
}

.privacy-modal-trigger {
  color: var(--brand-emerald);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.privacy-modal-trigger:hover {
  color: var(--action-mint-hover);
  text-decoration: underline;
}

/* Custom subtle scrollbar for the modal body */
.privacy-modal-body::-webkit-scrollbar {
  width: 6px;
}

.privacy-modal-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.privacy-modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.18);
  border-radius: 3px;
}

.privacy-modal-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
  .privacy-modal {
    max-width: calc(100vw - 32px);
    max-height: 78vh;
    margin: 16px;
    border-radius: var(--border-radius-md);
  }
  
  .privacy-modal-header {
    padding: 0.85rem 1rem;
  }
  
  .privacy-modal-title {
    font-size: 0.95rem;
  }
  
  .privacy-modal-body {
    padding: 1rem;
    font-size: 0.78rem;
    line-height: 1.55;
  }
}


/* ==========================================================================
   VENDITA DISPENSE — schede, checkout (<dialog>), pagine Grazie / Annullato
   ========================================================================== */

.checkbox-help + .field-error {
  margin: 0 0 0.75rem calc(20px + 0.75rem);
}

/* --- Dialog --- */
.checkout-dialog {
  --field-error: #B42318;
  --field-error-bg: #FEF3F2;
  position: fixed;
  width: min(640px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(92vh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--border-radius-lg);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.2), 0 2px 6px rgba(17, 24, 39, 0.08);
  overflow: hidden;
}

.checkout-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: checkout-in 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-dialog.is-closing {
  animation: checkout-out 0.2s ease-in forwards;
}

.checkout-dialog::backdrop {
  background-color: rgba(17, 24, 39, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: backdrop-in 0.3s ease;
}

.checkout-dialog.is-closing::backdrop {
  animation: backdrop-out 0.2s ease forwards;
}

@keyframes checkout-in {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes checkout-out {
  to { opacity: 0; transform: translateY(8px) scale(0.99); }
}
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }

.checkout-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.checkout-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 1.1rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.checkout-title {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.checkout-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.checkout-close:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.checkout-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem 1.75rem 1.25rem;
}

/* Riepilogo */
.checkout-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 1rem 1.15rem;
  border: 1px solid #D9EBDF;
  border-radius: var(--border-radius-md);
  background-color: var(--bg-secondary);
}

.summary-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 58px;
  border: 1px solid #CFE3D6;
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--brand-emerald);
}

.summary-doc span {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.summary-info {
  min-width: 0;
}

.summary-level {
  margin: 0 0 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-emerald);
}

.summary-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.summary-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.summary-price {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.summary-amount {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.summary-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Campi */
.checkout-form .form-grid {
  margin-bottom: 1.15rem;
}

.form-grid-address {
  grid-template-columns: 1fr 2fr 1fr;
}

.input-code {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.input-code::placeholder {
  text-transform: none;
  letter-spacing: 0;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  cursor: pointer;
}

.checkout-consents {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.checkout-consents .checkbox-group {
  margin: 0 0 0.3rem;
}

.checkout-consents .checkbox-help {
  margin-bottom: 1rem;
}

.checkout-consents .checkbox-help:has(+ .field-error:not(:empty)) {
  margin-bottom: 0.3rem;
}

/* Piede con il pagamento */
.checkout-foot {
  flex: none;
  padding: 1rem 1.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

.checkout-pay {
  margin-top: 0;
  gap: 0.6rem;
}

.checkout-pay[aria-busy="true"] .checkout-lock {
  display: none;
}

.checkout-trust {
  margin-top: 0.85rem;
  text-align: center;
}

.checkout-trust p {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.checkout-trust strong {
  color: var(--text-primary);
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pay-methods li {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  background-color: var(--bg-primary);
}

/* Reindirizzamento a Nexi */
.checkout-redirect {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.97);
  animation: backdrop-in 0.25s ease;
}

.checkout-redirect-title {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.checkout-redirect-text {
  margin: 0;
  font-size: 0.9rem;
}

.order-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #CFE3D6;
  border-top-color: var(--brand-emerald);
  animation: form-spin 0.8s linear infinite;
}

/* --- Pagine Grazie / Annullato / errori di download --- */
.order-page {
  background-color: var(--bg-secondary);
  min-height: 72vh;
}

.order-card {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3rem);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-premium);
}

.order-icon {
  display: inline-flex;
  margin-bottom: 1.25rem;
  color: var(--brand-emerald);
}

.order-icon--muted {
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: #35604A;
}

.order-check {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: form-check-draw 0.5s 0.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.order-title {
  margin-bottom: 0.85rem;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  outline: none;
}

.order-lead {
  max-width: 52ch;
  margin-bottom: 1.75rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.order-lead strong {
  color: var(--text-primary);
}

.order-download {
  gap: 0.6rem;
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.order-notes {
  display: grid;
  gap: 0.6rem;
  margin: 1.75rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--border-color);
  list-style: none;
}

.order-notes li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.925rem;
  line-height: 1.55;
}

.order-notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 14px;
  height: 14px;
  background-color: var(--brand-emerald);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.order-notes strong {
  color: var(--text-primary);
}

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

.order-meta {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.order-meta a {
  color: var(--brand-emerald);
  text-underline-offset: 2px;
}

/* --- Mobile: il checkout diventa a schermo intero --- */
@media (max-width: 640px) {
  .checkout-dialog {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .checkout-dialog[open] {
    animation-name: checkout-sheet-in;
  }

  .checkout-head {
    padding: 0.6rem 0.5rem 0.6rem 1.25rem;
  }

  .checkout-body {
    padding: 1.25rem 1.25rem 1rem;
  }

  .checkout-foot {
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(17, 24, 39, 0.06);
  }

  .checkout-trust {
    margin-top: 0.65rem;
  }

  .checkout-trust p {
    margin-bottom: 0.45rem;
    font-size: 0.75rem;
  }

  .pay-methods {
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  .pay-methods li {
    padding: 0.1rem 0.35rem;
    font-size: 0.6875rem;
    white-space: nowrap;
  }

  .checkout-summary {
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.9rem;
  }

  .summary-doc {
    grid-row: span 2;
    align-self: start;
  }

  .summary-price {
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
  }

  .summary-amount {
    font-size: 1.3rem;
  }

  .checkout-form .form-grid,
  .form-grid-address {
    grid-template-columns: 1fr 1fr;
  }

  .checkout-form .form-group-full,
  .form-grid-address .form-group:nth-child(2) {
    grid-column: 1 / -1;
  }

  .form-grid-address .form-group:nth-child(2) {
    order: 3;
  }

  .checkout-form .form-grid[data-when="azienda"] .form-group {
    grid-column: 1 / -1;
  }

  .order-download {
    width: 100%;
  }
}

/* Schermi molto stretti (≤ 380 px): pulsante su una riga e metodi di pagamento entro i margini */
@media (max-width: 380px) {
  .pay-extra {
    display: none;
  }

  .pay-methods li:nth-child(3) {
    display: none; /* Maestro: già coperto da Mastercard */
  }
}

@keyframes checkout-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-dialog[open],
  .checkout-dialog.is-closing,
  .checkout-dialog::backdrop,
  .checkout-redirect {
    animation: none;
  }
  .order-check {
    animation: none;
    stroke-dashoffset: 0;
  }
  .order-spinner {
    animation-duration: 1.6s;
  }
}


/* Sui fondi scuri le ombre dei pulsanti sono neutre (niente alone verde) */
[data-header-dark] .btn-pill--primary,
[data-header-dark] .btn-pill--primary:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   COMPARSA ALLO SCORRIMENTO — sobria: leggera salita + dissolvenza, una volta sola
   (attivata da main.js solo se l'utente non ha chiesto movimento ridotto)
   ========================================================================== */
.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.9s var(--ease-out);
}

.has-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.has-reveal [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.8s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.has-reveal [data-reveal-stagger].is-visible > * {
  opacity: 1;
  transform: none;
}

.has-reveal [data-reveal-stagger].is-visible > :nth-child(2) { transition-delay: 0.07s, 0.07s, 0s; }
.has-reveal [data-reveal-stagger].is-visible > :nth-child(3) { transition-delay: 0.14s, 0.14s, 0s; }
.has-reveal [data-reveal-stagger].is-visible > :nth-child(4) { transition-delay: 0.21s, 0.21s, 0s; }

.has-reveal [data-reveal-stagger].is-visible > .pricing-card:hover {
  transform: translateY(-6px);
  transition-delay: 0s;
}
