/* =========================================================================
   BALANCIA — Design system (statico, zero dipendenze)
   Palette e tipografia derivate dal tema Balancia.
   Font self-hosted: Baskervville (display serif) + Manrope (sans).
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --plum: #352a44;
  --plum-soft: #4a3d5c;
  --plum-ink: #2a2136;
  --cream: #faf2ea;
  --cream-deep: #f3e7db;
  --paper: #fafaf7;
  --mint: #f2fff8;
  --mint-soft: #e6f6ec;
  --white: #ffffff;
  --ink: rgba(7, 8, 7, 0.9);
  --ink-soft: rgba(7, 8, 7, 0.62);
  --line: rgba(53, 42, 68, 0.14);

  --font-serif: "Baskervville", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius-card: 24px;
  --radius-lg: 40px;
  --radius-pill: 80px;

  --shadow-sm: 0 6px 20px rgba(53, 42, 68, 0.08);
  --shadow-md: 0 18px 50px rgba(53, 42, 68, 0.14);

  /* ver2: anello di focus ad alto contrasto (--mint-soft sul bianco rende ~1,05:1, invisibile) */
  --focus-ring: #352a44;
  /* ver2: stato dei campi */
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --danger-line: rgba(179, 38, 30, 0.24);
  --ok-ink: #1b5e3a;
  --ok-line: rgba(27, 94, 58, 0.18);
  /* ver2: pannello in vetro del form contatti (finitura sul bordo, non sulla geometria) */
  --glass: rgba(255, 255, 255, 0.58);
  --glass-edge: rgba(255, 255, 255, 0.82);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --glass-shadow: 0 30px 70px -34px rgba(53, 42, 68, 0.55);
  --field-glass: rgba(255, 255, 255, 0.5);
  --placeholder: rgba(7, 8, 7, 0.58);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 92px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, .serif {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  color: var(--plum);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.em { font-style: italic; }

.eyebrow {
  font-family: var(--font-serif);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--plum-soft);
  font-variation-settings: normal;
}
.eyebrow.sans { font-family: var(--font-sans); font-weight: 600; }
.lead { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.55; color: var(--ink); }
.muted { color: var(--ink-soft); }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 128px); position: relative; }
.section--tight { padding-block: clamp(44px, 6vw, 80px); }
.center { text-align: center; }
.stack > * + * { margin-top: 1.1rem; }
.section-head { max-width: 760px; margin-inline: auto; text-align: center; }
.section-head .eyebrow { display: block; margin-bottom: 1rem; }
.divider { height: 1px; background: var(--line); border: 0; }

/* ---------- Sunburst motif ---------- */
.burst { width: 34px; height: 34px; color: var(--plum); flex: none; }
.burst--light { color: var(--cream); }
.burst svg { width: 100%; height: 100%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 0.95rem 0.95rem 0.95rem 1.7rem;
  border-radius: var(--radius-pill);
  background: var(--plum);
  color: var(--cream);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease);
  will-change: transform;
}
.btn .arrow {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-left: 1.1rem;
  border-radius: 50%;
  background: var(--mint);
  color: var(--plum);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}
.btn .arrow svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:hover .arrow { transform: rotate(45deg); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--mint-soft); outline-offset: 3px; }
.btn--ghost { background: var(--white); color: var(--plum); box-shadow: var(--shadow-sm); }
.btn--ghost .arrow { background: var(--plum); color: var(--cream); }
.btn--light { background: var(--cream); color: var(--plum); }
.btn--light .arrow { background: var(--plum); color: var(--cream); }
.btn--sm { padding: 0.7rem 0.7rem 0.7rem 1.35rem; font-size: 0.9rem; }
.btn--sm .arrow { width: 2rem; height: 2rem; margin-left: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  padding: 0.55rem 0.6rem 0.55rem 1.4rem;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.is-scrolled .bar { background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }

/* Header over scuro (solo home): testo chiaro finché non si scrolla */
.site-header.over-hero:not(.is-scrolled) .bar { background: rgba(255, 255, 255, 0.06); }
.site-header.over-hero:not(.is-scrolled) .brand,
.site-header.over-hero:not(.is-scrolled) .nav a { color: var(--cream); }
.site-header.over-hero:not(.is-scrolled) .nav a::after { background: var(--cream); }
.site-header.over-hero:not(.is-scrolled) .btn--sm { background: var(--cream); color: var(--plum); }
.site-header.over-hero:not(.is-scrolled) .btn--sm .arrow { background: var(--plum); color: var(--cream); }
.site-header.over-hero:not(.is-scrolled) .brand__logo { filter: brightness(0) invert(1) opacity(0.92); } /* logo cream sull'hero scuro */
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-serif); font-size: clamp(1.15rem, 1.6vw, 1.5rem); line-height: 1; color: var(--plum); white-space: nowrap; flex: none; }
.brand .burst { width: 24px; height: 24px; }
.brand__logo { height: clamp(34px, 3.4vw, 46px); width: auto; display: block; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 1.8vw, 1.8rem); }
.nav a { font-weight: 500; font-size: 0.98rem; color: var(--plum); position: relative; padding: 0.3rem 0; opacity: 0.85; transition: opacity 0.25s; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1.5px; background: var(--plum); transition: width 0.3s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }

.header-cta { display: inline-flex; align-items: center; }
.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 50%; background: var(--plum); color: var(--cream); place-items: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(120% 120% at 70% 10%, #4a3d5c 0%, var(--plum) 45%, #1d1728 100%);
  color: var(--cream);
  margin-top: calc(-1 * (var(--header-h) + 14px));
  padding-top: calc(var(--header-h) + 14px);
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; mix-blend-mode: luminosity; }
.hero__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(29,23,40,0.66) 0%, rgba(29,23,40,0.42) 45%, rgba(29,23,40,0.5) 78%, rgba(250,242,234,0.92) 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero__quote { font-family: var(--font-serif); font-size: clamp(2.4rem, 6.5vw, 5.2rem); line-height: 1.02; color: var(--cream); max-width: 16ch; }
.hero__quote .em { color: #e9dcc9; }
.hero__sub { margin-top: 1.6rem; max-width: 46ch; color: rgba(250, 242, 234, 0.86); font-size: 1.12rem; }
.hero__actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.hero__scroll { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 1; font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--plum-soft); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero__scroll .line { width: 1px; height: 40px; background: var(--plum-soft); animation: scrollLine 2.2s var(--ease) infinite; }
@keyframes scrollLine { 0%,100% { transform: scaleY(0.4); transform-origin: top; } 50% { transform: scaleY(1); } }

/* ---------- Page hero (interne) ---------- */
.page-hero { padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(30px, 5vw, 60px); background: var(--cream); text-align: center; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); }
.page-hero .eyebrow { display: block; margin-top: 1rem; }

/* ---------- Split / intro ---------- */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(30px, 5vw, 72px); align-items: center; }
.split--rev .split__media { order: -1; }
.split__media { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); position: relative; }
.split__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 4.4; }
.split__media .burst { position: absolute; top: 22px; left: 22px; width: 40px; height: 40px; color: var(--cream); }
.quote-lg { font-family: var(--font-serif); font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.2; color: var(--plum); }

/* ---------- Feature trio ---------- */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: clamp(40px, 6vw, 72px); }
.trio__item { padding: clamp(24px, 3vw, 44px); border-left: 1px solid var(--line); }
.trio__item:first-child { border-left: 0; }
.trio__item .ico { width: 64px; height: 64px; color: var(--plum); margin-bottom: 1.4rem; }
.trio__item h3 { margin-bottom: 0.6rem; font-size: 1.5rem; }
.trio__item p { color: var(--ink-soft); font-size: 1rem; }
/* Foto d'apertura di ogni valore: icona del brand come badge sovrapposto */
.trio__media { position: relative; margin-bottom: 2.4rem; }
.trio__photo { display: block; overflow: hidden; border-radius: var(--radius-card); background: var(--cream-deep); box-shadow: var(--shadow-sm); }
.trio__photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 30%; transition: transform 0.7s var(--ease); }
.trio__item:hover .trio__photo img { transform: scale(1.05); }
.trio__media .ico { position: absolute; left: 16px; bottom: -26px; width: 52px; height: 52px; margin: 0; display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 50%; box-shadow: var(--shadow-sm); color: var(--plum); }
.trio__media .ico svg { width: 26px; height: 26px; }

/* ---------- Cards grid (aree) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 30px); margin-top: clamp(40px, 6vw, 64px); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: clamp(26px, 3vw, 40px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
/* Foto di testa della card: bordi arrotondati a filo con la card */
.card__media {
  display: block;
  margin: calc(-1 * clamp(26px, 3vw, 40px)) calc(-1 * clamp(26px, 3vw, 40px)) 0.6rem;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: var(--cream-deep);
}
.card__media img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 25%; transition: transform 0.7s var(--ease); }
.card:hover .card__media img { transform: scale(1.05); }
.card .num { font-family: var(--font-serif); font-size: 2.6rem; color: var(--cream-deep); line-height: 1; }
.card .burst { width: 30px; height: 30px; }
.card h3 { font-size: 1.55rem; }
.card p { color: var(--ink-soft); font-size: 1rem; }

/* ---------- Panel (dark) ---------- */
.panel { background: var(--plum); color: var(--cream); border-radius: var(--radius-lg); padding: clamp(40px, 6vw, 84px); }
.panel h2, .panel h3 { color: var(--cream); }
.panel .eyebrow { color: #cdbfd8; }
.panel p { color: rgba(250, 242, 234, 0.82); }

/* ---------- Specialty circle ---------- */
.specialty { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(20px, 4vw, 60px); align-items: center; }
.specialty__img { width: clamp(240px, 34vw, 420px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-md); }
.specialty__img img { width: 100%; height: 100%; object-fit: cover; }
.specialty__list { display: flex; flex-direction: column; gap: 1.1rem; }
.specialty__list li { display: flex; align-items: center; gap: 0.8rem; font-weight: 500; color: var(--plum); }
.specialty__list li .burst { width: 16px; height: 16px; }
.specialty__list.right { text-align: left; }
.specialty__list.left { justify-items: end; text-align: right; flex-direction: column; align-items: flex-end; }
.specialty__list.left li { flex-direction: row-reverse; }

/* ---------- Timeline (come lavoro) ---------- */
.timeline { position: relative; margin-top: clamp(40px, 6vw, 72px); }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-50%); }
.tl-step { position: relative; display: grid; grid-template-columns: 1fr 88px 1fr; align-items: center; gap: 0; margin-bottom: clamp(28px, 4vw, 48px); }
.tl-step__body { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); padding: clamp(20px, 2.4vw, 32px); box-shadow: var(--shadow-sm); }
.tl-step:nth-child(odd) .tl-step__body { grid-column: 1; text-align: right; }
.tl-step:nth-child(even) .tl-step__body { grid-column: 3; }
.tl-step__node { grid-column: 2; justify-self: center; width: 64px; height: 64px; border-radius: 50%; background: var(--plum); color: var(--cream); display: grid; place-items: center; font-family: var(--font-serif); font-size: 1.5rem; z-index: 1; box-shadow: 0 0 0 8px var(--cream); }
.tl-step__body h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.tl-step__body p { color: var(--ink-soft); font-size: 0.98rem; }
.tl-step__body .tag { display: inline-block; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--plum-soft); margin-bottom: 0.5rem; }

/* ---------- Steps (orizzontali) ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(14px, 2vw, 26px); margin-top: clamp(36px, 5vw, 60px); }
.step { text-align: center; padding: clamp(18px, 2vw, 28px) 12px; border-radius: var(--radius-card); background: var(--white); border: 1px solid var(--line); }
.step__node { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; border: 1.5px solid var(--plum); color: var(--plum); display: grid; place-items: center; font-family: var(--font-serif); font-size: 1.35rem; }
/* Ver2: i cinque passaggi della home portano un'icona del brand al posto del numero */
.step__node svg { width: 26px; height: 26px; }
.step h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.step p { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- CTA band ---------- */
.cta-band { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--plum); color: var(--cream); text-align: center; padding: clamp(56px, 9vw, 120px) var(--gutter); }
.cta-band h2 { color: var(--cream); font-size: clamp(2.2rem, 5.5vw, 4rem); }
.cta-band .sub { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: #e9dcc9; margin-top: 0.6rem; }
.cta-band__actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-items: center; }
.contact-pill { display: inline-flex; align-items: center; gap: 0.7rem; background: var(--cream); color: var(--plum); padding: 0.7rem 1.5rem 0.7rem 0.7rem; border-radius: var(--radius-pill); font-weight: 600; }
.contact-pill .ico { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--plum); color: var(--cream); display: grid; place-items: center; }
.contact-pill .ico svg { width: 18px; height: 18px; }

/* ---------- Info rows (contatti) ---------- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 30px); }
.info-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); padding: clamp(24px, 3vw, 36px); }
.info-card .ico { width: 46px; height: 46px; border-radius: 50%; background: var(--mint); color: var(--plum); display: grid; place-items: center; margin-bottom: 1.1rem; }
.info-card .ico svg { width: 20px; height: 20px; }
.info-card h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.info-card p, .info-card a { color: var(--ink-soft); font-size: 1rem; }
.info-card a:hover { color: var(--plum); }

/* ---------- Form ---------- */
/* D2 ver2: il form indossa un pannello di vetro — ricetta "edge" di
   deeplethe/solid-glass tradotta nella palette cream/plum: la finitura
   (linea di luce sopra, bordo, ombra) sta sul bordo, mai sulla faccia. */
.form-pane {
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  backdrop-filter: blur(26px) saturate(160%);
  border: 0;
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.4vw, 44px);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 rgba(53, 42, 68, 0.05),
    0 0 0 1px var(--glass-edge),
    0 1px 2px rgba(53, 42, 68, 0.06),
    var(--glass-shadow);
}
.form { display: grid; gap: 1.1rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--plum); }
.field input, .field select, .field textarea {
  font: inherit;
  color: var(--ink);
  background-color: var(--field-glass);
  border: 1px solid rgba(53, 42, 68, 0.10);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
  width: 100%;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c4a6f' stroke-width='2.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 1rem center;
  background-size: 14px;
  padding-right: 2.8rem;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--plum);
  background-color: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 4px var(--mint-soft), 0 0 0 5px var(--focus-ring);
}
.field .err { color: #b3261e; font-size: 0.82rem; display: none; }
.field.is-invalid input, .field.is-invalid textarea, .field.is-invalid select { border-color: #b3261e; }
.field.is-invalid .err { display: block; }
.consent { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.9rem; color: var(--ink-soft); }
.consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--plum); }
.form-status { padding: 1rem 1.2rem; border-radius: 14px; font-weight: 600; display: none; }
.form-status.ok { display: block; background: var(--mint-soft); color: #1b5e3a; }
.form-status.bad { display: block; background: #fdecea; color: #b3261e; }
.form-status.bad a { color: inherit; text-decoration: underline; }
.field__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field__foot .err { flex: 1; }
.counter { font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.counter.is-ok { color: #1b5e3a; }
.field label .req { color: var(--plum); font-weight: 700; }
.form-note { margin-top: 0.9rem; font-size: 0.82rem; color: var(--ink-soft); }
.form-success {
  background: var(--white); border: 1px solid var(--mint-soft); border-radius: var(--radius-card);
  padding: clamp(26px, 3vw, 40px); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 0.8rem; align-items: flex-start;
}
.form-success h3 { font-size: 1.7rem; }
.form-success p { color: var(--ink-soft); }
.form-success a { color: var(--plum); text-decoration: underline; }
.form-success:focus { outline: none; }
/* D2 ver2: come da materiale upstream, la trasparenza ridotta rende il
   pannello e i campi opachi e spegne il blur, senza toccare la geometria. */
@media (prefers-reduced-transparency: reduce) {
  .form-pane,
  .field input, .field select, .field textarea {
    background-color: var(--white);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Note / disclaimer ---------- */
.note { background: var(--mint); border: 1px solid var(--mint-soft); border-radius: var(--radius-card); padding: clamp(20px, 2.6vw, 32px); color: var(--ink-soft); font-size: 0.98rem; }
.note strong { color: var(--plum); }

/* ---------- Footer ---------- */
.site-footer { background: var(--plum); color: var(--cream); padding-top: clamp(48px, 7vw, 90px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(30px, 5vw, 64px); }
.footer-brand .brand { color: var(--cream); }
.footer-brand .burst { color: var(--cream); }
.footer-brand .brand__logo { filter: brightness(0) invert(1) opacity(0.9); } /* logo cream sul footer scuro */
.footer-brand p { color: rgba(250, 242, 234, 0.7); margin-top: 1.2rem; max-width: 42ch; }
.footer-col h4 { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: #cdbfd8; margin-bottom: 1.2rem; font-weight: 700; }
.footer-col a { display: block; color: rgba(250, 242, 234, 0.82); padding: 0.35rem 0; transition: color 0.2s, padding-left 0.2s; }
.footer-col a:hover { color: var(--cream); padding-left: 6px; }
.footer-contact li { display: flex; gap: 0.7rem; align-items: flex-start; color: rgba(250, 242, 234, 0.82); padding: 0.3rem 0; }
.footer-contact svg { width: 18px; height: 18px; flex: none; margin-top: 4px; color: #cdbfd8; }
.footer-bottom { margin-top: clamp(40px, 6vw, 70px); border-top: 1px solid rgba(250, 242, 234, 0.14); padding: 1.6rem 0; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: 0.86rem; color: rgba(250, 242, 234, 0.6); }
.footer-bottom nav { display: flex; gap: 1.4rem; }
.footer-bottom a:hover { color: var(--cream); }
/* credito agenzia: link esterno nel copyright, serve un affordance in più */
.footer-bottom .madeby { text-decoration: underline; text-decoration-color: rgba(250, 242, 234, 0.35); text-underline-offset: 3px; }
.footer-bottom .madeby:hover { text-decoration-color: var(--cream); }
/* "Gestisci consenso" è un button che deve sembrare un link del footer */
.footer-bottom nav button { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.footer-bottom nav button:hover { color: var(--cream); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }

/* ---------- Banner consenso cookie (card leggera + pannello preferenze) ---------- */
.cookie-card {
  position: fixed; left: clamp(16px, 3vw, 34px); bottom: clamp(16px, 3vw, 34px); z-index: 300;
  width: min(430px, calc(100vw - 2 * clamp(16px, 3vw, 34px)));
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(29, 23, 40, 0.22), 0 2px 8px rgba(29, 23, 40, 0.08);
  animation: cookieCardIn 0.45s var(--ease) both;
}
@keyframes cookieCardIn { from { transform: translateY(18px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.cookie-card__body { position: relative; padding: 26px 26px 22px; }
.cookie-card__close {
  position: absolute; top: 14px; right: 14px;
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.cookie-card__close svg { width: 17px; height: 17px; }
.cookie-card__close:hover { background: var(--cream); color: var(--plum); }
.cookie-card__close:focus-visible { outline: 3px solid var(--mint-soft); outline-offset: 2px; }
.cookie-card__title { font-family: var(--font-serif); font-size: 1.32rem; font-weight: 400; color: var(--plum); margin-bottom: 0.5rem; }
.cookie-card__text { font-size: 0.88rem; line-height: 1.62; color: var(--ink-soft); }
.cookie-card__text strong { color: var(--ink); font-weight: 600; }
.cookie-card__link { margin-top: 0.7rem; font-size: 0.84rem; color: var(--ink-soft); }
.cookie-card__link a { color: var(--plum); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cookie-card__link a:hover { color: var(--plum-ink); }
.cookie-card__actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.15rem; }
/* variante secondaria: pill con bordo, su fondo bianco */
.btn--line { background: var(--white); color: var(--plum); border: 1px solid var(--line); box-shadow: none; }
.btn--line:hover { border-color: var(--plum); box-shadow: var(--shadow-sm); }

/* pannello preferenze */
.cookie-prefs__scrim {
  position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; padding: 20px;
  background: rgba(42, 33, 54, 0.55);
  animation: cookieScrimIn 0.28s ease both;
}
@keyframes cookieScrimIn { from { opacity: 0; } to { opacity: 1; } }
.cookie-prefs {
  position: relative; display: flex; flex-direction: column;
  width: min(560px, 100%); max-height: min(84vh, 680px);
  background: var(--white); color: var(--ink);
  border-radius: 20px; box-shadow: 0 30px 70px rgba(29, 23, 40, 0.34);
  animation: cookiePrefsIn 0.35s var(--ease) both;
}
@keyframes cookiePrefsIn { from { transform: translateY(22px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cookie-prefs__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 22px 26px 14px; border-bottom: 1px solid var(--line);
}
.cookie-prefs__head h2 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 400; color: var(--plum); }
.cookie-prefs__head .cookie-card__close { position: static; }
.cookie-prefs__scroll { overflow-y: auto; padding: 6px 26px 14px; -webkit-overflow-scrolling: touch; }
.cookie-prefs__group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.cookie-prefs__group:last-child { border-bottom: 0; }
.cookie-prefs__group p { font-size: 0.84rem; line-height: 1.6; color: var(--ink-soft); margin-top: 0.5rem; }
.cookie-prefs__group p a { color: var(--plum); text-decoration: underline; text-underline-offset: 2px; }
.cookie-prefs__group code { font-size: 0.78em; background: var(--cream); padding: 0.1rem 0.35rem; border-radius: 5px; }
.cookie-prefs__head > div { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.cookie-prefs__head strong { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.cookie-prefs__tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--plum); background: var(--mint-soft); border-radius: 999px; padding: 0.22rem 0.6rem; }
.cookie-prefs__lock { margin-left: auto; font-size: 0.85rem; line-height: 1; opacity: 0.55; }
.cookie-prefs__actions { display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 14px 26px 22px; border-top: 1px solid var(--line); }

/* switch di categoria */
.cookie-prefs__switch { display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.cookie-prefs__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cookie-prefs__switch .track {
  position: relative; display: inline-block; width: 42px; height: 24px;
  background: rgba(53, 42, 68, 0.22); border-radius: 999px; transition: background 0.25s;
}
.cookie-prefs__switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: var(--white); border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease);
}
.cookie-prefs__switch input:checked + .track { background: var(--plum); }
.cookie-prefs__switch input:checked + .track::after { transform: translateX(18px); }
.cookie-prefs__switch input:focus-visible + .track { outline: 3px solid var(--mint-soft); outline-offset: 2px; }

@media (max-width: 620px) {
  .cookie-card { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .cookie-card__body { padding: 22px 20px 18px; }
  .cookie-card__actions .btn { flex: 1 1 auto; justify-content: center; }
  .cookie-prefs__actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-card, .cookie-prefs, .cookie-prefs__scrim { animation: none; }
}
@media print { .cookie-card, .cookie-prefs__scrim { display: none; } }

/* ---------- Misc ---------- */
.badge-strip { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.4rem; }
.badge { font-size: 0.82rem; font-weight: 600; color: var(--plum); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0.5rem 1.1rem; }
.price-tag { display: inline-flex; align-items: baseline; gap: 0.5rem; font-family: var(--font-serif); }
.price-tag .amount { font-size: clamp(2.6rem, 6vw, 4rem); color: var(--plum); }
.price-tag .unit { font-family: var(--font-sans); font-size: 1rem; color: var(--ink-soft); }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 980px) {
  .nav, .header-cta { display: none; }
  .nav-toggle { display: grid; }
  .split, .split--rev { grid-template-columns: 1fr; }
  .split--rev .split__media { order: 0; }
  .trio, .cards, .cards--2, .info-grid { grid-template-columns: 1fr 1fr; }
  .trio__item { border-left: 0; border-top: 1px solid var(--line); }
  .trio__item:first-child { border-top: 0; }
  .steps { grid-template-columns: 1fr 1fr; }
  .specialty { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .specialty__list.left { align-items: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  /* Mobile nav drawer */
  .nav.is-open {
    display: flex; position: fixed; inset: 0; z-index: 200;
    flex-direction: column; justify-content: center; align-items: center; gap: 1.4rem;
    background: var(--plum);
  }
  .nav.is-open a { color: var(--cream); font-size: 1.5rem; font-family: var(--font-serif); opacity: 1; }
  .nav.is-open .nav-close { display: grid; position: absolute; top: 24px; right: 24px; width: 46px; height: 46px; border-radius: 50%; background: var(--cream); color: var(--plum); place-items: center; }
}
.nav-close { display: none; }
.nav-close svg { width: 22px; height: 22px; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .trio, .cards, .cards--2, .info-grid, .steps, .form .row { grid-template-columns: 1fr; }
  .timeline::before { left: 22px; }
  .tl-step { grid-template-columns: 44px 1fr; }
  .tl-step:nth-child(odd) .tl-step__body,
  .tl-step:nth-child(even) .tl-step__body { grid-column: 2; text-align: left; }
  .tl-step__node { grid-column: 1; width: 44px; height: 44px; font-size: 1.1rem; box-shadow: 0 0 0 6px var(--cream); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero__quote { font-size: clamp(2.2rem, 9vw, 3rem); }
  .hero__scroll { display: none; } /* evita sovrapposizione coi bottoni su schermi stretti */
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ver2 — elenco link della pagina 404 */
.link-list { display: grid; gap: .6rem; margin-top: 1.2rem; }
.link-list a { color: var(--plum-soft); text-decoration: underline; text-underline-offset: 3px; }
.link-list a:hover { color: var(--plum); }
