/* ============================================================
   CasaFacile — Stili custom (usati insieme a Tailwind CDN)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ---- Variabili colore (palette originale) ---- */
:root {
  --bg:              #faf7f3;
  --fg:              #2a2118;
  --card:            #f5f0ea;
  --primary:         #b04430;
  --primary-fg:      #faf7f3;
  --secondary:       #e6d9c8;
  --muted:           #ebe7e3;
  --muted-fg:        #8c7f78;
  --accent:          #d47e2e;
  --border:          #ddd4c9;
  --destructive:     #dc2626;
  --radius:          0.5rem;
  --hero-overlay:    linear-gradient(to bottom, hsla(20,20%,10%,0.3), hsla(20,20%,10%,0.6));
  --shadow-warm:     0 8px 30px -8px rgba(176,68,48,0.2);
  --shadow-card:     0 4px 20px -4px rgba(42,33,24,0.08);
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(250,247,243,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(221,212,201,0.5);
  height: 64px;
  display: flex;
  align-items: center;
}

/* ---- Hero ---- */
.hero-section {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}

/* ---- Btn primario ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary);
  color: var(--primary-fg);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: background-color .2s, transform .1s;
  text-decoration: none;
  font-weight: 500;
}
.btn-primary:hover { background-color: #963a28; }
.btn-primary:active { transform: scale(0.98); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--primary-fg);
  border: 1.5px solid rgba(250,247,243,0.5);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color .2s;
  text-decoration: none;
}
.btn-outline:hover { background: rgba(250,247,243,0.1); }

/* ---- Card appartamento ---- */
.apt-card {
  background: var(--card);
  border: 1px solid rgba(221,212,201,0.5);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .3s;
  box-shadow: var(--shadow-card);
}
.apt-card:hover {
  box-shadow: 0 12px 40px -8px rgba(42,33,24,0.15);
}
.apt-card img {
  transition: transform 0.5s ease;
}
.apt-card:hover img {
  transform: scale(1.05);
}

/* ---- Badge ---- */
.badge {
  display: inline-block;
  background-color: var(--accent);
  color: var(--primary-fg);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}
.badge-secondary {
  background-color: var(--secondary);
  color: var(--fg);
}

/* ---- Sezione servizi e POI ---- */
.service-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(221,212,201,0.5);
  transition: border-color .2s;
}
.service-card:hover { border-color: rgba(176,68,48,0.3); }
.icon-circle {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(176,68,48,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* ---- Form ---- */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.925rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(176,68,48,0.12);
}
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-fg);
  margin-bottom: 0.3rem;
}

/* ---- Footer ---- */
footer.site-footer {
  background-color: var(--fg);
  color: rgba(250,247,243,0.85);
}

/* ---- WhatsApp button ---- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #25D366;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: background-color .2s;
}
.btn-whatsapp:hover { background-color: #128C7E; }

/* ---- Toast notification ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: 'Source Sans 3', sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: toast-in .25s ease;
  max-width: 360px;
}
.toast-success { background: #16a34a; color: #fff; }
.toast-error   { background: #dc2626; color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Sezione contatti ---- */
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

/* ---- Smooth scroll ---- */
html { scroll-behavior: smooth; }

/* ---- Skeleton loading ---- */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, var(--secondary) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Img lazy placeholder ---- */
img[loading="lazy"] { background: var(--muted); }

/* ---- Admin panel tab ---- */
.admin-tab {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  background: none;
  border-left: none; border-right: none; border-top: none;
  color: var(--muted-fg);
}
.admin-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.admin-tab:hover:not(.active) { color: var(--fg); }
