/* EBAM Imóveis — Design System CSS (faithful to Lovable approved design) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* EBAM Brand — Warm gold + deep navy */
  --background: 40 20% 98%;
  --foreground: 220 25% 12%;
  --card: 0 0% 100%;
  --card-foreground: 220 25% 12%;
  --primary: 215 35% 18%;
  --primary-foreground: 40 30% 95%;
  --secondary: 40 15% 94%;
  --secondary-foreground: 220 25% 12%;
  --muted: 40 10% 94%;
  --muted-foreground: 220 10% 46%;
  --accent: 40 15% 94%;
  --destructive: 0 72% 51%;
  --border: 40 12% 88%;
  --input: 40 12% 88%;
  --ring: 215 35% 18%;
  --radius: 0.5rem;

  /* EBAM custom tokens */
  --gold: 42 76% 52%;
  --gold-light: 42 60% 70%;
  --gold-dark: 42 80% 38%;
  --gold-muted: 42 30% 90%;
  --navy: 215 35% 18%;
  --navy-light: 215 25% 30%;
  --navy-muted: 215 15% 50%;
  --caixa-blue: 200 80% 42%;
  --caixa-blue-light: 195 70% 50%;
  --caixa-teal: 175 55% 45%;
  --success: 152 60% 40%;
  --warning: 38 92% 50%;
  --info: 205 80% 50%;
}

* { box-sizing: border-box; margin: 0; padding: 0; border-color: hsl(var(--border)); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; overflow-wrap: break-word; }

/* ── Utility classes ── */
.font-display { font-family: 'Playfair Display', Georgia, serif; }
.font-body { font-family: 'Inter', system-ui, sans-serif; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }

/* ── Color utilities ── */
.text-gold { color: hsl(var(--gold)); }
.text-gold-dark { color: hsl(var(--gold-dark)); }
.text-navy { color: hsl(var(--navy)); }
.text-caixa-blue { color: hsl(var(--caixa-blue)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-success { color: hsl(var(--success)); }

.bg-navy { background-color: hsl(var(--navy)); }
.bg-gold { background-color: hsl(var(--gold)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-background { background-color: hsl(var(--background)); }
.bg-gold-muted { background-color: hsl(var(--gold-muted)); }

.bg-caixa-gradient { background: linear-gradient(135deg, hsl(var(--caixa-blue)) 0%, hsl(var(--caixa-teal)) 100%); }
.bg-gold-gradient { background: linear-gradient(135deg, hsl(var(--gold-dark)) 0%, hsl(var(--gold)) 50%, hsl(var(--gold-light)) 100%); }
.bg-navy-gradient { background: linear-gradient(160deg, hsl(var(--navy)) 0%, hsl(var(--navy-light)) 100%); }

/* ── Shadow system ── */
.shadow-card { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 4px 16px -2px rgb(0 0 0 / 0.06); }
.shadow-card-hover { box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.08), 0 8px 32px -4px rgb(0 0 0 / 0.1); }
.shadow-elevated { box-shadow: 0 8px 24px -4px rgb(0 0 0 / 0.1), 0 16px 48px -8px rgb(0 0 0 / 0.08); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  font-family: 'Inter', system-ui, sans-serif; font-weight: 600; font-size: 0.875rem;
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  padding: 0.5rem 1.25rem; height: 2.5rem; line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 2rem; padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn-lg { height: 2.75rem; padding: 0.625rem 1.5rem; font-size: 0.9375rem; }
.btn-xl { height: 3rem; padding: 0.75rem 2rem; font-size: 1rem; }

.btn-gold {
  background: linear-gradient(135deg, hsl(var(--gold-dark)), hsl(var(--gold)), hsl(var(--gold-light)));
  color: #fff; border-color: hsl(var(--gold-dark));
}
.btn-gold:hover { filter: brightness(1.08); }

.btn-caixa {
  background: linear-gradient(135deg, hsl(var(--caixa-blue)), hsl(var(--caixa-teal)));
  color: #fff;
}
.btn-caixa:hover { filter: brightness(1.08); }

.btn-whatsapp {
  background-color: hsl(142, 70%, 42%); color: #fff;
}
.btn-whatsapp:hover { background-color: hsl(142, 70%, 36%); }

.btn-outline {
  background: transparent; color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover { background: hsl(var(--secondary)); }

.btn-outline-gold {
  background: transparent; color: hsl(var(--gold-dark));
  border-color: hsl(var(--gold)); 
}
.btn-outline-gold:hover { background: hsl(var(--gold-muted)); }

.btn-ghost { background: transparent; color: hsl(var(--foreground)); border-color: transparent; }
.btn-ghost:hover { background: hsl(var(--secondary)); }

/* ── Property Cards ── */
.property-card {
  background: hsl(var(--card)); border-radius: 0.5rem; overflow: hidden;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 4px 16px -2px rgb(0 0 0 / 0.06);
  transition: box-shadow 0.3s, transform 0.3s; display: flex; flex-direction: column;
}
.property-card:hover {
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.08), 0 8px 32px -4px rgb(0 0 0 / 0.1);
  transform: translateY(-4px);
}
.property-card .card-image {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
}
.property-card .card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s;
}
.property-card:hover .card-image img { transform: scale(1.05); }

.property-card .card-badges {
  position: absolute; top: 0.75rem; left: 0.75rem;
  display: flex; flex-wrap: wrap; gap: 0.375rem;
}
.badge-discount {
  background: hsl(var(--destructive)); color: #fff;
  font-size: 0.75rem; font-weight: 700; font-family: 'Inter', sans-serif;
  padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}
.badge-modality {
  background: hsl(var(--caixa-blue)); color: #fff;
  font-size: 0.75rem; font-weight: 600; font-family: 'Inter', sans-serif;
  padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}
.badge-generic {
  background: hsl(var(--navy) / 0.8); color: #fff;
  font-size: 0.75rem; font-family: 'Inter', sans-serif;
  padding: 0.125rem 0.5rem; border-radius: 0.25rem;
}
.badge-financing {
  font-size: 10px; font-weight: 600; font-family: 'Inter', sans-serif;
  padding: 0.125rem 0.375rem; border-radius: 0.25rem; color: #fff;
}
.badge-financing.financiavel { background: hsl(var(--success)); }
.badge-financing.fgts { background: hsl(var(--info)); }

.card-favorite {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: hsl(var(--card) / 0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; transition: background 0.2s;
  font-size: 1rem;
}
.card-favorite:hover { background: hsl(var(--card)); }

.card-financing-tags {
  position: absolute; bottom: 0.75rem; left: 0.75rem;
  display: flex; gap: 0.375rem;
}

.card-content { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.card-content .card-location {
  display: flex; align-items: center; gap: 0.375rem;
  font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.375rem;
}
.card-content .card-title {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.875rem;
  color: hsl(var(--foreground)); line-height: 1.4; margin-bottom: 0.375rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-content .card-hdn {
  font-size: 10px; color: hsl(var(--muted-foreground)); font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums; margin-bottom: 0.25rem;
}
.card-content .card-endereco {
  font-size: 10px; color: hsl(var(--muted-foreground) / 0.7); font-family: 'Inter', sans-serif;
  margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-specs {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin-bottom: 0.75rem;
}
.card-specs span { display: flex; align-items: center; gap: 0.25rem; }

.card-price {
  margin-top: auto; padding-top: 0.75rem; border-top: 1px solid hsl(var(--border));
}
.card-price .original {
  font-size: 0.75rem; color: hsl(var(--muted-foreground));
  text-decoration: line-through; font-variant-numeric: tabular-nums;
}
.card-price .current {
  font-size: 1.125rem; font-weight: 700; color: hsl(var(--navy));
  font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums;
}

/* ── Forms ── */
.form-input, .form-select {
  width: 100%; height: 2.5rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--input)); background: hsl(var(--background));
  padding: 0 0.75rem; font-size: 0.875rem; font-family: 'Inter', sans-serif;
  outline: none; transition: box-shadow 0.2s;
}
.form-input:focus, .form-select:focus {
  box-shadow: 0 0 0 2px hsl(var(--gold) / 0.3);
}
.form-label {
  display: block; font-size: 0.75rem; font-weight: 500;
  font-family: 'Inter', sans-serif; color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0; transform: translateY(16px); filter: blur(4px);
  transition: opacity 600ms cubic-bezier(0.16,1,0.3,1),
              transform 600ms cubic-bezier(0.16,1,0.3,1),
              filter 600ms cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--muted)); }
::-webkit-scrollbar-thumb { background: hsl(var(--navy-muted)); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--navy)); }

/* ── LIA Chat ── */
#lia-chat { animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1); }
@keyframes slideUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
#lia-messages::-webkit-scrollbar { width: 4px; }
#lia-messages::-webkit-scrollbar-track { background: transparent; }
#lia-messages::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 2px; }

.lia-pulse { animation: liaPulse 2s ease-in-out infinite; }
@keyframes liaPulse {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--gold) / 0.4); }
  50% { box-shadow: 0 0 0 12px hsl(var(--gold) / 0); }
}

/* ── Badge pulse for notifications ── */
.badge-pulse { animation: badgePulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }
@keyframes badgePulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Responsive grid helpers ── */
.grid-cards { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid-cards { grid-template-columns: repeat(4, 1fr); } }

/* ── Misc ── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

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

/* ── Lucide icon SVG sizing ── */
.icon-sm { width: 0.75rem; height: 0.75rem; }
.icon { width: 1rem; height: 1rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }
.icon-xl { width: 1.5rem; height: 1.5rem; }
