/* Pagina per Comuni, Parchi ed Enti: stessi elementi della home */
.enti-hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; display: flex; align-items: center; background: var(--paper); color: var(--ink); overflow: hidden; }
.enti-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(15,42,29,.42), rgba(15,42,29,0)); }
.enti-hero-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(238,242,234,.92) 0%, rgba(238,242,234,.6) 34%, rgba(238,242,234,0) 55%); }
.enti-hero-copy { position: relative; z-index: 2; }
.enti-hero h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4.8rem); letter-spacing: -0.04em; line-height: .95; max-width: 12ch; font-variation-settings: "wdth" 85; color: var(--forest); }
.enti-sub { margin: 1.3rem 0 0; font-size: var(--step-1); max-width: 34ch; color: var(--ink); font-weight: 500; text-shadow: 0 0 12px rgba(238,242,234,.95), 0 0 2px rgba(238,242,234,.9); }
.enti-hero .hero-cta { margin-top: 1.8rem; }
.next-down.on-hero { position: absolute; z-index: 2; left: 50%; bottom: 22px; margin: 0; transform: translateX(-50%); }


/* chi puo' aderire */
@media (max-width: 700px) {
}

/* percorso a tappe: segnavia bianco-rosso tra i numeri */
.path-min { list-style: none; counter-reset: p; margin: clamp(40px, 6vw, 64px) auto 0; padding: 0; max-width: 1080px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2rem; position: relative; text-align: left; }
.path-min::before { content: none; }
/* il sentiero vero e' disegnato in SVG dietro le tappe (js/enti.js) */
.trail { position: relative; max-width: 1080px; margin-inline: auto; }
.trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.trail .path-min { z-index: 1; }
.path-min li { counter-increment: p; position: relative; display: grid; gap: .3rem; padding-top: 3.8rem; }
.path-min .pin { position: absolute; top: 0; left: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-style: normal; box-shadow: 0 0 0 5px var(--paper); transition: background-color .35s, transform .35s var(--ease); }
/* prima che l'escursionista arrivi la tappa e' spenta; al passaggio si accende */
.trail.is-armed .pin { background: #c9d3c4; transform: scale(.85); }
.trail.is-armed li b, .trail.is-armed li span { opacity: .3; transition: opacity .5s; }
.trail.is-armed li.is-on .pin { background: var(--green); transform: none; animation: pinPop .5s var(--ease); }
.trail.is-armed li.is-on b, .trail.is-armed li.is-on span { opacity: 1; }
@keyframes pinPop { 50% { transform: scale(1.25); } }
.trail-casing { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.trail-line { fill: none; stroke: var(--cai); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14 10; }
.trail-hiker { fill: #2196F3; stroke: #fff; stroke-width: 3; }
.trail-ring { fill: rgba(33,150,243,.25); animation: trailPulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes trailPulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.path-min b { font-weight: 600; font-size: 1.02rem; }
.path-min span { color: var(--ink-soft); font-size: var(--step--1); }

/* modulo */
.form-wrap { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(32px, 6vw, 90px); align-items: start; }
.form-intro { position: sticky; top: 110px; display: grid; gap: 1rem; }
.form-intro .marker { margin-bottom: 0; }
.form-intro h2 { max-width: 12ch; }
.form-intro p { color: var(--ink-soft); }
.form-note { font-size: .85rem; }
.enti-form { display: grid; gap: 1.6rem; padding: clamp(20px, 3vw, 36px); border-radius: var(--radius-l); background: var(--white); box-shadow: var(--ui-shadow); }
.enti-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 1rem; }
.enti-form legend { font-weight: 700; font-size: var(--step-1); margin-bottom: .8rem; padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; font-size: .88rem; font-weight: 600; }
.field input, .field textarea { font: 400 1rem/1.4 var(--font); padding: .8rem .9rem; border-radius: 12px; border: 2px solid transparent; background: var(--ui-2); color: var(--ink); transition: border-color .2s, background-color .2s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); background: var(--white); }
.field textarea { resize: vertical; }
.has-error input, .has-error textarea { border-color: #c62828; }
.err { color: #c62828; font-weight: 500; font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: .6rem 1rem; border-radius: 999px; background: var(--ui-2); font-weight: 600; font-size: .9rem; transition: background-color .2s, color .2s; }
.chips input:checked + span { background: var(--green); color: var(--white); }
.chips input:focus-visible + span { outline: 3px solid var(--leaf); outline-offset: 2px; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); flex-wrap: wrap; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.consent span { flex: 1; }
.consent .err { width: 100%; }
.form-foot { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.form-msg { font-size: .92rem; }
.form-msg.is-ok { color: var(--green); font-weight: 600; }
.form-msg.is-error { color: #c62828; font-weight: 600; }

.enti-nav { display: flex; gap: clamp(16px, 3vw, 40px); margin-inline: auto; }
.enti-nav a { font-size: .85rem; font-weight: 600; text-decoration: none; opacity: .85; }
.enti-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.page-enti .topbar.on-map .enti-nav a { text-shadow: 0 1px 6px rgba(0,0,0,.35); }
@media (max-width: 1100px) { .enti-nav { display: none; } .page-enti .topbar-link { margin-left: auto; } }
@media (max-width: 900px) {
  .path-min { grid-template-columns: 1fr; max-width: 420px; }
  .path-min li { padding: 0 0 0 3.8rem; min-height: 2.6rem; }
  .form-wrap, .grid2 { grid-template-columns: 1fr; }
  .form-intro { position: static; }
  .enti-hero { align-items: flex-end; padding-bottom: 90px; }
  .enti-hero-shade { background: linear-gradient(180deg, rgba(238,242,234,.15) 0%, rgba(238,242,234,.85) 45%, rgba(238,242,234,.95) 100%); }
}

/* modulo a passaggi */
.wizard { gap: 1.4rem; }
.wz-steps { list-style: none; margin: 0 0 .8rem; padding: 0; display: flex; justify-content: space-between; gap: .5rem; }
.wz-steps li { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
.wz-steps span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ui-2); font-size: .82rem; transition: background-color .3s, color .3s; }
.wz-steps li.is-now { color: var(--ink); }
.wz-steps li.is-now span, .wz-steps li.is-done span { background: var(--green); color: #fff; }
.wz-bar { height: 4px; border-radius: 4px; background: var(--ui-2); overflow: hidden; }
.wz-bar i { display: block; height: 100%; width: 33%; background: var(--green); transition: width .45s var(--ease); }
.wz-step { animation: fadein .35s var(--ease); }
.wz-step[hidden] { display: none; }
.enti-form legend { font-size: var(--step-2); letter-spacing: -0.02em; margin-bottom: 1rem; }
.field input, .field textarea { font-size: 16px; min-height: 52px; padding: .85rem 1rem; }
.field em { color: var(--green); font-style: normal; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.cards label { cursor: pointer; }
.cards input { position: absolute; opacity: 0; pointer-events: none; }
.cards span { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: .6rem .8rem; border-radius: 14px; background: var(--ui-2); font-weight: 600; font-size: .95rem; text-align: center; line-height: 1.25; border: 2px solid transparent; transition: background-color .2s, border-color .2s, color .2s; }
.cards input:checked + span { background: rgba(46,125,50,.1); border-color: var(--green); color: var(--green); }
.cards input:focus-visible + span { outline: 3px solid var(--leaf); outline-offset: 2px; }
.form-foot { justify-content: space-between; }
.wz-back { background: var(--ui-2); color: var(--ink); padding: 1em 1.4em; }
.wz-next, .wz-send { margin-left: auto; }
.consent a { color: var(--green); font-weight: 600; }
@media (max-width: 700px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .wz-steps li { font-size: .8rem; }
  .enti-form { padding: 18px; border-radius: 22px; }
  .form-foot .btn { flex: 1; justify-content: center; }
}

.form-foot [hidden], .wz-step[hidden] { display: none !important; }

/* pagina enti su telefono */
@media (max-width: 700px) {
  .enti-hero { padding-bottom: 104px; min-height: 0; height: auto; min-height: 100svh; }
  .enti-hero h1 { font-size: clamp(2.2rem, 9vw, 2.8rem); }
  .enti-sub { font-size: 1.02rem; }
  .enti-hero .hero-cta { display: grid; grid-template-columns: 1fr; gap: .5rem; }
  .enti-hero .hero-cta .btn { justify-content: center; font-size: .95rem; padding: .85em .8em; }
  .next-down.on-hero { bottom: 14px; font-size: .95rem; }
  .next-down.on-hero svg { width: 32px; height: 32px; }
  .tracks-min h2 { font-size: clamp(1.8rem, 7.5vw, 2.4rem); }
  .form-intro h2 { max-width: none; }
  .wz-steps li { gap: .35rem; }
  .wz-steps span { width: 24px; height: 24px; }
}

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cards { grid-template-columns: repeat(3, 1fr); }

/* servizi: quattro voci su una riga, due su tablet, una su telefono */
#servizi .tracks-grid { grid-template-columns: repeat(4, 1fr); max-width: 1120px; gap: 2rem 1.6rem; }
@media (max-width: 1000px) { #servizi .tracks-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { #servizi .tracks-grid { grid-template-columns: 1fr; } }

/* percorso in colonna: tutto centrato come il titolo, segnavia verticale al centro */
@media (max-width: 900px) {
  .path-min { max-width: 460px; gap: 0; text-align: center; }
  .path-min li { padding: 3.4rem 0 1.6rem; justify-items: center; min-height: 0; }
  .path-min .pin { left: 50%; top: 0; margin-left: -1.3rem; }
  .path-min li b, .path-min li span { position: relative; background: var(--paper); padding: 0 .5rem; }
}

/* chi puo' aderire: le cinque voci sempre su una riga finche' c'e' spazio */
@media (min-width: 701px) {
}
@media (min-width: 701px) and (max-width: 1000px) {
}

/* apertura enti su tablet e telefono: i pulsanti non toccano "Scopri i vantaggi" */
@media (max-width: 900px) {
  .enti-hero { height: auto; min-height: 100svh; align-items: flex-end; padding: 120px 0 124px; }
  .next-down.on-hero { bottom: 16px; font-size: 1rem; }
  .next-down.on-hero svg { width: 34px; height: 34px; }
}
@media (max-height: 640px) { .next-down.on-hero { display: none; } .enti-hero { padding-bottom: 48px; } }
