/* ===== ROOT & RESET ===== */
:root {
  --primary: #1a56db;
  --primary-dark: #1342b0;
  --accent: #e53e3e;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --radius: 12px;
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== HEADER / NAV ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar { padding: .75rem 0; }

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.brand-icon { font-size: 1.3rem; }

.navbar .nav-link {
  color: var(--text-muted) !important;
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .7rem !important;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.navbar .nav-link:hover {
  color: var(--primary) !important;
  background: #eef2ff;
}

/* ===== MAIN ===== */
.main-content { flex: 1; }

/* ===== PAGE TITLE ===== */
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== FILTER CARD ===== */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.filter-title {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .05em;
  margin: 0;
}

/* ===== REALTY CARD ===== */
.realty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.realty-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-img-link { display: block; overflow: hidden; }
.card-img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: transform .35s;
}
.card-img-link:hover .card-img { transform: scale(1.04); }

.card-img-placeholder {
  width: 100%;
  height: 210px;
  background: #eef2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  font-size: 2.5rem;
}

.card-body-custom {
  padding: 1rem 1.1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}

.badge-type {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.btn-fav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #cbd5e0;
  padding: 0;
  line-height: 1;
  transition: color .2s, transform .15s;
}
.btn-fav:hover, .btn-fav.active { color: var(--accent); transform: scale(1.2); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .3rem;
  line-height: 1.3;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }

.card-address {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

.card-specs {
  display: flex;
  gap: .8rem;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: auto;
  padding-bottom: .8rem;
}
.card-specs i { color: var(--primary); }

.card-footer-custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: .7rem;
  margin-top: .7rem;
}

.card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.card-actions { display: flex; gap: .3rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3.5rem; margin-bottom: 1rem; display: block; }
.empty-state h3 { color: var(--text); margin-bottom: .5rem; }

/* ===== DETAIL PAGE ===== */
.detail-img {
  height: 420px;
  object-fit: cover;
}
.detail-img-placeholder {
  height: 420px;
  background: #eef2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
}
.detail-img-placeholder i { font-size: 3rem; }

.carousel-thumbnails { gap: .4rem; }
.thumb {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s;
  border: 2px solid transparent;
}
.thumb.active, .thumb:hover { opacity: 1; border-color: var(--primary); }

.detail-sidebar {
  position: sticky;
  top: 80px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.detail-address { color: var(--text-muted); font-size: .9rem; margin-bottom: 1rem; }
.detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .5rem;
}

.spec-box {
  background: var(--bg);
  border-radius: 8px;
  padding: .8rem .5rem;
}
.spec-val { font-size: 1.3rem; font-weight: 700; }
.spec-lbl { font-size: .75rem; color: var(--text-muted); }

.detail-desc { margin-bottom: 1rem; }
.detail-desc h6 { font-weight: 600; margin-bottom: .4rem; }
.detail-owner { margin-bottom: .5rem; }

/* ===== FORM CARD ===== */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}
.form-card-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.form-section-title {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}

/* Photo grid in edit form */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .6rem;
  margin-bottom: .5rem;
}
.photo-thumb-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
}
.photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-cover-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26,86,219,.85);
  color: #fff;
  font-size: .65rem;
  text-align: center;
  padding: .2rem;
  font-weight: 600;
}
.photo-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: .65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.photo-delete-btn:hover { background: var(--accent); }

/* ===== AUTH CARD ===== */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  margin-top: 2rem;
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: .5rem; }
.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .25rem;
}
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; color: var(--text-muted); font-size: .9rem; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ===== BOOTSTRAP OVERRIDES ===== */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.page-link { color: var(--primary); }
.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}
