/* ============================================================
   CLASSIFICADOS IMOBILIÁRIOS — app.css
   Design moderno, mobile-first, PHP puro
   ============================================================ */

/* ── Variáveis ────────────────────────────────────────────── */
:root {
  --primary:       #1A56A8;
  --primary-dark:  #1244880;
  --primary-light: #EEF4FF;
  --secondary:     #64748B;
  --success:       #16A34A;
  --warning:       #F59E0B;
  --danger:        #DC2626;
  --dark:          #0F172A;
  --surface:       #F8FAFC;
  --border:        #E2E8F0;
  --radius:        12px;
  --radius-lg:     20px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.14);
  --transition:    .2s ease;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--font); color: #1e293b; background: #fff; -webkit-font-smoothing: antialiased; }
img  { max-width: 100%; height: auto; }
a    { transition: color var(--transition); }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar { padding: .75rem 0; }
.navbar-brand { font-weight: 700; letter-spacing: -.02em; }
.navbar-logo-icon { font-size: 1.4rem; line-height: 1; }
.navbar.bg-primary { background: linear-gradient(135deg, #1A56A8 0%, #1e40af 100%) !important; }
.navbar-dark .navbar-nav .nav-link { font-weight: 500; padding: .4rem .75rem; border-radius: 8px; transition: background var(--transition); }
.navbar-dark .navbar-nav .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── HERO ─────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 580px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0f1f4b 0%, #1A56A8 50%, #1e6fb5 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; padding: 5rem 0 4rem; width: 100%; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 50px; padding: .35rem 1rem; font-size: .8rem; font-weight: 500;
  backdrop-filter: blur(8px); margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 800; color: #fff; line-height: 1.15;
  letter-spacing: -.03em; margin-bottom: 1rem;
}
.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,.8); margin-bottom: 2.5rem; }

/* Search card */
.hero-search-card {
  background: #fff; border-radius: var(--radius-lg);
  overflow: hidden; text-align: left;
}
.search-tabs {
  display: flex; background: #f1f5f9; padding: .5rem .5rem 0;
  gap: .25rem;
}
.search-tab { cursor: pointer; }
.search-tab input { display: none; }
.search-tab span {
  display: block; padding: .5rem 1.25rem; border-radius: 8px 8px 0 0;
  font-size: .875rem; font-weight: 500; color: var(--secondary);
  transition: all var(--transition);
}
.search-tab input:checked + span {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 -2px 0 var(--primary) inset;
}
.search-form { padding: 1.25rem 1.25rem 1.5rem; }
.search-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: .75rem;
  align-items: end;
}
@media (max-width: 767px) {
  .search-fields { grid-template-columns: 1fr; }
  .search-btn { width: 100%; }
}
.search-field label {
  display: block; font-size: .75rem; font-weight: 600; color: var(--secondary);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem;
}
.search-field input, .search-field select {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: .65rem 1rem; font-size: .95rem; font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; background: #fff; color: #1e293b;
}
.search-field input:focus, .search-field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,168,.12);
}
.search-btn {
  background: var(--primary); color: #fff; border: none;
  border-radius: 10px; padding: .7rem 1.75rem; font-size: .95rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
  font-family: var(--font);
}
.search-btn:hover { background: #1244880; transform: translateY(-1px); }

/* ── Stats bar ────────────────────────────────────────────── */
.stats-bar {
  background: linear-gradient(135deg, #1A56A8, #1e40af);
  padding: 1.5rem 0;
}
.stats-grid {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
}
.stat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: .5rem 2.5rem; color: #fff;
}
.stat-number { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label  { font-size: .75rem; color: rgba(255,255,255,.75); margin-top: .2rem; font-weight: 500; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.2); margin: 0 .5rem; }
@media (max-width: 575px) {
  .stat-item { padding: .75rem 1.25rem; }
  .stat-divider { display: none; }
}

/* ── Section headers ──────────────────────────────────────── */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; color: var(--dark); }
.section-subtitle { font-size: .9rem; color: var(--secondary); margin-bottom: 0; }

/* ── Imóvel card ──────────────────────────────────────────── */
.imovel-card {
  border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; display: flex; flex-direction: column;
}
.imovel-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card-badge-destaque {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff;
  font-size: .7rem; font-weight: 700; padding: .25rem .6rem;
  border-radius: 20px; display: flex; align-items: center;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
}
.card-badge-finalidade {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: .7rem; font-weight: 700; padding: .25rem .6rem; border-radius: 20px;
}
.badge-venda   { background: #1A56A8; color: #fff; }
.badge-aluguel { background: #16A34A; color: #fff; }
.card-img-link { display: block; overflow: hidden; }
.card-thumbnail {
  width: 100%; height: 200px; object-fit: cover;
  transition: transform .35s ease;
  display: block;
}
.imovel-card:hover .card-thumbnail { transform: scale(1.04); }
.card-thumbnail-empty {
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; height: 200px;
}
.card-body-custom { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-tipo { font-size: .75rem; text-transform: capitalize; color: var(--secondary); margin-bottom: .25rem; }
.card-title-imovel { font-size: .95rem; font-weight: 600; line-height: 1.35; margin-bottom: .5rem; }
.card-title-imovel a { color: var(--dark); }
.card-title-imovel a:hover { color: var(--primary); }
.card-location { font-size: .8rem; color: var(--secondary); margin-bottom: .6rem; }
.card-features {
  display: flex; gap: .75rem; flex-wrap: wrap;
  font-size: .78rem; color: var(--secondary); margin-bottom: .75rem;
}
.card-features span { display: flex; align-items: center; gap: .25rem; }
.card-price { margin-top: auto; }
.price-value { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.price-suffix { font-size: .8rem; color: var(--secondary); margin-left: .2rem; }

/* ── Categories ───────────────────────────────────────────── */
.category-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem 1rem; border-radius: var(--radius); text-align: center;
  background: var(--cat-bg, #f8fafc); border: 1.5px solid transparent;
  transition: all var(--transition); min-height: 130px;
}
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-3px); }
.category-card i { font-size: 2rem; color: var(--primary); margin-bottom: .6rem; display: block; }
.cat-label { font-weight: 600; font-size: .9rem; color: var(--dark); }
.cat-count  { font-size: .75rem; color: var(--secondary); margin-top: .2rem; }

/* ── CTA section ──────────────────────────────────────────── */
.cta-section { padding: 0 0 4rem; }
.cta-card {
  background: linear-gradient(135deg, #EEF4FF 0%, #F0F9FF 100%);
  border: 1.5px solid #BFDBFE; border-radius: var(--radius-lg);
  padding: 3rem; overflow: hidden; position: relative;
}
.cta-badge {
  display: inline-block; background: var(--primary); color: #fff;
  font-size: .75rem; font-weight: 600; padding: .25rem .8rem;
  border-radius: 20px; margin-bottom: 1rem; letter-spacing: .03em; text-transform: uppercase;
}
.cta-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--dark); margin-bottom: .75rem; }
.cta-text  { color: var(--secondary); margin-bottom: 1rem; line-height: 1.7; }
.cta-list  { list-style: none; padding: 0; margin: 0; }
.cta-list li { padding: .3rem 0; font-size: .9rem; font-weight: 500; display: flex; align-items: center; }
.cta-illustration {
  font-size: 10rem; color: var(--primary); opacity: .12;
  line-height: 1; filter: drop-shadow(0 8px 32px rgba(26,86,168,.3));
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { border-top: 1px solid #1e293b; }
.footer-link { color: #94a3b8; text-decoration: none; font-size: .875rem; transition: color var(--transition); display: block; margin-bottom: .4rem; }
.footer-link:hover { color: #fff; }
.footer-link-sm { color: #64748b; text-decoration: none; font-size: .8rem; }
.footer-link-sm:hover { color: #94a3b8; }
.hover-white:hover { color: #fff !important; }

/* ── Listagem de imóveis ──────────────────────────────────── */
.filter-sidebar { position: sticky; top: 80px; }
.filter-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.filter-card .form-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--secondary); }

/* ── Página de detalhe ────────────────────────────────────── */
.gallery-main { width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 767px) { .gallery-main { height: 240px; } }
.gallery-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.gallery-thumb {
  width: 70px; height: 50px; object-fit: cover; border-radius: 6px;
  cursor: pointer; border: 2px solid transparent; transition: border-color var(--transition);
  opacity: .7; transition: opacity var(--transition);
}
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--primary); opacity: 1; }

.preco-destaque { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.carac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.carac-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .75rem; display: flex; align-items: center; gap: .6rem;
}
.carac-icon { font-size: 1.2rem; color: var(--primary); flex-shrink: 0; }
.carac-val  { font-weight: 600; font-size: .9rem; line-height: 1; }
.carac-label{ font-size: .72rem; color: var(--secondary); }

.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; position: sticky; top: 80px; }
.btn-whatsapp { background: #25D366; color: #fff; border: none; border-radius: 10px; padding: .75rem 1.25rem; font-weight: 600; width: 100%; font-size: .95rem; cursor: pointer; transition: background var(--transition); display: flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; }
.btn-whatsapp:hover { background: #1da851; color: #fff; }
.btn-contato  { background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: .7rem 1.25rem; font-weight: 600; width: 100%; font-size: .9rem; cursor: pointer; transition: background var(--transition); }
.btn-contato:hover { background: #124488; }

/* ── Painel / Admin ───────────────────────────────────────── */
.painel-sidebar {
  width: 240px; min-width: 240px; min-height: 100vh;
  background: #0f1f4b; flex-shrink: 0;
}
@media (max-width: 991px) {
  .painel-layout { flex-direction: column !important; }
  .painel-sidebar { width: 100% !important; min-width: 100% !important; min-height: auto !important; }
}
.sidebar-brand { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand a { color: #fff; text-decoration: none; font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.sidebar-nav { padding: 1rem .75rem; }
.sidebar-section { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem .5rem .4rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem;
  border-radius: 8px; color: #94a3b8; text-decoration: none; font-size: .875rem; font-weight: 500;
  transition: all var(--transition); margin-bottom: 2px;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-user { border-top: 1px solid rgba(255,255,255,.08); padding: 1rem 1.25rem; margin-top: auto; }

.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-card .stat-title { font-size: .8rem; color: var(--secondary); margin-top: .2rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-section { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.25rem; overflow: hidden; }
.form-section-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; color: var(--dark); display: flex; align-items: center; gap: .5rem; }
.form-section-body { padding: 1.25rem; }
.form-label { font-size: .8rem; font-weight: 600; margin-bottom: .35rem; color: #374151; }
.form-control, .form-select { border-radius: 8px; border: 1.5px solid var(--border); font-size: .9rem; padding: .6rem .85rem; transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,168,.12); outline: none; }

/* ── Upload area ──────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2.5rem 1rem; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--surface);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }

/* ── Paginação ────────────────────────────────────────────── */
.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--border); color: var(--primary); font-size: .875rem; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── Tabela ───────────────────────────────────────────────── */
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--secondary); font-weight: 600; border-bottom: 2px solid var(--border); }
.table td { vertical-align: middle; font-size: .875rem; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border: none; border-radius: var(--radius); font-size: .9rem; }
.alert-success { background: #F0FDF4; color: #166534; }
.alert-danger  { background: #FEF2F2; color: #991B1B; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { font-weight: 600; letter-spacing: .02em; }

/* ── Misc ─────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
.rounded-12 { border-radius: 12px !important; }
.btn { border-radius: 10px !important; font-weight: 500; }
.btn-primary { background: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover { background: #124488 !important; border-color: #124488 !important; }
.shadow-sm  { box-shadow: var(--shadow-sm) !important; }
.shadow     { box-shadow: var(--shadow) !important; }
.shadow-lg  { box-shadow: var(--shadow-lg) !important; }

/* ── Página 404 ───────────────────────────────────────────── */
.page-404 { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.page-404 .code { font-size: 8rem; font-weight: 900; color: var(--primary); opacity: .15; line-height: 1; }
