:root {
    --color-primary: #183128;
    --color-accent: #8fbb82;
    --color-secondary: #c9dfbf;
    --color-background: #f5f8f2;
    --color-text: var(--color-primary);
    --color-text-light: #f8fbf6;
    --color-link: #315d3b;
    --font-family-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --border-radius: 0.75rem;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 10px 30px rgba(30, 71, 48, 0.2);
}

::selection { color: #183128; background-color: #c9dfbf; }
::-moz-selection { color: #183128; background-color: #c9dfbf; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-color: var(--color-accent) #e8efe4; }
body { font-family: var(--font-family-system); background: var(--color-background); color: var(--color-text); line-height: 1.6; }
body.menu-open { overflow: hidden; }
h1, h2, h3 { color: var(--color-primary); margin-bottom: 0.5rem; line-height: 1.2; }
h2 { font-size: 1.8rem; border-bottom: 3px solid var(--color-accent); padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.4rem; }
p + p { margin-top: 0.65rem; }
a { color: var(--color-link); }
a:focus-visible, button:focus-visible { outline: 3px solid #7a4a00; outline-offset: 3px; }
header a:focus-visible, header button:focus-visible, footer a:focus-visible, footer button:focus-visible { outline-color: #ffe08a; }
.skip-link { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 200; padding: 0.6rem 1rem; background: white; border-radius: var(--border-radius); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.mt-4 { margin-top: 1rem; }

.btn { display: inline-block; padding: 0.7rem 1.2rem; font: inherit; font-weight: 600; text-align: center; border-radius: var(--border-radius); cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease; text-decoration: none; border: 0; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(143, 187, 130, 0.35); }
.btn-primary { background: var(--color-accent); color: #142a1b; }

header { position: sticky; top: 0; z-index: 20; background: var(--color-primary); color: var(--color-text-light); padding: 1rem 0; box-shadow: var(--shadow-heavy); }
header .content { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 1200px; margin: auto; padding: 0 1rem; }
.logo-group { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.site-logo { display: flex; width: 3.25rem; height: 3.25rem; flex: 0 0 auto; }
.site-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.logo-group .site-name { color: var(--color-text-light); font-size: 1.2rem; font-weight: 700; line-height: 1.2; margin: 0; }
.logo-group p { font-size: 0.7rem; opacity: 0.8; margin: 0; }
.menu-toggle { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; color: var(--color-text-light); background: transparent; border: 1px solid rgba(201, 223, 191, 0.65); border-radius: var(--border-radius); cursor: pointer; }
.menu-toggle svg { width: 1.5rem; height: 1.5rem; }
.lang-switch { display: inline-flex; flex-shrink: 0; align-items: center; gap: 0.15rem; margin-left: auto; padding: 0.2rem; border: 1px solid rgba(201, 223, 191, 0.6); border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.lang-switch a { display: inline-flex; min-width: 2.2rem; min-height: 2rem; align-items: center; justify-content: center; padding: 0 0.4rem; color: #e5f0df; border-radius: 999px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-decoration: none; }
.lang-switch a:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.lang-switch a[aria-current="true"] { color: #142a1b; background: var(--color-accent); }
@media (max-width: 600px) {
    header .content { gap: 0.6rem; }
    .logo-group { gap: 0.5rem; }
    .logo-group .site-name { font-size: 1.1rem; }
    .logo-group > div > p:not(.site-name) { display: none; }
    .lang-switch a { min-width: 1.95rem; min-height: 1.85rem; font-size: 0.7rem; }
}
@media (max-width: 420px) {
    .logo-group .site-name { font-size: 1.05rem; }
}

.site-menu { position: fixed; inset: 0; z-index: 150; visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.35s; }
.site-menu.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.site-menu-backdrop { position: absolute; inset: 0; background: rgba(15, 32, 24, 0.68); opacity: 0; transition: opacity 0.35s ease; }
.site-menu.open .site-menu-backdrop { opacity: 1; }
.site-menu-panel { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; width: min(440px, 100%); height: 100vh; height: 100dvh; padding: clamp(1.25rem, 5vw, 2rem); overflow-y: auto; background: var(--color-background); box-shadow: var(--shadow-heavy); transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.site-menu.open .site-menu-panel { transform: translateX(0); }
.site-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; color: var(--color-text-light); background: var(--color-primary); border: 1px solid var(--color-secondary); border-radius: var(--border-radius); }
.site-menu-heading p { margin: 0; font-size: 0.8rem; color: var(--color-secondary); }
.site-menu-heading h2 { margin: 0; padding: 0; color: var(--color-text-light); border: 0; font-size: 1.35rem; }
.menu-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem; color: var(--color-text-light); background: transparent; border: 1px solid rgba(201, 223, 191, 0.65); border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.site-menu-links { display: grid; gap: 0.65rem; margin-top: 1.5rem; list-style: none; }
.site-menu-links a { display: flex; align-items: center; justify-content: flex-start; gap: 1rem; min-height: 3.25rem; padding: 0.75rem 1rem; color: var(--color-primary); background: white; border: 1px solid var(--color-secondary); border-radius: var(--border-radius); font-weight: 600; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.site-menu-links a:hover { border-color: var(--color-accent); transform: translateY(-2px); box-shadow: var(--shadow-light); }
.site-menu-links a[aria-current="page"] { background: #e7f1e4; border-color: var(--color-accent); box-shadow: var(--shadow-light); }
.site-menu-links svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; color: var(--color-link); }
.site-menu-note { margin-top: auto; padding-top: 1.5rem; color: #586a5c; font-size: 0.85rem; }

.hero { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; overflow: hidden; background: #294d38; }
.hero-media { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, #173128, #456c45), #294d38; }
.hero::before { position: absolute; z-index: 1; inset: 0; content: ""; background: linear-gradient(0deg, rgba(10, 28, 19, 0.8), rgba(10, 28, 19, 0.55)); }
.home-hero { min-height: 390px; padding: 4rem 1rem 3rem; gap: 2rem; }
.hero-content { position: relative; z-index: 2; width: min(760px, 100%); color: var(--color-text-light); }
.hero-content h1 { color: var(--color-text-light); font-size: clamp(2rem, 4vw, 3.5rem); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.hero-content > p { max-width: 640px; margin: 0.75rem auto 0; font-size: 1.05rem; }
.weather-card { position: relative; z-index: 2; width: min(100%, 430px); padding: 1.15rem 1.25rem; text-align: left; color: var(--color-primary); background: var(--color-text-light); border: 1px solid var(--color-secondary); border-top: 4px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-heavy); }
.weather-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.weather-heading svg { width: 1.7rem; height: 1.7rem; color: var(--color-link); flex: 0 0 auto; }
.weather-heading h2 { margin: 0 0 0.75rem; padding: 0; border: 0; font-size: 1.2rem; }
.weather-data { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.weather-temperature { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.weather-ground { font-weight: 700; }
.weather-note, .weather-source, .weather-update { color: #485e4c; font-size: 0.78rem; line-height: 1.45; }
.weather-note { margin-top: 0.65rem; }
.weather-source { margin-top: 0.35rem; }
.weather-action { margin-top: 0.85rem; }
.weather-button { display: flex; width: 100%; min-height: 2.75rem; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.55rem 0.9rem; font-size: 0.88rem; }
.weather-loading, .weather-error { font-size: 0.9rem; }

.home-section { padding: 3rem 1rem; }
.home-section-inner { max-width: 1200px; margin: 0 auto; }
.section-intro { max-width: 780px; }
.home-area-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
.home-area-card { display: flex; min-height: 225px; flex-direction: column; align-items: flex-start; padding: 1.5rem; color: var(--color-primary); background: white; border: 1px solid var(--color-secondary); border-top: 4px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-light); text-decoration: none; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.home-area-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-heavy); }
.home-area-card h3 { margin-bottom: 0.4rem; }
.card-icon { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin-bottom: 1rem; color: var(--color-link); background: #e7f1e4; border-radius: 0.55rem; }
.card-icon svg { width: 1.35rem; height: 1.35rem; }
.card-link { margin-top: auto; padding-top: 1rem; color: var(--color-link); font-weight: 700; }
.safety-section { padding-top: 0; }
.safety-banner { padding: 1.5rem; border: 1px solid #d9c790; border-left: 4px solid #bd8d27; border-radius: 0 var(--border-radius) var(--border-radius) 0; background: #fff8e6; }
.safety-banner h2 { border-color: #bd8d27; }
.safety-banner p { max-width: 950px; }
.safety-banner > a { display: inline-block; margin-top: 1rem; font-weight: 700; }

footer.site-footer { padding: 2.5rem 1rem 1rem; background: var(--color-primary); color: var(--color-secondary); font-size: 0.9rem; }
.site-footer .container { padding: 0 1rem; }
.site-footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.site-footer-brand-name { display: inline-block; margin-bottom: 0.45rem; color: #fff; font-size: 1.35rem; font-weight: 750; letter-spacing: 0.01em; text-decoration: none; }
.site-footer-brand p { max-width: 24rem; color: #e0ebdc; }
.site-footer h2 { margin: 0 0 0.65rem; padding: 0; border: 0; color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.site-footer-links ul { display: grid; gap: 0.38rem; list-style: none; }
.site-footer a:not(.site-footer-brand-name) { color: #d0eac5; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.site-footer a:not(.site-footer-brand-name):hover { color: #fff; }
.site-footer-feedback { align-self: start; padding: 1rem; border: 1px solid rgba(201, 223, 191, 0.3); border-radius: var(--border-radius); background: rgba(255, 255, 255, 0.06); }
.site-footer-feedback p { color: #fff; }
.emergency-number { font-size: 1.6rem; font-weight: 700; }
.site-footer-bottom { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(201, 223, 191, 0.25); color: #e0ebdc; font-size: 0.82rem; }

@media (min-width: 768px) {
    header .content { padding: 0 2rem; }
    .logo-group .site-name { font-size: 1.5rem; }
    .home-section { padding-right: 2rem; padding-left: 2rem; }
    .home-area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .site-footer-grid { grid-template-columns: 1fr; gap: 1.35rem; }
    footer.site-footer { padding: 2rem 0.5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.legal-page { padding-top: 2.5rem; padding-bottom: 4rem; }
.legal-page h1 { font-size: clamp(2rem, 4vw, 3rem); }
.legal-intro { max-width: 760px; color: #485e4c; }
.legal-content { max-width: 860px; margin-top: 1.25rem; padding: clamp(1.15rem, 3vw, 1.75rem); background: #fff; border: 1px solid var(--color-secondary); border-top: 4px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.legal-content h2 { margin: 1.6rem 0 0.5rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--color-secondary); font-size: 1.3rem; }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content h3 { margin: 1.1rem 0 0.35rem; font-size: 1.05rem; }
.legal-content p, .legal-content ul { color: #3f5244; font-size: 0.95rem; }
.legal-content p + p { margin-top: 0.6rem; }
.legal-content ul { margin-top: 0.5rem; padding-left: 1.2rem; }
.legal-content li + li { margin-top: 0.3rem; }
.legal-content a { overflow-wrap: anywhere; }
.legal-meta { margin-top: 1.25rem; color: #586a5c; font-size: 0.82rem; }
.legal-callout { margin: 0.9rem 0; padding: 0.85rem 1rem; background: #f3f7f0; border-left: 4px solid var(--color-accent); border-radius: 0 var(--border-radius) var(--border-radius) 0; font-size: 0.9rem; }
.legal-callout p { margin: 0; color: #2f4435; }
.legal-placeholder { padding: 0.1rem 0.3rem; background: #fff4d6; border: 1px dashed #bd8d27; border-radius: 0.3rem; font-weight: 700; }
.page-heading { display: flex; align-items: center; gap: 0.75rem; }
.page-heading svg { width: 1.8rem; height: 1.8rem; flex: 0 0 auto; color: var(--color-link); }
.tech-preparation-notice { display: flex; max-width: 42rem; min-height: 5.5rem; align-items: center; justify-content: center; gap: 0.85rem; margin: 2.5rem auto 3.5rem; padding: 1.25rem 1.5rem; color: var(--color-primary); background: #e7f1e4; border: 1px solid var(--color-secondary); border-radius: 0.85rem; box-shadow: var(--shadow-light); text-align: center; }
.tech-preparation-notice svg { width: 2.25rem; height: 2.25rem; flex: 0 0 auto; color: var(--color-link); }
.tech-preparation-notice p { margin: 0; font-size: clamp(1.15rem, 2.5vw, 1.45rem); font-weight: 750; line-height: 1.25; }
.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; grid-template-areas: "content toc"; gap: 1.5rem; align-items: start; max-width: 1120px; }
.legal-layout .legal-content { grid-area: content; max-width: none; margin-top: 0; }
.legal-toc { position: sticky; top: 5.25rem; grid-area: toc; padding: 1rem; background: #fff; border: 1px solid var(--color-secondary); border-top: 4px solid var(--color-accent); border-radius: var(--border-radius); box-shadow: var(--shadow-light); }
.legal-toc-title { margin: 0 0 0.55rem; color: var(--color-primary); font-size: 0.8rem; font-weight: 700; }
.legal-toc ul { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.legal-toc a { display: block; padding: 0.3rem 0.45rem; color: var(--color-link); border-radius: 0.4rem; font-size: 0.84rem; line-height: 1.35; text-decoration: none; }
.legal-toc a:hover, .legal-toc a:focus-visible { background: #f3f7f0; text-decoration: underline; }
.legal-content h2[id] { scroll-margin-top: 5.25rem; }
@media (max-width: 900px) {
    .legal-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content"; }
    .legal-toc { display: none; }
}
@media print {
    .legal-layout { display: block; }
    .legal-toc { display: none; }
    .legal-content { border: 0; box-shadow: none; }
}

/* Avviso iniziale e consenso ai servizi esterni */
body.dialog-open { overflow: hidden; }
.entry-dialog {
    position: fixed; inset: 0; z-index: 300;
    display: flex; justify-content: center; align-items: center;
    padding: 1rem; background: rgba(10, 28, 19, 0.97);
    color: var(--color-text-light);
}
.entry-dialog[hidden] { display: none; }
.entry-dialog-panel {
    width: min(820px, 100%); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
    overflow-y: auto; overscroll-behavior: contain;
    padding: clamp(1.25rem, 4vw, 2.25rem); background: var(--color-background);
    color: var(--color-primary); border: 3px solid var(--color-accent);
    border-radius: var(--border-radius); box-shadow: var(--shadow-heavy);
}
.entry-dialog-panel h2 { margin-bottom: 0.85rem; padding-bottom: 0.45rem; font-size: clamp(1.35rem, 4vw, 1.7rem); }
.entry-dialog-content { display: grid; gap: 0.7rem; }
.entry-dialog-summary { font-size: 0.95rem; line-height: 1.5; }
.entry-consent {
    padding: 0.85rem 1rem;
    background: #edf5e8;
    border: 1px solid #b9d4ac;
    border-left: 4px solid var(--color-accent);
    border-radius: 0.6rem;
}
.entry-consent h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.entry-consent p { font-size: 0.9rem; line-height: 1.5; }
.entry-consent-services {
    margin: 0.55rem 0 0; padding-left: 1.1rem;
    font-size: 0.85rem; line-height: 1.45;
    columns: 2; column-gap: 1.5rem;
}
.entry-consent-services li { margin-bottom: 0.3rem; break-inside: avoid; }
.entry-consent-more { margin-top: 0.55rem; }
.entry-consent-check {
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.92rem; font-weight: 600; line-height: 1.45; cursor: pointer;
}
.entry-consent-check input {
    width: 1.15rem; height: 1.15rem; margin-top: 0.15rem;
    flex: 0 0 auto; accent-color: var(--color-link); cursor: pointer;
}
.entry-dialog-panel .btn { margin-top: 1rem; }
.entry-dialog-panel .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.entry-dialog-footnote { margin-top: 0.65rem; font-size: 0.78rem; line-height: 1.45; color: #485e4c; }
.legal-content .btn { margin-top: 1rem; }
@media (max-width: 680px) {
    .entry-dialog-panel { padding: 1.15rem; }
    .entry-dialog-summary { font-size: 0.9rem; }
    .entry-consent-services { columns: 1; }
}
