:root {
  --blue: #0a3d8f;
  --blue-dark: #072a63;
  --blue-pale: #eaf1fc;
  --orange: #ff6a1a;
  --orange-dark: #e2530a;
  --ink: #1b2430;
  --muted: #667085;
  --border: #e3e6ea;
  --bg: #f5f6f8;
  --card: #ffffff;
  --danger: #c62828;
  --success: #1a8a4a;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
svg.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; vertical-align: -3px; }

.top-bar { background: var(--blue-dark); color: #cfe0fb; font-size: 12.5px; }
.top-bar .wrap { display: flex; justify-content: flex-end; gap: 18px; padding: 6px 20px; }
.top-bar a { color: #cfe0fb; }
.top-bar a:hover { color: #fff; }

.site-header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; flex-wrap: wrap; gap: 14px; }
.logo { display: flex; align-items: center; }
.logo-img { height: 46px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 500; font-size: 14.5px; }
.main-nav a { color: var(--ink); padding: 8px 12px; border-radius: 999px; }
.main-nav a:hover { background: var(--blue-pale); color: var(--blue); text-decoration: none; }
.main-nav a.nav-cta { background: var(--orange); color: #fff; }
.main-nav a.nav-cta:hover { background: var(--orange-dark); color: #fff; }

.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; padding: 10px 20px; border-radius: 999px; font-weight: 600; border: none; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-dark); color: #fff; text-decoration: none; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; margin-top: 16px; }
.btn-lg { padding: 14px 30px; font-size: 15.5px; }

.hero { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%); padding: 40px 0 90px; color: #fff; }
.hero h1 { font-size: 30px; margin: 0 0 6px; font-weight: 700; }
.hero p { margin: 0 0 26px; font-size: 16px; color: #cfe0fb; }

.search-panel { background: var(--card); border-radius: 12px; box-shadow: 0 10px 30px rgba(7,42,99,0.18); overflow: hidden; margin-top: -54px; }
.search-tabs { display: flex; }
.search-tabs input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.search-tabs label { flex: 1; text-align: center; padding: 14px 10px; background: #eef2f7; color: var(--muted); font-weight: 600; font-size: 14.5px; cursor: pointer; border-bottom: 3px solid transparent; }
.search-tabs input:checked + label { background: var(--card); color: var(--blue); border-bottom-color: var(--orange); }
.search-tabs input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: -2px; }
.search-bar { padding: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.search-bar select, .search-bar input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; flex: 1 1 150px; min-width: 130px; background: #fff; }
.search-bar button[type=submit] { flex: 0 0 auto; padding: 11px 26px; }

.section { padding: 44px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 21px; }
.cta-section { text-align: center; background: var(--blue-pale); border-radius: 12px; padding: 50px 20px; }
.cta-section h2 { color: var(--blue-dark); }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.listing-card { background: var(--card); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); display: block; color: inherit; transition: box-shadow .15s, transform .15s; position: relative; }
.listing-card:hover { box-shadow: 0 10px 24px rgba(10,20,40,0.12); transform: translateY(-2px); text-decoration: none; }
.listing-photo { height: 170px; background-size: cover; background-position: center; background-color: #dde3ea; position: relative; }
.listing-photo .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.listing-photo .dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.55); }
.listing-photo .dots span:first-child { background: #fff; }
.fav-btn { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(27,36,48,0.45); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; }
.fav-btn svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2; }
.fav-btn.is-fav svg { fill: var(--orange); stroke: var(--orange); }
.listing-body { padding: 14px; }
.listing-price { font-weight: 700; color: var(--ink); font-size: 18px; margin: 0 0 4px; }
.listing-price .usd { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.listing-body h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.listing-loc { margin: 0 0 8px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.listing-feats { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.listing-feats span { display: flex; align-items: center; gap: 4px; }

.badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-vente { background: var(--blue); }
.badge-location { background: var(--orange); }
.badge-new { position: absolute; top: 10px; left: 10px; background: var(--success); }
.badge-new + .badge { top: 40px; }
.listing-detail .badge { position: static; display: inline-block; margin: 0 6px 10px 0; }

.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; margin-top: 16px; }
.detail-gallery { display: grid; gap: 8px; }
.detail-gallery img { width: 100%; border-radius: 10px; object-fit: cover; max-height: 420px; }
.detail-meta { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; }
.detail-meta li { padding: 10px 12px; background: var(--blue-pale); border-radius: 8px; font-size: 13.5px; }
.detail-description { margin: 20px 0; }
.contact-box { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-top: 10px; }
.contact-box p { display: flex; align-items: center; gap: 6px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); }

.auth-section { display: flex; justify-content: center; }
.auth-card { background: var(--card); border-radius: 12px; padding: 32px; max-width: 420px; width: 100%; border: 1px solid var(--border); }
.auth-card h1 { margin-top: 0; font-size: 22px; }
label { display: block; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; font-weight: 400; }
label input:focus, label select:focus, label textarea:focus { outline: none; border-color: var(--blue); }
.form-error { background: #fdecea; color: var(--danger); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }

.listing-form { background: var(--card); border-radius: 10px; padding: 24px; max-width: 720px; border: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 40px; font-size: 13px; color: var(--muted); }
.site-footer p { margin: 4px 0; }

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .top-bar .wrap { justify-content: center; }
  .search-tabs button { font-size: 13px; padding: 12px 6px; }
}
