/* ═══════════════════════════════════════════════════
   CASA-ASTE.IT — Stylesheet principale
   Colori brand: #0273FC (blu), #0269C9 (blu scuro), #B4DFFC (blu chiaro)
   ═══════════════════════════════════════════════════ */

:root {
  --blue:       #0273FC;
  --blue-dark:  #0269C9;
  --blue-light: #B4DFFC;
  --blue-ultra: #E6F2FF;
  --text:       #0D1B2A;
  --muted:      #5A7A9A;
  --border:     rgba(2,115,252,0.12);
  --bg-light:   #F5F9FF;
  --white:      #ffffff;
  --radius:     12px;
  --shadow-sm:  0 2px 8px rgba(2,115,252,0.1);
  --shadow-md:  0 8px 24px rgba(2,115,252,0.14);
  --shadow-btn: 0 4px 14px rgba(2,115,252,0.35);
  --nav-h:       75px;  /* altezza barra nav a riposo */
  --nav-h-small: 44px;  /* altezza barra nav ridotta (dopo lo scroll) */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h-small); }
body { font-family: 'DM Sans', sans-serif; color: var(--text); background: var(--white); font-size: 15px; line-height: 1.6; padding-top: var(--nav-h); }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ─── NAV ─────────────────────────────────────────────────── */
.nav {
  /* fixed (non sticky) + body con padding-top: la barra puo' restringersi
     senza cambiare l'altezza della pagina, quindi lo scroll non "rimbalza"
     e non si crea il loop grande/piccolo. */
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  padding: 0 32px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: height .25s ease, box-shadow .25s ease, background .25s ease;
}
.nav.scrolled {
  height: var(--nav-h-small);
  box-shadow: var(--shadow-sm);
  background: rgba(255,255,255,0.98);
}
.nav-logo-img {
  height: 46px;
  width: auto;
  transition: height .25s ease;
}
.nav.scrolled .nav-logo-img { height: 32px; }
.nav-logo { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.logo-casa { color: var(--blue); }
.logo-aste { color: var(--blue-dark); }
.nav-links { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.nav-links a:hover { color: var(--blue); }
.nav-right { display: flex; gap: 10px; }
.nav-mobile-menu { display: contents; }
.btn-nav-ghost {
  font-size: 13px; font-weight: 500; color: var(--blue);
  border: 1.5px solid var(--blue); border-radius: 20px;
  padding: 6px 16px; transition: background .2s;
}
.btn-nav-ghost:hover { background: var(--blue-ultra); }
.btn-nav-solid {
  font-size: 13px; font-weight: 600; color: var(--white);
  background: var(--blue); border: none; border-radius: 20px;
  padding: 7px 18px; box-shadow: var(--shadow-btn);
  transition: transform .15s, box-shadow .15s;
}
.btn-nav-solid:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(2,115,252,.45); }
.nav-burger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }

/* Pallino rosso "hai nuove notifiche" (su Il mio profilo e sul menu mobile) */
.btn-nav-ghost.has-dot, .nav-burger.has-dot { position: relative; }
.btn-nav-ghost.has-dot::after, .nav-burger.has-dot::after {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #E5322D; border: 2px solid #fff; box-sizing: content-box;
}

/* ─── CAMPO ANTI-BOT (honeypot) ──────────────────────────────
   Nascosto per un umano (posizione fuori schermo, non solo
   display:none — alcuni bot ignorano i campi display:none),
   ma presente nel DOM per intercettare i bot che lo compilano. */
.campo-nascosto {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}

/* ─── FILTRO MAPPE (OpenStreetMap) ────────────────────────────
   Ammorbidisce i colori piuttosto saturi/contrastati di OSM di base,
   per un effetto più pulito e uniforme su tutto il sito — senza
   dipendere da un servizio a pagamento/con API key (Carto, MapTiler,
   Stadia oggi la richiedono tutti). Si applica automaticamente a
   qualunque mappa Leaflet del sito, ovunque venga inizializzata. */
.leaflet-tile-pane {
  filter: grayscale(0.15) brightness(1.08) contrast(0.95) saturate(0.85);
}

/* ─── CONTROLLI LEAFLET IN STILE CASASTE ───────────────────────
   A differenza dei tile (immagini raster, filtrabili solo via CSS
   generico), questi sono elementi HTML/CSS puri: li controlliamo
   al 100%, quindi li alliniamo davvero al resto del sito. */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(2,29,80,.16);
  font-family: 'DM Sans', sans-serif;
}
.leaflet-popup-content {
  margin: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.leaflet-popup-content strong {
  font-size: 14px;
  color: var(--text);
}
.leaflet-popup-content a {
  color: var(--blue);
  font-weight: 600;
}
.leaflet-popup-tip { box-shadow: 0 4px 12px rgba(2,29,80,.12); }
.leaflet-container a.leaflet-popup-close-button {
  color: var(--muted);
  font-size: 18px;
  padding: 8px 8px 0 0;
}
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--blue); }

.leaflet-control-zoom { border: none !important; box-shadow: 0 2px 10px rgba(2,29,80,.12); border-radius: 10px !important; overflow: hidden; }
.leaflet-control-zoom a {
  background: var(--white, #fff) !important;
  color: var(--blue) !important;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  border: none !important;
  transition: background .15s;
}
.leaflet-control-zoom a:hover { background: var(--blue-ultra) !important; }
.leaflet-control-attribution {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  background: rgba(255,255,255,.85) !important;
  border-radius: 6px 0 0 0;
}

/* ─── POPUP CON FOTO (mappa risultati ricerca) ────────────────
   Variante "card" del popup standard: niente padding di default,
   la foto arriva fino ai bordi arrotondati del wrapper. */
.map-popup-custom .leaflet-popup-content { margin: 0; width: 200px !important; }
.map-popup-custom .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; }
.map-popup-custom .leaflet-popup-close-button {
  background: rgba(255,255,255,.9) !important;
  border-radius: 50%;
  width: 22px !important; height: 22px !important;
  line-height: 22px !important; text-align: center;
  top: 8px !important; right: 8px !important;
}

.map-popup-img {
  width: 100%; height: 110px; object-fit: cover; display: block;
}
.map-popup-img-placeholder {
  background: var(--blue-ultra); display: flex;
  align-items: center; justify-content: center; font-size: 30px;
}
.map-popup-body { padding: 10px 12px 12px; }
.map-popup-price { font-size: 15px; font-weight: 700; color: var(--blue); }
.map-popup-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
.map-popup-loc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.map-popup-link { display: block; font-size: 12px; font-weight: 700; color: var(--blue); margin-top: 6px; }

/* ─── BOTTONE TORNA SU ───────────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.85);
  transition:
    opacity .45s cubic-bezier(.16,1,.3,1),
    transform .45s cubic-bezier(.16,1,.3,1),
    visibility .45s,
    box-shadow .2s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.back-to-top:hover {
  box-shadow: 0 6px 18px rgba(2,115,252,.45);
  transform: translateY(-2px) scale(1.05);
}
.back-to-top:active {
  transform: translateY(0) scale(.95);
  transition-duration: .1s;
}
@media (max-width: 640px) {
  .back-to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; font-size: 16px; }
}

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  /* overflow-y visibile: il menu dei suggerimenti della ricerca scende oltre il bordo
     dell'hero e con overflow:hidden veniva tagliato. Le decorazioni sono già contenute
     da .hero-geo (overflow:hidden); overflow-x:clip evita scroll orizzontale.
     z-index: il menu resta sopra barra statistiche e sezioni successive (sotto la nav, z 100). */
  position: relative; overflow: visible; overflow-x: clip; z-index: 20;
  background: linear-gradient(135deg, #0050B8 0%, #0273FC 55%, #2E9CFF 100%);
  padding: 56px 32px 0; color: var(--white);
  min-height: 420px;
}
.hero-geo {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.geo-c1 {
  position: absolute; right: -80px; top: -80px;
  width: 340px; height: 340px; border-radius: 50%;
  border: 60px solid rgba(180,223,252,0.12);
}
.geo-c2 {
  position: absolute; right: 120px; top: 40px;
  width: 160px; height: 160px; border-radius: 50%;
  border: 28px solid rgba(255,255,255,0.07);
}
.geo-dots {
  position: absolute; right: 28px; top: 28px;
  width: 180px; height: 200px;
  background-image: radial-gradient(circle, rgba(180,223,252,0.4) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .5;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto; width: 100%;
}
.hero-text { margin-bottom: 28px; max-width: 520px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--blue-light); margin-bottom: 14px;
}
.eyebrow::before { content: ''; width: 20px; height: 2px; background: var(--blue-light); border-radius: 1px; flex-shrink: 0; }
.hero h1 { font-size: 38px; font-weight: 700; line-height: 1.16; margin-bottom: 14px; }
.hero h1 .highlight { color: var(--blue-light); position: relative; }
.hero h1 .highlight::after {
  content: ''; position: absolute; bottom: 2px; left: 0;
  width: 100%; height: 3px; background: rgba(180,223,252,0.45); border-radius: 2px;
}
.hero p { font-size: 15px; font-weight: 300; color: rgba(255,255,255,.82); max-width: 420px; margin-bottom: 28px; line-height: 1.75; }
.hero-actions { display: flex; gap: 14px; align-items: center; margin-bottom: 32px; }
.btn-primary {
  background: var(--white); color: var(--blue); font-weight: 700;
  padding: 13px 26px; border-radius: 26px; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); transition: transform .15s, box-shadow .15s;
  display: inline-block;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.btn-ghost { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,.4); padding-bottom: 1px; }
.btn-ghost:hover { color: var(--white); border-color: var(--white); }

/* ─── SEARCH BOX ──────────────────────────────────────────── */
.search-box {
  background: var(--white); border-radius: 16px 16px 0 0;
  padding: 22px 24px; width: 100%;
  box-shadow: 0 -6px 24px rgba(2,115,252,0.16);
}
.search-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.search-field { display: flex; flex-direction: column; gap: 5px; position: relative; }
.search-field label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.search-field input,
.search-field select {
  border: 1.5px solid #D0E4F8; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: var(--text);
  font-family: 'DM Sans', sans-serif; background: #F7FBFF; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-field input:focus,
.search-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2,115,252,.1); }
/* Safari (Mac/iPhone) disegna i select con lo stile del sistema e ignora padding e altezza:
   si toglie l'aspetto nativo e si fissa la stessa altezza di campo e select */
.search-field input,
.search-field select {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box; height: 40px; line-height: 1.2; margin: 0; width: 100%;
}
.search-field select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235A7A9A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
.btn-search {
  background: var(--blue); color: var(--white); border: none;
  border-radius: 10px; padding: 11px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  box-shadow: var(--shadow-btn); transition: transform .15s;
  white-space: nowrap;
}
.btn-search:hover { transform: translateY(-1px); }

/* ─── AUTOCOMPLETE ────────────────────────────────────────── */
.autocomplete-box {
  position: fixed;          /* fixed invece di absolute: non viene clippato */
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(2,115,252,0.18);
  z-index: 9999;            /* sopra tutto */
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.autocomplete-item {
  padding: 10px 14px; font-size: 13px;
  cursor: pointer; transition: background .1s;
  border-bottom: 1px solid rgba(2,115,252,0.06);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active { background: var(--blue-ultra); color: var(--blue); }
.autocomplete-item strong { color: var(--blue); font-weight: 700; }

/* ─── STATS BAR ───────────────────────────────────────────── */
.stats-bar {
  display: flex;
  background: linear-gradient(180deg, #F0F8FF 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
}
.stat { flex: 1; padding: 18px 20px; text-align: center; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-n { font-size: 24px; font-weight: 700; color: var(--blue); line-height: 1; }
.stat-l { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ─── SECTIONS ────────────────────────────────────────────── */
.section { padding: 48px 32px; }
.section.bg-light { background: var(--bg-light); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
.section-head.centered { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.eyebrow-dark { font-size: 11px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.section h2 { font-size: 22px; font-weight: 700; }
.section-footer { text-align: center; margin-top: 28px; }
.filters { display: flex; gap: 8px; }
.chip {
  font-size: 12px; font-weight: 500; padding: 5px 14px;
  border-radius: 16px; border: 1.5px solid var(--border);
  color: var(--muted); cursor: pointer; background: var(--white);
  font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ─── CARDS ───────────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--white);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(2,115,252,.3); }
.card-link { display: block; color: inherit; }

/* ─── CARD IMMAGINE ───────────────────────────────────────── */
.card-img {
  position: relative; height: 180px; overflow: hidden;
  background: var(--blue-ultra);
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .card-img img { transform: scale(1.06); }

/* Immagine placeholder generativa SVG inline */
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #daeeff 0%, #c2e0ff 100%);
  position: relative; overflow: hidden;
}
.card-img-placeholder::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(2,115,252,0.08) 1px, transparent 1px);
  background-size: 16px 16px;
}
.card-img-placeholder svg { position: relative; z-index: 1; opacity: .7; }

/* Varianti colore placeholder per diversità visiva */
.card-img-placeholder.v1 { background: linear-gradient(135deg, #daeeff 0%, #b4d8ff 100%); }
.card-img-placeholder.v2 { background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); }
.card-img-placeholder.v3 { background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%); }

.card-badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 9px; font-weight: 700; padding: 3px 9px;
  border-radius: 8px; text-transform: uppercase; letter-spacing: .5px;
}
.badge-blue  { background: var(--blue); color: var(--white); box-shadow: 0 2px 8px rgba(2,115,252,.4); }
.badge-green { background: #2e7d32; color: var(--white); }
.badge-amber { background: #e65100; color: var(--white); }

.heart {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.1);
  transition: transform .15s;
}
.heart:hover { transform: scale(1.15); }
.heart.active { color: #e24b4a; }

.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.card-loc { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.card-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.card-price { font-size: 20px; font-weight: 700; color: var(--blue); }
.badge-save { font-size: 10px; font-weight: 700; color: #1B5E20; background: #E8F5E9; padding: 2px 8px; border-radius: 8px; }
.card-meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.card-meta span::before { content: '· '; }
.card-meta span:first-child::before { content: ''; }
.card-udienza { font-size: 11px; color: var(--muted); background: var(--blue-ultra); padding: 5px 8px; border-radius: 6px; }
.card-udienza strong { color: var(--blue); }
.empty-state { text-align: center; padding: 40px; color: var(--muted); }
.btn-outline {
  border: 1.5px solid var(--blue); color: var(--blue); background: var(--white);
  border-radius: 22px; padding: 10px 26px; font-size: 13px; font-weight: 600;
  transition: all .15s; display: inline-block;
}
.btn-outline:hover { background: var(--blue); color: var(--white); }

/* ─── REGISTER BANNER ─────────────────────────────────────── */
.register-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0050B8, #0273FC 60%, #2E9CFF);
  padding: 36px 48px; color: var(--white);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
}
.rb-geo1 { position: absolute; right: 200px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 28px solid rgba(255,255,255,.07); }
.rb-geo2 { position: absolute; right: -20px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.05); }
.rb-content { position: relative; z-index: 1; }
.register-banner h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.register-banner p { font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 14px; }
.rb-features { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--blue-light); font-weight: 500; }
.btn-white {
  position: relative; z-index: 1; flex-shrink: 0;
  background: var(--white); color: var(--blue); font-weight: 700;
  border-radius: 24px; padding: 13px 26px; font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); transition: transform .15s, box-shadow .15s;
  display: inline-block; white-space: nowrap;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* ─── STEPS ───────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; margin-top: 32px; position: relative; }
.steps::before { content: ''; position: absolute; top: 18px; left: 10%; width: 80%; height: 1px; background: linear-gradient(90deg, transparent, rgba(2,115,252,.2), transparent); }
.step { text-align: center; padding: 0 16px; position: relative; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: var(--white); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; box-shadow: 0 4px 12px rgba(2,115,252,.35);
  border: 3px solid var(--white); position: relative; z-index: 1;
}
.step-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 12px; color: var(--muted); line-height: 1.65; }

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer { background: #0A1628; color: rgba(255,255,255,.65); border-top: 3px solid var(--blue); padding: 40px 32px 20px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand .footer-logo { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.footer-brand p { font-size: 12px; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.footer-links strong { color: var(--white); font-size: 12px; margin-bottom: 4px; }
.footer-links a:hover { color: var(--blue-light); }
.footer-bottom { display: flex; justify-content: space-between; font-size: 11px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-mobile-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-md);
    z-index: 50;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height .35s ease, opacity .25s ease, transform .25s ease;
  }
  .nav.nav-open .nav-mobile-menu {
    max-height: 480px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-links, .nav-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
  }
  .nav-right {
    border-top: 1px solid var(--border);
  }
  .nav-burger { display: block; }
  .hero { padding: 36px 20px 0; }
  .hero h1 { font-size: 26px; }
  .search-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; }
  .stat { flex: 1 1 50%; }
  .cards-grid { grid-template-columns: 1fr; }
  .section { padding: 32px 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .register-banner { flex-direction: column; padding: 28px 24px; text-align: center; }
  .rb-features { justify-content: center; }
  .steps { grid-template-columns: 1fr 1fr; gap: 24px; }
  .steps::before { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ─── BREADCRUMB (globale, usato da più pagine) ──────────────── */
.breadcrumb-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 32px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}
.breadcrumb-bar a { color: var(--muted); transition: color .15s; }
.breadcrumb-bar a:hover { color: var(--blue); }
.breadcrumb-bar .current { color: var(--text); font-weight: 500; }
.breadcrumb-bar span { opacity: .4; }
/* ═══════════════════════════════════════════════════
   RISTRUTTURAZIONI — stili aggiuntivi
   Da appendere in fondo a style.css. Riusa le variabili
   di :root già definite (--blue, --radius, --shadow-*, ecc.)
   ═══════════════════════════════════════════════════ */

/* Hero più basso: niente stat da inseguire visivamente, il contenuto è più leggero */
.hero.hero-compact { min-height: 360px; padding-bottom: 0; }

/* ─── GRIGLIA SERVIZI ─────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.service-card {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 22px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.service-card::after {
  content: '↗';
  position: absolute;
  top: 16px; right: 16px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue-ultra);
  color: var(--blue);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity .2s, transform .2s;
}
.service-card:hover::after,
.service-card:focus-visible::after {
  opacity: 1;
  transform: translate(0, 0);
}
.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(2,115,252,.3);
}
.service-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--blue-ultra);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.service-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.service-desc { font-size: 12px; color: var(--muted); line-height: 1.6; flex: 1; }
.service-link {
  align-self: flex-end;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--blue);
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.service-link:hover {
  background: var(--blue-dark, #0269C9);
  transform: translateX(2px);
}

/* ─── FORM RICHIESTA PREVENTIVO ───────────────────────────── */
.form-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.form-grid .form-full { grid-column: 1 / -1; }
.form-card .search-field label { color: var(--muted); }
.form-card textarea {
  border: 1.5px solid #D0E4F8; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: var(--text);
  font-family: 'DM Sans', sans-serif; background: #F7FBFF; outline: none;
  resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.form-card textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2,115,252,.1); }

.form-checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; color: var(--muted); line-height: 1.6;
  margin-bottom: 22px; cursor: pointer;
}
.form-checkbox input { margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; }
.form-checkbox a { color: var(--blue); text-decoration: underline; }

.btn-submit { width: 100%; padding: 13px 22px; font-size: 14px; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 18px; }
}
@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ─── PROMO RISTRUTTURAZIONI (in home) ────────────────────── */
.promo-lavori {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.promo-lavori-icon {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.promo-lavori-text { flex: 1; }
.promo-lavori-text h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.promo-lavori-text p { font-size: 13px; color: var(--muted); max-width: 560px; line-height: 1.6; }
.promo-lavori-btn { flex-shrink: 0; white-space: nowrap; }

@media (max-width: 768px) {
  .promo-lavori { flex-direction: column; text-align: center; padding: 28px 20px; }
}

/* ─── PAGINA LAVORI — FILTRI ──────────────────────────────── */
.lavori-filtri {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.filtro-chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.filtro-chip:hover { border-color: rgba(2,115,252,.4); color: var(--blue); }
.filtro-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.lavori-vuoto {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 40px 0;
}

/* ─── PAGINA LAVORI — GRIGLIA ─────────────────────────────── */
.lavori-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.lavoro-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.lavoro-info { padding: 18px 20px 20px; }
.lavoro-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--blue-ultra);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.lavoro-titolo { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.lavoro-desc { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.lavoro-loc { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ─── SLIDER PRIMA / DOPO ─────────────────────────────────── */
/* --pos è impostata inline e aggiornata da compare-slider.js */
.compare-slider { --pos: 50%; }
.compare-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-light);
  touch-action: pan-y;
  cursor: ew-resize;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.compare-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
/* Il "dopo" sta sopra e viene ritagliato fino a --pos: scorrendo si scopre il "prima" */
.compare-after { clip-path: inset(0 0 0 var(--pos)); }

.compare-label {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  pointer-events: none;
}
.compare-label-prima { left: 12px; }
.compare-label-dopo  { right: 12px; }

.compare-divider {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.35);
  pointer-events: none;
}
.compare-handle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* Il range trasparente resta solo per la tastiera: il drag è gestito da compare-slider.js (Pointer Events) */
.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
/* Focus da tastiera: evidenziamo la maniglia, visto che il range è invisibile */
.compare-range:focus-visible ~ .compare-divider .compare-handle {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .lavori-grid { grid-template-columns: 1fr; }
}

/* ─── PANNELLO GESTIONE LAVORI ────────────────────────────── */
.admin-alert {
  max-width: 760px;
  margin: 0 auto 14px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.admin-alert.ok { background: #E7F7EE; color: #1B7F4B; border: 1px solid #BFE8D2; }
.admin-alert.ko { background: #FDECEC; color: #B3261E; border: 1px solid #F5C4C1; }

.admin-thumb {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

.admin-annulla {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.admin-lista {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-riga {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-riga .admin-thumb { width: 90px; margin-top: 0; flex-shrink: 0; }
.admin-riga-info { flex: 1; min-width: 0; }
.admin-riga-titolo { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.admin-riga-meta { font-size: 12px; color: var(--muted); }
.admin-bozza {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #FFF3DC;
  color: #9A6400;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.admin-riga-azioni { display: flex; gap: 8px; flex-shrink: 0; }
.admin-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.admin-btn:hover { border-color: rgba(2,115,252,.4); }
.admin-btn.ko { color: #B3261E; }
.admin-btn.ko:hover { border-color: rgba(179,38,30,.4); }

@media (max-width: 768px) {
  .admin-riga { flex-wrap: wrap; }
  .admin-riga-info { flex-basis: calc(100% - 106px); }
  .admin-riga-azioni { width: 100%; }
}
/* ─── HERO: movimento leggero delle forme ─── */
.geo-c1  { animation: geoFloat 14s ease-in-out infinite; }
.geo-c2  { animation: geoFloat 11s ease-in-out -3s infinite reverse; }
.geo-dots { animation: geoDrift 9s ease-in-out infinite alternate; }
@keyframes geoFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-14px, 16px); } }
@keyframes geoDrift { from { transform: translate(0,0); } to { transform: translate(-10px, 12px); } }
@media (prefers-reduced-motion: reduce) {
  .geo-c1, .geo-c2, .geo-dots { animation: none !important; }
}