/* ===== House Hunting — global styles ===== */

:root {
  --ink: #14231f;
  --ink-soft: #4b5a56;
  --paper: #ffffff;
  --paper-soft: #f5f7f6;
  --line: #e2e7e5;
  --brand: #12574a;
  --brand-dark: #0b3c33;
  --brand-soft: #e5efec;
  --accent: #d97b3f;
  --accent-dark: #b5622e;
  --sale: #12574a;
  --rent: #2563a6;
  --lease: #8a5c2e;
  --danger: #b03434;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 35, 31, 0.06), 0 4px 16px rgba(20, 35, 31, 0.06);
  --shadow-lg: 0 8px 30px rgba(20, 35, 31, 0.12);
  --nav-h: 68px;
  --max-w: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-soft); padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ===== Top nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--brand-dark);
  flex-shrink: 0;
}
.brand .brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.nav-links a:hover, .nav-links a.active { color: var(--brand-dark); background: var(--brand-soft); }
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.country-select { position: relative; }
.country-select-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  font-size: 1.05rem; display: flex; align-items: center; justify-content: center;
}
.country-select-btn:hover { border-color: var(--brand); }
.country-select .nav-dropdown { min-width: 170px; }
.country-option {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600;
}
.country-option.active { background: var(--brand-soft); color: var(--brand-dark); }
.country-note { padding: 6px 12px 2px; font-size: 0.72rem; color: var(--ink-soft); border-top: 1px solid var(--line); margin-top: 4px; }
.nav-account { position: relative; }
.nav-account-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}
.nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px;
  display: none; flex-direction: column;
}
.nav-dropdown.open { display: flex; }
.nav-dropdown a, .nav-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px; border: none; background: none;
  font-size: 0.9rem; color: var(--ink);
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: var(--paper-soft); }
.nav-burger { display: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--brand-dark);
  color: #d8e6e1;
  margin-top: 64px;
  padding: 48px 0 24px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.site-footer h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; }
.site-footer a { color: #b9d0c9; font-size: 0.9rem; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.site-footer p { color: #b9d0c9; }
.footer-bottom {
  max-width: var(--max-w); margin: 32px auto 0; padding: 20px 20px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem; color: #9db8b0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 720px) {
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}

/* ===== Hero / search ===== */
.hero {
  background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 100%);
  padding: 56px 0 40px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); max-width: 720px; margin: 0 auto 12px; }
.hero .lead { max-width: 560px; margin: 0 auto 28px; font-size: 1.05rem; }

.trust-strip {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 20px;
  font-size: 0.82rem; font-weight: 600; color: var(--brand-dark);
}

.search-tabs {
  display: inline-flex; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.search-tabs button {
  border: none; background: none; padding: 9px 18px; border-radius: 999px;
  font-weight: 600; font-size: 0.88rem; color: var(--ink-soft);
}
.search-tabs button.active { background: var(--brand); color: #fff; }

.search-bar {
  max-width: 780px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 8px; display: flex; gap: 8px;
}
.search-bar input[type="text"] {
  flex: 1; border: none; padding: 12px 16px; font-size: 0.98rem; border-radius: var(--radius);
}
.search-bar input:focus, .search-bar select:focus { outline: none; }
.search-bar .btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .search-bar { flex-direction: column; }
}

/* ===== Filter bar (browse page) ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 24px;
}
.filter-bar select, .filter-bar input {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 0.88rem; color: var(--ink);
}
.filter-count { margin-left: auto; font-size: 0.88rem; color: var(--ink-soft); }

/* ===== Listing grid & card ===== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.listing-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: #fff; transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: block;
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.listing-card .thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--paper-soft) center/cover no-repeat;
}
.listing-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #fff;
}
.badge-sale { background: var(--sale); }
.badge-rent { background: var(--rent); }
.badge-lease { background: var(--lease); }
.badge-featured { background: var(--accent); }
.thumb .badge { position: absolute; top: 10px; left: 10px; }
.thumb .fav-btn {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: none; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: var(--danger);
}
.listing-card .body { padding: 14px 16px 16px; }
.listing-card .price { font-size: 1.15rem; font-weight: 800; color: var(--brand-dark); }
.listing-card .price small { font-weight: 500; font-size: 0.78rem; color: var(--ink-soft); }
.listing-card .title { font-size: 0.95rem; font-weight: 600; margin: 4px 0 2px; }
.listing-card .loc { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 8px; }
.listing-card .meta { display: flex; gap: 12px; font-size: 0.82rem; color: var(--ink-soft); }
.listing-card .meta span { display: flex; align-items: center; gap: 4px; }

.empty-state {
  text-align: center; padding: 64px 20px; color: var(--ink-soft);
}
.empty-state .btn { margin-top: 12px; }

/* ===== Sections ===== */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.section-head a { font-size: 0.88rem; font-weight: 600; color: var(--brand); }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.step-card .num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px;
}
@media (max-width: 780px) { .steps-grid { grid-template-columns: 1fr; } }

.cta-band {
  background: var(--brand); color: #fff; border-radius: var(--radius-lg);
  padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2, .cta-band p { color: #fff; margin: 0; }
.cta-band p { opacity: 0.85; margin-top: 4px; }

/* ===== Why we're different ===== */
.diff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.diff-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.diff-card .diff-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 12px;
}
.diff-card h3 { font-size: 0.98rem; margin-bottom: 6px; }
.diff-card p { font-size: 0.85rem; margin: 0; }
@media (max-width: 900px) { .diff-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .diff-grid { grid-template-columns: 1fr; } }

.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.compare-table th, .compare-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.compare-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); background: var(--paper-soft); }
.compare-table th.compare-us, .compare-table td.compare-us { background: var(--brand-soft); }
.compare-table th.compare-us { color: var(--brand-dark); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td.compare-them { color: var(--ink-soft); }
.compare-table td.compare-us { font-weight: 600; color: var(--brand-dark); }

/* ===== Listing detail ===== */
.listing-detail { padding: 24px 0 64px; }
.detail-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }

.gallery-main {
  aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-soft);
  margin-bottom: 10px; position: relative;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs img {
  width: 84px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; flex-shrink: 0;
}
.gallery-thumbs img.active { border-color: var(--brand); }
.gallery-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 0.9rem;
}

.detail-badges { display: flex; gap: 8px; margin-bottom: 10px; }
.detail-header h1 { font-size: 1.6rem; margin-bottom: 6px; }
.detail-loc { color: var(--ink-soft); margin-bottom: 14px; }
.detail-price { font-size: 1.9rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 4px; }
.detail-price small { font-size: 0.95rem; font-weight: 500; color: var(--ink-soft); }
.detail-meta-row { display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0; }
.detail-meta-row .m { text-align: center; }
.detail-meta-row .m b { display: block; font-size: 1.05rem; }
.detail-meta-row .m span { font-size: 0.78rem; color: var(--ink-soft); }
.amenity-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.address-block { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; }

.contact-card {
  position: sticky; top: calc(var(--nav-h) + 20px);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.contact-card .lister { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.contact-card .lister .nav-avatar { width: 40px; height: 40px; font-size: 1rem; }
.contact-card .lister-name { font-weight: 700; }
.contact-card .lister-role { font-size: 0.8rem; color: var(--ink-soft); text-transform: capitalize; }

.owner-banner {
  background: var(--brand-soft); border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}

.stale-banner {
  background: #fdf1e7; border: 1px solid #f0d3b4; border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 20px; display: flex; flex-direction: column; gap: 2px;
}
.stale-banner strong { color: var(--accent-dark); font-size: 0.92rem; }
.stale-banner span { font-size: 0.85rem; color: var(--ink-soft); }

.rera-pill { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

.confirm-banner {
  background: #fdf1e7; border: 1px solid #f0d3b4; border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 0.88rem;
}
.confirm-banner strong { color: var(--accent-dark); }

.trust-panel {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 20px 0;
}
.trust-panel h4 { margin: 0 0 10px; font-size: 0.9rem; }
.trust-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; }
.trust-row .count { font-weight: 700; color: var(--brand-dark); }
.trust-vote-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.trust-vote-buttons button { flex: 1; min-width: 130px; }

.response-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; margin-top: 6px;
}

.trust-note {
  font-size: 0.78rem; color: var(--ink-soft); text-align: center; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line);
}

/* ===== Forms ===== */
.form-card {
  max-width: 460px; margin: 48px auto; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 90px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.field-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }
.form-msg { padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.form-msg.error { background: #fbeaea; color: var(--danger); }
.form-msg.success { background: #e6f3ee; color: var(--brand-dark); }
.form-foot { text-align: center; font-size: 0.88rem; color: var(--ink-soft); margin-top: 16px; }

@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* ===== Utility ===== */
.pill {
  display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--paper-soft);
  font-size: 0.78rem; font-weight: 600; color: var(--ink-soft);
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.skeleton { background: linear-gradient(90deg, var(--paper-soft) 25%, #eef1f0 37%, var(--paper-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
