:root {
  --ink: #17231d;
  --forest: #1f3a30;
  --forest-2: #2b4c3f;
  --moss: #476044;       /* testo secondario: 6:1 su crema */
  --cream: #f5f2ec;
  --sand: #ebe8df;
  --sage: #cfdac8;
  --line: #d3d5cb;
  --muted: #4f5b54;      /* 6.9:1 su crema */
  --accent: #b5522e;     /* terracotta, usato con parsimonia */
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 4px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
body { margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; color: var(--ink); background: var(--cream); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h2 em, h1 em { font-style: italic; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--forest); color: #fff; padding: 10px 16px; z-index: 100; border-radius: var(--radius); }
.skip-link:focus { top: 8px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 40px); }
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-sand { background: var(--sand); }
.section-forest { background: var(--forest); color: #f4f2ec; }
.section-lead { font-size: 1.125rem; color: var(--muted); max-width: 56ch; margin-top: 20px; }
.section-lead.light { color: rgba(244, 242, 236, .88); }

.eyebrow { font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--moss); margin: 0 0 14px; }
.eyebrow-light { color: #cfe0c6; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; font: 600 .9375rem var(--sans); letter-spacing: .02em; text-decoration: none; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--forest); color: #fff; }
.btn-dark:hover { background: var(--forest-2); }
.btn-light { background: #fff; color: var(--forest); }
.btn-light:hover { background: var(--sage); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.text-link { display: inline-block; font-weight: 600; color: var(--forest); text-underline-offset: 5px; margin-top: 8px; }
.text-link::after { content: ' →'; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(245, 242, 236, .97); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.header-inner { width: min(1280px, 100% - 40px); margin-inline: auto; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--forest); display: grid; place-items: center; font: 500 1.375rem var(--serif); color: var(--forest); }
.brand-text strong { display: block; font: 600 1rem var(--sans); letter-spacing: .04em; }
.brand-text small { display: block; font-size: .75rem; color: var(--moss); letter-spacing: .04em; }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: .9375rem; }
.site-nav a { text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--moss); }
.site-nav .nav-phone { background: var(--forest); color: #fff; padding: 10px 18px; border-radius: var(--radius); border: 0; font-weight: 600; }
.nav-toggle { display: none; }

/* Hero */
.hero { position: relative; min-height: min(86vh, 820px); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,28,21,.82) 0%, rgba(10,28,21,.5) 38%, rgba(10,28,21,0) 68%), linear-gradient(0deg, rgba(10,28,21,.5) 0%, transparent 45%); }
.hero-content { position: relative; width: min(1180px, 100% - 40px); margin: 0 auto; padding: 96px 0 56px; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.75rem); line-height: .98; letter-spacing: -.035em; max-width: 12ch; }
.hero-lead { font-size: 1.1875rem; max-width: 46ch; margin: 24px 0 0; color: rgba(255,255,255,.92); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.quick-search { position: relative; width: min(1180px, 100% - 40px); margin: 0 auto -1px; display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 0; background: var(--cream); color: var(--ink); border-radius: var(--radius) var(--radius) 0 0; align-items: end; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.qs-field { padding: 16px 20px 14px; border-right: 1px solid var(--line); }
.qs-field label { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--moss); font-weight: 600; }
.qs-field select { width: 100%; border: 0; background: transparent; font: 500 1rem var(--sans); color: var(--ink); padding: 6px 0; cursor: pointer; }
.qs-submit { height: 100%; min-height: 72px; border-radius: 0; }

/* Trust */
.trust { background: var(--cream); border-bottom: 1px solid var(--line); }
.trust-list { width: min(1180px, 100% - 40px); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.trust-list li { padding: 28px 28px 28px 0; display: grid; gap: 4px; }
.trust-list strong { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; }
.trust-list span { color: var(--muted); font-size: .9375rem; }

/* Listings */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 8px 18px; border: 1px solid var(--forest); background: transparent; color: var(--forest); font: 600 .9375rem var(--sans); border-radius: 999px; cursor: pointer; }
.chip.is-active { background: var(--forest); color: #fff; }
.results-count { color: var(--muted); font-size: .9375rem; margin-bottom: 20px; }
.listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.listing { background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; transition: box-shadow .25s, transform .25s; }
.listing:hover { box-shadow: 0 14px 34px rgba(23,35,29,.12); transform: translateY(-3px); }
.listing[hidden] { display: none; }
.listing-photo { position: relative; display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand); cursor: pointer; }
.listing-photo picture { display: block; width: 100%; height: 100%; }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, center 35%); transition: transform .4s; }
.listing:hover .listing-photo img { transform: scale(1.03); }
.price-note { font: 500 1.0625rem var(--sans); color: var(--muted); }
.badge { position: absolute; top: 14px; left: 14px; background: var(--forest); color: #fff; padding: 5px 11px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.badge-alt { background: var(--accent); }
.listing-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.listing-place { font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--moss); font-weight: 600; margin-bottom: 8px; }
.listing h3 { font-size: 1.5rem; margin-bottom: 14px; }
.listing-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .9375rem; margin-bottom: 16px; }
.listing-price { font: 500 1.5rem var(--serif); margin: auto 0 16px; }
.listing-price small { font: 400 .9375rem var(--sans); color: var(--muted); }
.listing-cta { align-self: flex-start; background: none; border: 0; border-bottom: 2px solid var(--forest); padding: 4px 0; font: 600 .9375rem var(--sans); color: var(--forest); cursor: pointer; }
.listing-cta:hover { color: var(--accent); border-color: var(--accent); }
.no-results { padding: 28px; background: var(--sand); }
.listing-note { margin-top: 32px; color: var(--muted); }

/* Services */
.service-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.service { background: var(--cream); padding: 32px 28px; border-top: 3px solid var(--forest); }
.service h3 { font-size: 1.625rem; margin-bottom: 12px; }
.service p { color: var(--muted); }
.service ul { margin: 18px 0 14px; display: grid; gap: 10px; }
.service li { position: relative; padding-left: 22px; font-size: .9375rem; }
.service li::before { content: ''; position: absolute; left: 0; top: .6em; width: 10px; height: 2px; background: var(--moss); }

.service-groups { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; }
.service-group { margin: 0; font-size: .9375rem; color: var(--muted); }
.service-group span { display: inline-block; margin-right: 8px; padding: 2px 10px; background: var(--forest); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.service-brand { margin: 0 0 8px; font-size: .8125rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--moss); }
.service-admin { border-top-color: var(--accent); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 48px; counter-reset: s; }
.steps li { border-top: 1px solid var(--forest); padding-top: 20px; }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: #fff; font-weight: 600; font-size: .9375rem; margin-bottom: 14px; }
.steps h3 { font-size: 1.375rem; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: .9375rem; }

/* Forms */
.valuation { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.form { display: grid; gap: 16px; }
.form h3 { font-size: 1.75rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; font: 400 1rem var(--sans); color: var(--ink); background: #fff; border: 1px solid #aeb4a8; border-radius: var(--radius); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.form-light .field label, .form-light .check { color: #f4f2ec; }
.form-light a { color: #fff; }
.form-status { min-height: 1.5em; font-size: .9375rem; margin: 0; }
.form-status.is-error { color: #a1301a; font-weight: 600; }
.form-light .form-status.is-error { color: #ffd2c4; }

/* Territory */
.territory { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 560px; }
.territory-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.territory-copy { background: var(--sage); padding: clamp(48px, 7vw, 96px) clamp(24px, 7vw, 96px); display: flex; flex-direction: column; justify-content: center; }
.territory-copy p { font-size: 1.125rem; color: #34433a; max-width: 46ch; margin-top: 22px; }
.place-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.place-list li { border: 1px solid var(--forest); padding: 7px 14px; font-size: .9375rem; border-radius: 999px; }

/* FAQ */
.faq { margin-top: 32px; border-top: 1px solid #b9bdb0; }
.faq details { border-bottom: 1px solid #b9bdb0; }
.faq summary { cursor: pointer; padding: 20px 36px 20px 0; font: 500 1.25rem var(--serif); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 16px; font: 400 1.75rem var(--sans); color: var(--moss); }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--muted); padding-bottom: 20px; margin: 0; max-width: 62ch; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact h2 { margin-bottom: 28px; }
.contact-list { display: grid; margin-bottom: 28px; border-top: 1px solid var(--line); }
.contact-list li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list span { font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--moss); font-weight: 600; padding-top: 4px; }
.contact-list a { font-weight: 600; }
.contact-list address { font-style: normal; }
.contact-list small { color: var(--muted); }
.contact .form { background: #fff; border: 1px solid var(--line); padding: clamp(24px, 4vw, 40px); }

.legal p { color: var(--muted); }

/* Scheda annuncio */
body.modal-open { overflow: hidden; }
.detail { width: min(1080px, 100% - 24px); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: var(--radius); background: var(--cream); color: var(--ink); overflow: auto; }
.detail::backdrop { background: rgba(10, 20, 15, .72); }
.detail-inner { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; }
.detail-close { position: absolute; top: 12px; right: 12px; z-index: 2; min-height: 44px; padding: 8px 16px; background: #fff; border: 1px solid var(--forest); border-radius: 999px; font: 600 .9375rem var(--sans); color: var(--forest); cursor: pointer; }
.detail-gallery { background: var(--ink); display: flex; flex-direction: column; }
.detail-gallery > img { width: 100%; height: min(60vh, 560px); object-fit: contain; background: #0e1713; }
.detail-thumbs { display: flex; gap: 6px; padding: 10px; overflow-x: auto; background: #0e1713; }
.detail-thumbs button { flex: none; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; opacity: .75; }
.detail-thumbs button[aria-current="true"] { border-color: #fff; opacity: 1; }
.detail-thumbs img { width: 96px; height: 72px; object-fit: cover; display: block; }
.detail-body { padding: 56px 32px 32px; display: flex; flex-direction: column; gap: 4px; }
.detail-body h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.detail-body .listing-price { margin: 14px 0 12px; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; color: var(--muted); font-size: .9375rem; }
.detail-facts li { background: var(--sand); padding: 4px 10px; border-radius: 999px; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 16px; }
.detail-actions .text-link { margin: 0; }
.detail-actions .text-link::after { content: ' ↗'; }
@media (max-width: 860px) {
  .detail-inner { grid-template-columns: 1fr; }
  .detail-gallery > img { height: 44vh; }
  .detail-body { padding: 24px 20px 28px; }
}

/* Footer */
.site-footer { background: var(--ink); color: #dfe3dc; padding: 40px 0; font-size: .9375rem; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 24px; }
.footer-inner p { margin: 4px 0 0; }
.footer-inner a { color: #fff; }

/* Responsive */
@media (max-width: 1000px) {
  .listing-grid, .service-cols { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .quick-search { grid-template-columns: 1fr 1fr; }
  .qs-field { border-bottom: 1px solid var(--line); }
  .qs-submit { grid-column: 1 / -1; min-height: 56px; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; background: transparent; border: 1px solid var(--forest); border-radius: var(--radius); font: 600 .9375rem var(--sans); color: var(--forest); cursor: pointer; }
  .nav-toggle-bars, .nav-toggle-bars::before { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle-bars::before { content: ''; position: absolute; top: -6px; left: 0; box-shadow: 0 12px 0 currentColor; }
  .site-nav { position: absolute; left: 0; right: 0; top: var(--header-h); background: var(--cream); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 20px; border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-phone { margin-top: 14px; text-align: center; border-bottom: 0; }
  .valuation, .contact, .territory { grid-template-columns: 1fr; }
  .trust-list { grid-template-columns: 1fr; }
  .trust-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  :root { --header-h: 68px; }
  .brand-text small { display: none; }
  .listing-grid, .service-cols, .steps, .form-row { grid-template-columns: 1fr; }
  .hero { min-height: 78vh; }
  .hero-img { object-position: 82% center; }
  .hero-shade { background: linear-gradient(0deg, rgba(10,28,21,.9) 0%, rgba(10,28,21,.55) 50%, rgba(10,28,21,.15) 100%); }
  .hero-content { padding: 72px 0 40px; }
  .quick-search { grid-template-columns: 1fr; }
  .qs-field { border-right: 0; }
  .contact-list li { grid-template-columns: 1fr; gap: 2px; }
  .btn { width: 100%; }
}
