/* ==========================================================================
   CasaMilano — Agenzia Immobiliare · Design System
   Palette: verde bosco · terracotta · crema — Tipografia: Fraunces + Outfit
   ========================================================================== */

/* ---------- 1. Variabili & reset ---------- */
:root {
  --pine-900: #0c241b;
  --pine-800: #123b2d;
  --pine-700: #1a4d3c;
  --pine-600: #23614d;
  --pine-100: #dcebe3;
  --pine-50: #eef6f1;

  --terra-600: #c65f3a;
  --terra-500: #d9754e;
  --terra-400: #e68f6d;
  --terra-100: #f6e3d9;

  --cream: #f7f3ec;
  --cream-2: #efe8dc;
  --gold: #e8b04b;
  --white: #ffffff;
  --ink: #1c2b26;
  --muted: #5c6f67;
  --line: #e0d8ca;

  --shadow-sm: 0 2px 10px rgba(12, 36, 27, 0.07);
  --shadow-md: 0 12px 34px rgba(12, 36, 27, 0.12);
  --shadow-lg: 0 24px 60px rgba(12, 36, 27, 0.18);

  --radius: 18px;
  --radius-lg: 26px;
  --header-h: 76px;
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Outfit", "Segoe UI", sans-serif;
  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--pine-800); color: var(--white);
  padding: 0.75rem 1.25rem; border-radius: 0 0 12px 0; z-index: 300;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

:focus-visible { outline: 3px solid var(--terra-500); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--gold); color: var(--pine-900); }

/* ---------- 2. Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-gold { background: var(--gold); color: var(--pine-900); box-shadow: 0 8px 22px rgba(232, 176, 75, 0.35); }
.btn-gold:hover { background: #f2c05f; box-shadow: 0 12px 28px rgba(232, 176, 75, 0.45); }

.btn-dark { background: var(--pine-800); color: var(--white); box-shadow: var(--shadow-md); }
.btn-dark:hover { background: var(--pine-700); }

.btn-glass { background: rgba(255, 255, 255, 0.14); color: var(--white); border-color: rgba(255, 255, 255, 0.45); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.24); }

.btn-outline { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.5); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); }

.btn-sm { padding: 0.55rem 1.15rem; font-size: 0.85rem; }
.btn-lg { padding: 1.05rem 2.2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- 3. Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  height: var(--header-h);
  background: rgba(247, 243, 236, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  background: rgba(247, 243, 236, 0.97);
  border-bottom-color: var(--line);
  box-shadow: 0 4px 24px rgba(12, 36, 27, 0.08);
}

.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 1.5rem;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
}

.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--pine-800); color: var(--gold);
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; color: var(--pine-800); }
.brand-name em { font-style: italic; color: var(--terra-600); }
.brand-tag { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.primary-nav { display: flex; gap: 1.7rem; }
.primary-nav a {
  font-size: 0.92rem; font-weight: 500; color: var(--ink);
  position: relative; padding: 0.25rem 0;
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--terra-500);
  transition: width 0.25s ease; border-radius: 2px;
}
.primary-nav a:hover::after, .primary-nav a.is-active::after { width: 100%; }
.primary-nav a.is-active { color: var(--terra-600); }

.header-actions { display: flex; align-items: center; gap: 0.85rem; }

.fav-badge {
  position: relative;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white);
  color: var(--pine-800);
  display: grid; place-items: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.fav-badge:hover { background: var(--terra-100); color: var(--terra-600); transform: scale(1.05); }
.fav-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 19px; height: 19px; padding: 0 4px;
  border-radius: 999px;
  background: var(--terra-600); color: var(--white);
  font-size: 0.68rem; font-weight: 700;
  display: grid; place-items: center;
  transition: transform 0.2s ease;
}
.fav-count.is-pop { animation: pop 0.35s ease; }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.lang-toggle {
  border: 1px solid var(--line); background: var(--white);
  color: var(--pine-800); font-weight: 700; font-size: 0.8rem;
  width: 42px; height: 42px; border-radius: 50%;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-toggle:hover { background: var(--pine-800); color: var(--white); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px; border: none; background: transparent;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2.5px; border-radius: 2px;
  background: var(--pine-800);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 190;
  background: var(--cream);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  overflow-y: auto;
}
.mobile-menu.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.35rem; }
.mobile-menu nav a { padding: 0.8rem 0.4rem; font-size: 1.15rem; font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-lang { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; color: var(--muted); }
.mobile-lang button {
  border: 1px solid var(--line); background: var(--white); color: var(--pine-800);
  padding: 0.55rem 1rem; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
}

/* ---------- 4. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 5rem;
  overflow: hidden;
  color: var(--white);
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, rgba(12, 36, 27, 0.92) 0%, rgba(18, 59, 45, 0.78) 45%, rgba(12, 36, 27, 0.45) 100%);
}

.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 4rem; align-items: center;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}
.hero-eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--gold); border-radius: 2px; }

.hero-title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2.6rem, 5.4vw, 4.3rem);
  line-height: 1.06;
  margin-bottom: 1.4rem;
}
.hero-title em { font-style: italic; color: var(--gold); }

.hero-sub {
  font-size: 1.12rem; font-weight: 300; color: rgba(255, 255, 255, 0.88);
  max-width: 30rem; margin-bottom: 2rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.4rem; }

.hero-badges { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.hero-badges li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 400; color: rgba(255, 255, 255, 0.9); }
.hero-badges span[aria-hidden] { color: var(--gold); font-size: 1rem; }

/* Barra di ricerca */
.hero-search-wrap { position: relative; z-index: 5; }
.search-card {
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.search-head {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; color: var(--pine-800);
  margin-bottom: 1.2rem;
}
.search-icon { color: var(--terra-600); display: grid; place-items: center; }

.search-purpose {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
  background: var(--cream-2); border-radius: 999px; padding: 0.3rem;
  margin-bottom: 1.2rem;
}
.sp-tab {
  border: none; background: transparent; color: var(--muted);
  padding: 0.55rem 0.5rem; border-radius: 999px;
  font-weight: 600; font-size: 0.88rem;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.sp-tab.is-active { background: var(--pine-800); color: var(--white); box-shadow: var(--shadow-sm); }

.search-fields { display: grid; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field select, .field input, .field textarea {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--white); color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
.field select:focus, .field input:focus, .field textarea:focus {
  outline: none; border-color: var(--terra-500);
  box-shadow: 0 0 0 3px rgba(214, 111, 58, 0.15);
}
.search-btn { margin-top: 0.2rem; }

.search-note { text-align: center; font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); margin-top: 1rem; }

.scroll-hint {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  display: flex; justify-content: center;
  width: 26px; height: 42px;
}
.scroll-line {
  width: 2px; height: 100%; background: rgba(255, 255, 255, 0.5);
  border-radius: 2px; position: relative; overflow: hidden;
}
.scroll-line::after {
  content: ""; position: absolute; top: -40%; left: 0; width: 100%; height: 40%;
  background: var(--gold); border-radius: 2px;
  animation: scroll-drip 2.2s ease-in-out infinite;
}
@keyframes scroll-drip { 0% { top: -40%; } 100% { top: 110%; } }

/* ---------- 5. Stats ---------- */
.stats-band { background: var(--pine-800); color: var(--white); padding: 3.2rem 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; }
.stat-value {
  font-family: var(--font-serif); font-size: clamp(2rem, 3.6vw, 2.8rem); font-weight: 600;
  color: var(--gold); display: block; line-height: 1.1; margin-bottom: 0.3rem;
}
.stat-star { font-size: 1.4rem; vertical-align: middle; margin-left: 0.2rem; }
.stat-label { font-size: 0.9rem; font-weight: 300; color: rgba(255, 255, 255, 0.85); }

/* ---------- 6. Sezioni generali ---------- */
.section { padding: 6.5rem 0; }

.section-head { max-width: 46rem; margin-bottom: 3.5rem; }
.section-head.left { margin-left: 0; }

.section-number {
  font-family: var(--font-serif); font-size: 0.85rem; font-style: italic;
  color: var(--terra-600); display: block; margin-bottom: 0.5rem;
}
.section-number.light { color: var(--terra-400); }

.section-script {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--terra-600); margin-bottom: 0.7rem;
}
.section-title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.12; color: var(--pine-800);
  margin-bottom: 1.1rem;
}
.section-sub { color: var(--muted); font-size: 1.02rem; max-width: 40rem; }

.divider { display: block; width: 64px; height: 3px; background: var(--gold); border-radius: 3px; margin-bottom: 1.3rem; position: relative; }
.divider i { position: absolute; left: 0; top: 0; width: 26px; height: 3px; background: var(--terra-500); border-radius: 3px; }

.dark { background: var(--pine-800); color: var(--white); }
.dark .section-title { color: var(--white); }
.dark .section-sub { color: rgba(255, 255, 255, 0.75); }

/* ---------- 7. Listings ---------- */
.list-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  flex-wrap: wrap; margin-bottom: 2.4rem;
}
.list-tabs {
  display: flex; gap: 0.35rem;
  background: var(--cream-2); border-radius: 999px; padding: 0.3rem;
}
.lt-tab {
  border: none; background: transparent; color: var(--muted);
  padding: 0.55rem 1.15rem; border-radius: 999px;
  font-weight: 600; font-size: 0.88rem;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.lt-tab.is-active { background: var(--pine-800); color: var(--white); box-shadow: var(--shadow-sm); }

.list-sort { display: flex; align-items: center; gap: 0.6rem; }
.list-sort label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.list-sort select {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 0.5rem 0.8rem;
  background: var(--white); color: var(--ink);
}

.fav-only {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--white);
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  cursor: pointer; user-select: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.fav-only:hover { border-color: var(--terra-400); color: var(--terra-600); }
.fav-only:has(input:checked) {
  border-color: var(--terra-500); background: var(--terra-100); color: var(--terra-600);
}
.fav-only input {
  width: 16px; height: 16px; accent-color: var(--terra-600); cursor: pointer;
}

.list-count { font-size: 0.88rem; color: var(--muted); font-weight: 500; }

.prop-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.8rem;
}

.prop-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(224, 216, 202, 0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}
.prop-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.prop-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.prop-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.prop-card:hover .prop-media img { transform: scale(1.07); }

.prop-badge {
  position: absolute; top: 0.9rem; left: 0.9rem; z-index: 2;
  padding: 0.32rem 0.8rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--white);
}
.prop-badge.new { background: var(--terra-600); }
.prop-badge.exclusive { background: var(--pine-800); }

.prop-fav {
  position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.92);
  color: var(--pine-800);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.prop-fav:hover { transform: scale(1.12); }
.prop-fav.is-saved { background: var(--terra-600); color: var(--white); }
.prop-fav svg { pointer-events: none; }

.prop-price-tag {
  position: absolute; bottom: 0.9rem; left: 0.9rem; z-index: 2;
  background: rgba(12, 36, 27, 0.88); color: var(--gold);
  padding: 0.42rem 0.95rem; border-radius: 12px;
  font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem;
  backdrop-filter: blur(4px);
}

.prop-body { padding: 1.3rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }
.prop-zone { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--terra-600); }
.prop-name { font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; color: var(--pine-800); line-height: 1.25; }
.prop-address { font-size: 0.88rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; }
.prop-address svg { flex-shrink: 0; }

.prop-specs {
  display: flex; gap: 1.1rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
.prop-spec { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.prop-spec strong { color: var(--ink); font-weight: 600; }
.prop-spec svg { color: var(--terra-600); flex-shrink: 0; }

.prop-actions { display: flex; gap: 0.6rem; margin-top: auto; }
.prop-actions .btn { flex: 1; padding: 0.62rem 0.6rem; font-size: 0.86rem; }

.list-empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.list-empty > span { font-size: 3rem; color: var(--terra-400); display: block; margin-bottom: 0.8rem; }
.list-empty h3 { font-family: var(--font-serif); color: var(--pine-800); font-size: 1.4rem; margin-bottom: 0.4rem; }

/* ---------- 8. Spotlight ---------- */
.spot-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 4rem; align-items: center; }
.spot-media { display: flex; flex-direction: column; gap: 0.9rem; }
.spot-main { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow-lg); }
.spot-main img { width: 100%; height: 100%; object-fit: cover; }
.spot-thumbs { display: flex; gap: 0.7rem; overflow-x: auto; padding-bottom: 0.25rem; }
.spot-thumb {
  width: 88px; height: 62px; border-radius: 12px; overflow: hidden;
  border: 2.5px solid transparent; padding: 0; background: none;
  opacity: 0.75; transition: opacity 0.2s ease, border-color 0.2s ease;
}
.spot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.spot-thumb.is-active { border-color: var(--gold); opacity: 1; }

.spot-desc { color: rgba(255, 255, 255, 0.85); font-size: 1.02rem; margin-bottom: 1.4rem; }
.spot-meta { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.spot-meta li { font-size: 0.92rem; color: rgba(255, 255, 255, 0.8); }
.spot-meta strong { display: block; font-family: var(--font-serif); font-size: 1.25rem; color: var(--gold); font-weight: 600; }
.spot-meta span { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }

.spot-price {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 600; color: var(--gold);
  margin-bottom: 1.6rem;
}
.spot-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- 9. Quartieri ---------- */
.zone-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2rem; }
.zone-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 3 / 4;
  display: flex; align-items: flex-end;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.zone-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.zone-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.zone-card:hover img { transform: scale(1.08); }
.zone-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12, 36, 27, 0.92) 0%, rgba(12, 36, 27, 0.25) 55%, transparent 100%);
}
.zone-body { position: relative; z-index: 2; padding: 1.2rem; width: 100%; color: var(--white); }
.zone-name { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; margin-bottom: 0.15rem; }
.zone-price { font-size: 0.85rem; color: var(--gold); font-weight: 600; }
.zone-price small { color: rgba(255, 255, 255, 0.7); font-weight: 400; }
.zone-listings { font-size: 0.78rem; color: rgba(255, 255, 255, 0.75); }

/* ---------- 10. Servizi ---------- */
.serv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.serv-card {
  background: var(--white);
  border: 1px solid rgba(224, 216, 202, 0.6);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative; overflow: hidden;
}
.serv-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--terra-400); }
.serv-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--terra-500), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
.serv-card:hover::before { transform: scaleX(1); }

.serv-icon {
  width: 54px; height: 54px; border-radius: 16px;
  background: var(--pine-50); color: var(--pine-700);
  display: grid; place-items: center;
  margin-bottom: 1.2rem;
  transition: background 0.3s ease, color 0.3s ease;
}
.serv-card:hover .serv-icon { background: var(--terra-600); color: var(--white); }
.serv-card h3 { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; color: var(--pine-800); margin-bottom: 0.6rem; }
.serv-card p { font-size: 0.92rem; color: var(--muted); }

/* ---------- 11. Agenzia ---------- */
.agency-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4.5rem; align-items: center; }
.agency-media { position: relative; }
.agency-img-main { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3.4; box-shadow: var(--shadow-md); }
.agency-img-main img { width: 100%; height: 100%; object-fit: cover; }
.agency-img-small {
  position: absolute; right: -2.2rem; bottom: -2.5rem;
  width: 46%; border-radius: var(--radius);
  overflow: hidden; border: 6px solid var(--cream);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
}
.agency-img-small img { width: 100%; height: 100%; object-fit: cover; }

.agency-text > p { color: var(--muted); margin-bottom: 1.1rem; }
.ag-quote {
  font-family: var(--font-serif); font-style: italic; font-size: 1.18rem;
  color: var(--pine-800) !important; border-left: 3px solid var(--gold);
  padding-left: 1.1rem; margin: 1.5rem 0 0.4rem;
}
.ag-signature { font-family: var(--font-serif); font-size: 1rem; color: var(--terra-600); margin-bottom: 1.6rem; font-style: italic; }

/* ---------- 12. Recensioni ---------- */
.rev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.rev-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem;
  display: flex; flex-direction: column; gap: 1rem;
  transition: background 0.3s ease, transform 0.3s ease;
}
.rev-card:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-4px); }
.rev-stars { color: var(--gold); letter-spacing: 0.15em; font-size: 0.95rem; }
.rev-text { color: rgba(255, 255, 255, 0.88); font-size: 0.95rem; font-style: italic; flex: 1; }
.rev-author { display: flex; align-items: center; gap: 0.8rem; }
.rev-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--terra-600); color: var(--white);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}
.rev-author strong { display: block; font-size: 0.95rem; }
.rev-author small { color: rgba(255, 255, 255, 0.6); font-size: 0.8rem; }

/* ---------- 13. Mutuo ---------- */
.mortgage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4.5rem; align-items: center; }
.mortgage-text > p { color: var(--muted); margin-bottom: 1.4rem; }
.mortgage-tips { margin-bottom: 1.8rem; }
.mortgage-tips li { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.6rem; color: var(--ink); font-size: 0.95rem; }
.mortgage-tips li span[aria-hidden] { color: var(--terra-600); font-weight: 700; }

.mortgage-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(224, 216, 202, 0.6);
  display: flex; flex-direction: column; gap: 1.4rem;
}
.mc-row { display: flex; flex-direction: column; gap: 0.5rem; }
.mc-row label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.mc-row output {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; color: var(--pine-800);
}
.mc-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--cream-2); outline: none;
}
.mc-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--terra-600); border: 4px solid var(--white);
  box-shadow: 0 2px 8px rgba(12, 36, 27, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.mc-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.mc-row input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--terra-600); border: 4px solid var(--white);
  box-shadow: 0 2px 8px rgba(12, 36, 27, 0.3);
  cursor: pointer;
}
.mc-row input[type="range"]::-moz-range-track { background: var(--cream-2); height: 6px; border-radius: 3px; }

.mc-result {
  background: var(--pine-50);
  border: 1px solid var(--pine-100);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.9rem;
}
.mc-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.95rem; color: var(--muted); }
.mc-line strong { font-weight: 600; color: var(--pine-800); }
.mc-total strong {
  font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; color: var(--terra-600);
}
.mc-note { font-size: 0.78rem; color: var(--muted); }

/* ---------- 14. Contatti ---------- */
.contact-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 3.5rem; align-items: start; }
.contact-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.contact-card {
  background: var(--white);
  border: 1px solid rgba(224, 216, 202, 0.6);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.contact-icon { display: block; color: var(--terra-600); font-size: 1.3rem; margin-bottom: 0.6rem; }
.contact-card h3 { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: var(--pine-800); margin-bottom: 0.4rem; }
.contact-card p { font-size: 0.9rem; color: var(--muted); }
.contact-card a { color: var(--pine-700); font-weight: 500; }
.contact-card a:hover { color: var(--terra-600); text-decoration: underline; }

.socials { display: flex; gap: 0.6rem; }
.socials a {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--cream);
  display: grid; place-items: center; color: var(--pine-800);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.socials a:hover { background: var(--pine-800); color: var(--gold); transform: translateY(-3px); }

.map-wrap { grid-column: 1 / -1; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid rgba(224, 216, 202, 0.6); }
.map-wrap iframe { width: 100%; height: 220px; border: 0; display: block; }

.contact-form {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.4rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(224, 216, 202, 0.6);
  display: flex; flex-direction: column; gap: 1.2rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

.field-error { display: none; font-size: 0.8rem; color: #c0392b; font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c0392b; }
.field.has-error .field-error { display: block; }

.privacy { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.privacy input { width: 18px; height: 18px; margin-top: 0.2rem; accent-color: var(--terra-600); flex-shrink: 0; }
.privacy-error { display: none; }
.privacy-error.show { display: block; }

.form-note { font-size: 0.8rem; color: var(--muted); text-align: center; }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(12, 36, 27, 0.25); border-top-color: var(--pine-800);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 15. Footer ---------- */
.site-footer { padding: 4.5rem 0 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 0.8fr 0.9fr 0.9fr;
  gap: 3rem; padding-bottom: 3.5rem;
}
.footer-brand .brand-name { color: var(--white); }
.footer-brand .brand-tag { color: rgba(255, 255, 255, 0.55); }
.footer-brand p { margin-top: 1.1rem; font-size: 0.92rem; color: rgba(255, 255, 255, 0.7); max-width: 24rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col h3 { font-family: var(--font-serif); font-size: 1.05rem; color: var(--gold); margin-bottom: 0.6rem; }
.footer-col a { font-size: 0.92rem; color: rgba(255, 255, 255, 0.75); transition: color 0.2s ease, transform 0.2s ease; width: fit-content; }
.footer-col a:hover { color: var(--white); transform: translateX(3px); }
.footer-col p { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); }
.footer-col a[href^="tel"], .footer-col a[href^="mailto"] { color: rgba(255, 255, 255, 0.85); font-weight: 500; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.4rem 1.5rem;
  font-size: 0.82rem; color: rgba(255, 255, 255, 0.55);
}

/* ---------- 16. Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(12, 36, 27, 0.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fade-in 0.25s ease;
}
.modal[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--cream);
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 2.2rem;
  position: relative;
  animation: slide-up 0.3s ease;
  box-shadow: var(--shadow-lg);
}
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white);
  color: var(--pine-800); font-size: 1rem;
  display: grid; place-items: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { background: var(--terra-600); color: var(--white); transform: rotate(90deg); }

.prop-modal-card { max-width: 720px; padding: 0; overflow: hidden; }
.pm-gallery { position: relative; }
.pm-main { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pm-thumbs { display: flex; gap: 0.6rem; padding: 0.9rem 1.2rem; background: var(--white); overflow-x: auto; }
.pm-thumb {
  width: 84px; height: 58px; border-radius: 10px; overflow: hidden;
  border: 2.5px solid transparent; padding: 0; background: none; flex-shrink: 0;
  opacity: 0.75; transition: opacity 0.2s ease, border-color 0.2s ease;
}
.pm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm-thumb.is-active { border-color: var(--terra-600); opacity: 1; }

.pm-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.4rem 1.6rem 0.4rem;
}
.pm-badge {
  display: inline-block; padding: 0.26rem 0.7rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--white); margin-bottom: 0.5rem;
}
.pm-badge.new { background: var(--terra-600); }
.pm-badge.exclusive { background: var(--pine-800); }
.pm-head h3 { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; color: var(--pine-800); }
.pm-address { font-size: 0.9rem; color: var(--muted); margin-top: 0.2rem; }
.pm-price {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; color: var(--terra-600);
  white-space: nowrap;
}
.pm-meta {
  display: flex; gap: 0.9rem; flex-wrap: wrap;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid var(--line);
}
.pm-meta li {
  flex: 1; min-width: 90px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.6rem 0.8rem; text-align: center;
}
.pm-meta strong { display: block; font-family: var(--font-serif); font-size: 1.05rem; color: var(--pine-800); }
.pm-meta span { font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pm-desc { padding: 0.2rem 1.6rem 0.8rem; font-size: 0.95rem; color: var(--muted); }
.pm-features-title {
  padding: 0.4rem 1.6rem 0; font-family: var(--font-serif); font-size: 1.05rem;
  color: var(--pine-800); font-weight: 600;
}
.pm-features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding: 0.8rem 1.6rem 1.4rem;
}
.pm-features li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; color: var(--ink); }
.pm-features li::before { content: "✓"; color: var(--terra-600); font-weight: 700; }
.pm-actions { padding: 0 1.6rem 1.6rem; }

.modal-check { display: grid; place-items: center; margin-bottom: 1rem; }
.modal-check svg circle { stroke: #27ae60; stroke-width: 2; stroke-dasharray: 166; stroke-dashoffset: 166; animation: dash 0.6s ease forwards; }
.modal-check svg path { stroke: #27ae60; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: dash 0.5s 0.5s ease forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }

.modal-card h3 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--pine-800); text-align: center; }
.modal-text { text-align: center; color: var(--muted); font-size: 0.95rem; margin: 0.6rem 0 1.2rem; }
.modal-code-label { text-align: center; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.modal-code {
  text-align: center; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600;
  color: var(--terra-600); margin: 0.2rem 0 1.2rem;
}
.modal-summary { margin: 0 0 1.4rem; }
.modal-summary div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
.modal-summary dt { color: var(--muted); }
.modal-summary dd { font-weight: 600; color: var(--pine-800); text-align: right; }

/* ---------- 17. Toast ---------- */
.toast {
  position: fixed; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  z-index: 500;
  background: var(--pine-800); color: var(--white);
  padding: 0.85rem 1.5rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(232, 176, 75, 0.4);
  animation: toast-in 0.3s ease;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- 18. Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-reveal-delay="1"] { transition-delay: 0.1s; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.2s; }
.reveal[data-reveal-delay="3"] { transition-delay: 0.3s; }

/* ---------- 19. Responsive ---------- */
@media (max-width: 1080px) {
  .prop-grid { grid-template-columns: repeat(2, 1fr); }
  .zone-grid { grid-template-columns: repeat(3, 1fr); }
  .zone-card { aspect-ratio: 4 / 3.2; }
  .serv-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .primary-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }

  .hero { padding-top: calc(var(--header-h) + 2.5rem); }
  .hero-grid { grid-template-columns: 1fr; gap: 2.8rem; }
  .hero-title { font-size: clamp(2.3rem, 8vw, 3.2rem); }
  .hero-sub { max-width: 100%; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }

  .spot-grid, .agency-grid, .mortgage-grid { grid-template-columns: 1fr; gap: 3rem; }
  .agency-img-small { right: 0.5rem; }

  .contact-grid { grid-template-columns: 1fr; }
  .contact-info { grid-template-columns: 1fr 1fr; }

  .rev-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .prop-grid { grid-template-columns: 1fr; }
  .zone-grid { grid-template-columns: 1fr 1fr; gap: 0.9rem; }
  .serv-grid { grid-template-columns: 1fr; }
  .contact-info { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-badges { gap: 1rem; flex-direction: column; }
  .list-toolbar { justify-content: center; text-align: center; }
  .stats-grid { gap: 1.2rem; }
  .pm-features { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
