/* =========================================================
   HABITAMI — Sistema di acquisizione, nurturing e conversione
   Palette: Nero #000000 · Oro #A67C18 · Bianco #FFFFFF
   Mobile-first, zero dipendenze esterne
   ========================================================= */

:root {
  --c-black: #000000;
  --c-black-soft: #0B0B0B;
  --c-black-elev: #161616;
  --c-gold: #A67C18;
  --c-gold-light: #D4AF52;
  --c-gold-dim: rgba(166, 124, 24, 0.16);
  --c-white: #FFFFFF;
  --c-ivory: #F7F5F0;
  --c-text-muted: rgba(0, 0, 0, 0.55);
  --c-text-muted-inverse: rgba(255, 255, 255, 0.72);

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-fab: 0 10px 24px rgba(166, 124, 24, 0.45), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-elevated: 0 16px 40px rgba(0,0,0,0.35);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-width: 480px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--c-ivory);
  color: var(--c-black);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input { font-family: inherit; font-size: 1rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
}

/* ---------- Layout helpers ---------- */
main, .hero, .footer { max-width: var(--max-width); margin: 0 auto; }
main { width: 100%; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--c-black);
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

.section-title--light { color: var(--c-white); }

.glass-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(166, 124, 24, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  padding: 1.75rem 1.5rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--c-gold);
  color: var(--c-black);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-full);
  width: 100%;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  box-shadow: 0 8px 20px rgba(166, 124, 24, 0.35);
}

.btn-primary:hover { transform: translateY(-2px); background: var(--c-gold-light); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--c-gold-light);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(212, 175, 82, 0.55);
  border-radius: var(--radius-full);
  width: 100%;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}

.btn-secondary:hover { background: rgba(212, 175, 82, 0.1); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0) scale(0.98); }

/* =========================================================
   HERO + CTA
   ========================================================= */
.hero {
  position: relative;
  background: radial-gradient(120% 90% at 50% -10%, #1a1a1a 0%, var(--c-black) 55%);
  padding: 3.2rem 1.5rem 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(166, 124, 24, 0.35) 0%, rgba(166, 124, 24, 0) 70%);
  pointer-events: none;
}

.hero__logo {
  position: relative;
  z-index: 1;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--c-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  box-shadow: 0 8px 24px rgba(166, 124, 24, 0.4);
}

.hero__logo-mark { font-family: var(--font-display); font-size: 2rem; color: var(--c-black); }

.hero__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--c-white);
  letter-spacing: 0.04em;
}

.hero__subtitle {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  color: var(--c-text-muted-inverse);
  margin-top: 0.5rem;
  max-width: 30ch;
}

.hero__address {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--c-gold-light);
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

.hero__address svg { width: 15px; height: 15px; flex-shrink: 0; }

.cta-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
  width: 100%;
  max-width: 340px;
  background: var(--c-gold);
  color: var(--c-black);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 26px rgba(166, 124, 24, 0.45);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  animation: pulse-glow 2.8s ease-in-out infinite;
}

.cta-main:hover { transform: translateY(-2px); background: var(--c-gold-light); }
.cta-main:active { transform: translateY(0) scale(0.98); }
.cta-main__icon { font-size: 1.15rem; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 10px 26px rgba(166, 124, 24, 0.45); }
  50% { box-shadow: 0 10px 34px rgba(166, 124, 24, 0.7); }
}

@media (prefers-reduced-motion: reduce) { .cta-main { animation: none; } }

/* =========================================================
   LINK LIST
   ========================================================= */
.links {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--c-white);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.05);
  width: 100%;
  text-align: left;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.link-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(166, 124, 24, 0.18);
  background: var(--c-ivory);
}

.link-item:active { transform: translateY(0) scale(0.98); background: var(--c-gold-dim); }

.link-item--accent { border-color: rgba(166, 124, 24, 0.4); }

.link-item__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--c-black);
  color: var(--c-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-item__icon svg { width: 20px; height: 20px; }

.link-item__text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.link-item__title { font-size: 0.95rem; font-weight: 600; color: var(--c-black); }

.link-item__subtitle {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-item__chevron { flex: 0 0 auto; font-size: 1.3rem; color: var(--c-gold); opacity: 0.7; }

/* =========================================================
   FASE 7 — TRUST BUILDERS (counter animati)
   ========================================================= */
.trust { padding: 2rem 1.25rem 0.5rem; }

.trust__grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.trust__stat {
  background: var(--c-white);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.75rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.trust__value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--c-gold);
  font-weight: 700;
  line-height: 1.1;
}

.trust__label {
  font-size: 0.72rem;
  color: var(--c-text-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.01em;
}

/* =========================================================
   GOOGLE REVIEWS PREMIUM
   ========================================================= */
.reviews { background: var(--c-black); padding: 2.5rem 1.25rem; margin-top: 1.75rem; }
.reviews__card { max-width: var(--max-width); margin: 0 auto; text-align: center; }
.reviews__stars { color: var(--c-gold-light); font-size: 1.4rem; letter-spacing: 0.15em; }
.reviews__score { font-family: var(--font-display); color: var(--c-white); font-size: 1.1rem; margin-top: 0.5rem; }
.reviews__score strong { font-size: 1.8rem; color: var(--c-gold-light); }
.reviews__count { font-size: 0.8rem; color: var(--c-text-muted-inverse); margin-top: 0.25rem; }

.reviews__quote {
  margin: 1.5rem 0;
  padding: 1.1rem 1rem;
  border-left: 2px solid var(--c-gold);
  text-align: left;
}

.reviews__quote p { font-family: var(--font-display); font-style: italic; color: var(--c-white); font-size: 0.98rem; line-height: 1.5; }
.reviews__quote cite { display: block; margin-top: 0.5rem; font-style: normal; font-size: 0.78rem; color: var(--c-gold-light); }

/* =========================================================
   IMMOBILI IN EVIDENZA (feed dinamico + skeleton)
   ========================================================= */
.properties { padding: 2.25rem 0 0.5rem; }

.properties__scroller {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 1.25rem 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.properties__scroller::-webkit-scrollbar { height: 5px; }
.properties__scroller::-webkit-scrollbar-thumb { background: rgba(166,124,24,0.4); border-radius: var(--radius-full); }

.property-card {
  flex: 0 0 auto;
  width: 78%;
  max-width: 280px;
  scroll-snap-align: start;
  background: var(--c-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.property-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(166, 124, 24, 0.2); }

.property-card__image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: linear-gradient(135deg, #1a1a1a, #2c2c2c); }
.property-card__body { padding: 1rem 1.1rem 1.2rem; }
.property-card__title { font-family: var(--font-display); font-size: 1.02rem; color: var(--c-black); margin-bottom: 0.2rem; }
.property-card__city { font-size: 0.78rem; color: var(--c-text-muted); margin-bottom: 0.6rem; }
.property-card__price { font-size: 1.05rem; font-weight: 700; color: var(--c-gold); margin-bottom: 0.9rem; }

.property-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem;
  border-radius: var(--radius-full);
  background: var(--c-black);
  color: var(--c-gold-light);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.property-card__btn:hover { background: #1e1e1e; transform: translateY(-1px); }

/* Skeleton loading */
.property-skeleton {
  flex: 0 0 auto;
  width: 78%;
  max-width: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-white);
  border: 1px solid rgba(0,0,0,0.05);
}

.property-skeleton__image { width: 100%; aspect-ratio: 4/3; background: #eee; }
.property-skeleton__line { height: 12px; margin: 0.9rem 1.1rem 0; border-radius: 6px; background: #eee; }
.property-skeleton__line--short { width: 50%; margin-top: 0.6rem; margin-bottom: 1.1rem; }

.property-skeleton__image,
.property-skeleton__line {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .property-skeleton__image, .property-skeleton__line { animation: none; background: #eee; }
}

/* =========================================================
   LEAD MAGNET
   ========================================================= */
.lead-magnet { background: var(--c-black); padding: 2.5rem 1.25rem; margin-top: 1.5rem; }
.lead-magnet__card { max-width: var(--max-width); margin: 0 auto; text-align: center; }
.lead-magnet__icon { font-size: 2.2rem; margin-bottom: 0.5rem; }

.lead-magnet__headline { font-family: var(--font-display); color: var(--c-white); font-size: 1.05rem; line-height: 1.5; margin: 0.5rem 0 1.5rem; }

.lead-form { display: flex; flex-direction: column; gap: 0.75rem; }

.lead-form__input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--c-white);
}

.lead-form__input::placeholder { color: rgba(255,255,255,0.45); }
.lead-form__submit { margin-top: 0.4rem; }
.lead-form__status { min-height: 1.2rem; font-size: 0.85rem; color: var(--c-gold-light); }
.lead-form__privacy { font-size: 0.72rem; color: var(--c-text-muted-inverse); line-height: 1.4; }
.lead-form__privacy a { color: var(--c-gold-light); text-decoration: underline; }

/* =========================================================
   VIDEO PRESENTAZIONE (9:16)
   ========================================================= */
.video-section { padding: 2.25rem 1.25rem 0.5rem; }

.video-frame {
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  background: var(--c-black-elev);
  position: relative;
}

.video-frame__poster { width: 100%; height: 100%; background-size: cover; background-position: center; background-color: var(--c-black-elev); display: flex; align-items: center; justify-content: center; }

.video-frame__play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(166, 124, 24, 0.92);
  color: var(--c-black);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  transition: transform 0.18s var(--ease);
}

.video-frame__play svg { width: 24px; height: 24px; margin-left: 3px; }
.video-frame__play:hover { transform: scale(1.08); }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }

/* =========================================================
   REFERRAL
   ========================================================= */
.referral { background: var(--c-black); padding: 2.5rem 1.25rem 2.75rem; margin-top: 1.5rem; }
.referral__card { max-width: var(--max-width); margin: 0 auto; text-align: center; }
.referral__icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.referral__text { color: var(--c-text-muted-inverse); font-size: 0.92rem; line-height: 1.55; margin: 0.5rem 0 1.5rem; }
.referral__link-label { font-size: 0.75rem; color: var(--c-text-muted-inverse); margin: 1.1rem 0 0.4rem; }

.referral__link-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(212, 175, 82, 0.5);
  color: var(--c-gold-light);
  font-size: 0.8rem;
}

.referral__link-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.referral__link-chip svg { width: 16px; height: 16px; flex-shrink: 0; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { text-align: center; padding: 2rem 1.25rem 6rem; font-size: 0.78rem; color: var(--c-text-muted); line-height: 1.7; }
.footer__brand-line { font-family: var(--font-display); font-size: 0.95rem; color: var(--c-black); margin-bottom: 0.3rem; }
.footer a { color: var(--c-text-muted); text-decoration: underline; text-underline-offset: 2px; }
.footer__legal { display: flex; justify-content: center; gap: 0.5rem; margin: 0.75rem 0; font-size: 0.75rem; }
.footer__social { display: flex; justify-content: center; gap: 0.9rem; margin: 1rem 0 0.5rem; }

.footer__social a {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-black); color: var(--c-gold);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform 0.15s var(--ease);
}

.footer__social svg { width: 16px; height: 16px; }
.footer__social a:hover { transform: translateY(-2px); }
.footer__copy { margin-top: 1rem; }
.footer__powered { color: var(--c-gold); font-weight: 600; text-decoration: none; }

/* =========================================================
   FAB + TOAST
   ========================================================= */
.fab {
  position: fixed; right: 1.25rem; bottom: 1.5rem;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--c-gold); color: var(--c-black);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 50;
  transition: transform 0.15s var(--ease);
}

.fab svg { width: 24px; height: 24px; }
.fab:hover { transform: scale(1.06); }
.fab:active { transform: scale(0.94); }

.toast {
  position: fixed; left: 50%; bottom: 5.5rem;
  transform: translateX(-50%) translateY(12px);
  background: var(--c-black); color: var(--c-white);
  padding: 0.65rem 1.1rem; border-radius: var(--radius-full);
  font-size: 0.82rem; letter-spacing: 0.02em;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 60; max-width: 90vw; text-align: center;
}

.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   FASE 3 + FASE 8 — MODALI (Smart CTA / Exit intent)
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.modal-overlay.is-visible { opacity: 1; pointer-events: auto; }
.modal-overlay[hidden] { display: flex; } /* override per permettere la transizione prima della rimozione */

.modal {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  background: var(--c-black-elev);
  border: 1px solid rgba(166, 124, 24, 0.4);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 2rem 1.5rem 2.25rem;
  transform: translateY(24px);
  transition: transform 0.28s var(--ease);
  box-shadow: 0 -16px 40px rgba(0,0,0,0.5);
}

.modal-overlay.is-visible .modal { transform: translateY(0); }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius-lg); }
}

.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--c-text-muted-inverse);
  width: 32px;
  height: 32px;
}

.modal__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-gold-light);
  margin-bottom: 0.5rem;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--c-white);
  line-height: 1.35;
  margin-bottom: 0.75rem;
  padding-right: 1.5rem;
}

.modal__text { font-size: 0.9rem; color: var(--c-text-muted-inverse); margin-bottom: 1.25rem; }
.modal__actions { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 1rem; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 600px) {
  .hero { padding: 4rem 1.5rem 3rem; }
  .hero__title { font-size: 2.4rem; }
  .property-card { width: 46%; }
  .trust__grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  body { display: flex; justify-content: center; }
}
