/* ===================================================================
   Ceno Homes — design system
   =================================================================== */
:root {
  --emerald-900: #0b3b34;
  --emerald-700: #0f5c4f;
  --emerald-600: #14776a;
  --emerald-500: #1e9e8a;
  --emerald-100: #d6f1ea;
  --amber-500:  #f2a93b;
  --amber-600:  #e0922a;
  --ink-900: #0e1a18;
  --ink-700: #2c3a37;
  --ink-500: #5d6b67;
  --ink-300: #9aa6a2;
  --line:    #e4ebe8;
  --bg:      #f6f9f8;
  --card:    #ffffff;
  --white:   #ffffff;
  --danger:  #e0533d;
  --radius:  16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(14,26,24,.06), 0 1px 2px rgba(14,26,24,.04);
  --shadow-md: 0 8px 24px rgba(14,26,24,.10);
  --shadow-lg: 0 20px 48px rgba(14,26,24,.16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
.serif { font-family: var(--serif); font-weight: 600; }

.container { width: min(1180px, 92vw); margin-inline: auto; }
.section { padding: 64px 0; }
.muted { color: var(--ink-500); }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; transition: .18s ease; white-space: nowrap;
}
.btn-primary { background: var(--emerald-600); color: #fff; }
.btn-primary:hover { background: var(--emerald-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-amber { background: var(--amber-500); color: #2a1c05; }
.btn-amber:hover { background: var(--amber-600); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-900); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--emerald-500); color: var(--emerald-700); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; white-space: nowrap; overflow-wrap: normal; flex-shrink: 0; }
.brand .logo { width: 34px; height: 34px; }
.brand b { color: var(--emerald-700); }
/* nav links live inside the ☰ menu at every width (hidden until opened) */
.nav-links { display: none; }
.nav-links a { font-weight: 500; color: var(--ink-700); font-size: 16px; padding: 8px 0; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--emerald-700); }
.nav-links.open {
  display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0;
  background: #fff; padding: 16px 6vw; gap: 6px; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md); z-index: 55;
}
.nav-links.open .nav-auth {
  display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: block; background: none; border: 0; font-size: 26px; color: var(--ink-900); line-height: 1; padding: 0 2px; }
/* account links inside the ☰ menu — only visible when the nav collapses */
.nav-auth { display: none; }
.nav-auth-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-300); font-weight: 700; padding-top: 6px; }
.nav-auth .logoutBtn { text-align: left; background: none; border: 0; padding: 6px 0; font: inherit; font-weight: 500; color: var(--danger); cursor: pointer; }

/* ---------- user menu ---------- */
.usermenu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 5px; cursor: pointer; transition: .15s; font-weight: 600; color: var(--ink-900);
}
.user-trigger:hover { border-color: var(--emerald-500); }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--emerald-600); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.user-name { font-size: 14px; }
.user-trigger .caret { font-size: 11px; color: var(--ink-500); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); width: 230px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .16s; z-index: 60;
}
.usermenu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.ud-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.ud-head b { display: block; font-size: 14px; }
.ud-head span { font-size: 12px; color: var(--ink-500); word-break: break-all; }
.user-dropdown a, .user-dropdown button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-700); background: none; border: 0; cursor: pointer;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg); color: var(--emerald-700); }
.user-dropdown #logoutBtn { color: var(--danger); border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0 0 9px 9px; }

/* ---------- auth page ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-aside {
  position: relative; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 400px at 80% 0%, rgba(30,158,138,.25), transparent 60%), linear-gradient(160deg, #0b3b34, #14776a);
  overflow: hidden;
}
.auth-aside::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 26px 26px; opacity: .5; }
.auth-aside .a-inner { position: relative; z-index: 1; }
.auth-aside h2 { font-family: var(--serif); font-weight: 600; font-size: 38px; margin-top: 18px; }
.auth-aside p { color: rgba(255,255,255,.85); font-size: 17px; max-width: 360px; }
.auth-aside ul { position: relative; z-index: 1; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-aside ul li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); }
.auth-aside ul li::before { content: "✓"; width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; color: var(--amber-500); font-weight: 800; flex: none; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-tabs { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px; margin-bottom: 26px; }
.auth-tabs button { flex: 1; padding: 10px; border: 0; background: transparent; border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--ink-500); cursor: pointer; transition: .15s; }
.auth-tabs button.active { background: #fff; color: var(--emerald-700); box-shadow: var(--shadow-sm); }
.auth-card h1 { font-size: 26px; }
.auth-error { background: #fceeec; border: 1px solid #f3cfc8; color: #a23a26; padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: none; }
.auth-error.show { display: block; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--ink-500); font-size: 14px; }
.auth-foot a { color: var(--emerald-700); font-weight: 700; cursor: pointer; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; padding: 92px 0 120px; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(30,158,138,.16), transparent 60%),
    linear-gradient(160deg, #0b3b34 0%, #0f5c4f 58%, #14776a 100%);
  color: #fff;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 6vw, 62px); margin-bottom: 18px; }
.hero h1 em { color: var(--amber-500); font-style: normal; }
.hero p { font-size: 19px; color: rgba(255,255,255,.85); max-width: 560px; margin-bottom: 34px; }
.hero-stats { display: flex; gap: 40px; margin-top: 54px; }
.hero-stats .stat b { display: block; font-size: 30px; font-family: var(--serif); }
.hero-stats .stat span { color: rgba(255,255,255,.72); font-size: 14px; }

/* ---------- search bar ---------- */
.searchbar {
  background: #fff; border-radius: 18px; padding: 10px; display: flex; gap: 8px;
  box-shadow: var(--shadow-lg); max-width: 720px;
}
.searchbar .seg { display: flex; align-items: center; gap: 10px; padding: 6px 14px; flex: 1; }
.searchbar .seg + .seg { border-left: 1px solid var(--line); }
.searchbar input, .searchbar select {
  border: 0; outline: none; font-size: 15px; width: 100%; background: transparent; color: var(--ink-900);
}
.searchbar label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-300); display: block; font-weight: 700; }
.searchbar .btn { align-self: stretch; }

/* ---------- listing grid + cards ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: .2s ease; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #d2e3de; }
.card-media { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: var(--emerald-100); }
.card-media img, .card-media svg { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute; top: 12px; left: 12px; background: rgba(14,26,24,.78); color: #fff;
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; backdrop-filter: blur(4px);
  text-transform: uppercase; letter-spacing: .04em;
}
.card-badge.for-sale { background: var(--emerald-600); }
.card-badge.for-rent { background: var(--amber-600); color: #2a1c05; }
.fav-btn {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: .15s; font-size: 18px; line-height: 1;
}
.fav-btn:hover { transform: scale(1.08); }
.fav-btn.active { color: var(--danger); }
.fav-btn .heart-o { color: var(--ink-500); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-price { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.card-facts { display: flex; gap: 14px; color: var(--ink-700); font-size: 14px; font-weight: 600; }
.card-facts span b { font-weight: 800; }
.card-addr { color: var(--ink-500); font-size: 14px; }
.card-type { margin-top: auto; padding-top: 6px; color: var(--emerald-700); font-size: 13px; font-weight: 600; }

/* ---------- section heads ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); font-family: var(--serif); font-weight: 600; }
.section-head p { color: var(--ink-500); margin: 4px 0 0; }
.eyebrow { color: var(--emerald-600); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; }

/* ---------- categories ---------- */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat {
  border-radius: var(--radius); padding: 28px; color: #fff; position: relative; overflow: hidden;
  min-height: 180px; display: flex; flex-direction: column; justify-content: end; transition: .2s;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat h3 { font-size: 22px; margin: 0; }
.cat p { margin: 4px 0 0; opacity: .9; font-size: 14px; }
.cat.buy  { background: linear-gradient(150deg, #0f5c4f, #1e9e8a); }
.cat.sell { background: linear-gradient(150deg, #b9722a, #f2a93b); }
.cat.rent { background: linear-gradient(150deg, #233f5e, #4a7bb0); }

/* ---------- listings page layout ---------- */
.browse { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; padding: 32px 0 72px; }
.filters {
  position: sticky; top: 90px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.filters h3 { font-size: 17px; margin-bottom: 16px; }
.filter-group { margin-bottom: 20px; }
.filter-group > label { font-size: 13px; font-weight: 700; color: var(--ink-700); display: block; margin-bottom: 8px; }
.field {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; background: #fff; color: var(--ink-900); outline: none; transition: .15s;
}
.field:focus { border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(30,158,138,.14); }
.range-row { display: flex; gap: 10px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--ink-700); transition: .15s;
}
.chip.active { background: var(--emerald-600); color: #fff; border-color: var(--emerald-600); }
.browse-main .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.results-count { font-weight: 600; color: var(--ink-700); }
.empty {
  background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 60px 24px; text-align: center; color: var(--ink-500);
}
.empty .big { font-size: 42px; margin-bottom: 8px; }

/* ---------- detail page ---------- */
.detail { padding: 28px 0 80px; }
.breadcrumb { color: var(--ink-500); font-size: 14px; margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--emerald-700); }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 200px; gap: 10px; border-radius: var(--radius); overflow: hidden; }
.gallery .g-main { grid-row: span 2; grid-column: 1; }
.gallery > * { overflow: hidden; background: var(--emerald-100); }
.gallery img, .gallery svg { width: 100%; height: 100%; object-fit: cover; }
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 36px; margin-top: 32px; align-items: start; }
.detail-price { font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 18px 28px; margin: 18px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.detail-facts .f b { display: block; font-size: 22px; font-family: var(--serif); }
.detail-facts .f span { color: var(--ink-500); font-size: 13px; }
.detail h1 { font-size: 26px; }
.detail-section { margin-top: 30px; }
.detail-section h3 { font-size: 19px; margin-bottom: 12px; }
.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: 8px; align-items: center; color: var(--ink-700); }
.feature-list li::before { content: "✓"; color: var(--emerald-600); font-weight: 800; }
.agent-card {
  position: sticky; top: 90px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-md);
}
.agent { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.agent .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--emerald-100); color: var(--emerald-700); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.agent b { display: block; }
.agent span { color: var(--ink-500); font-size: 13px; }
.form-row { margin-bottom: 12px; }
.form-row label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 6px; }

/* ---------- sell form ---------- */
.formwrap { max-width: 760px; margin-inline: auto; padding: 36px 0 80px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
textarea.field { min-height: 120px; resize: vertical; }
.help { font-size: 12px; color: var(--ink-300); margin-top: 4px; }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: 420px 1fr; height: calc(100vh - 70px); }
.map-list { overflow-y: auto; padding: 18px; background: var(--bg); }
.map-list .card { margin-bottom: 16px; }
#map { height: 100%; width: 100%; }
.leaflet-popup-content { font-family: var(--font); }
.map-popup b { font-size: 16px; }
.map-popup a { color: var(--emerald-700); font-weight: 700; }

/* ---------- compare button on cards ---------- */
.cmp-btn {
  position: absolute; top: 54px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: .15s; font-size: 17px; line-height: 1; color: var(--ink-500); font-weight: 800;
}
.cmp-btn:hover { transform: scale(1.08); color: var(--emerald-700); }
.cmp-btn.active { background: var(--emerald-600); color: #fff; }

/* ---------- floating compare bar ---------- */
.compare-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgba(14,26,24,.12);
  transform: translateY(120%); transition: transform .28s ease; padding: 12px 0;
}
.compare-bar.show { transform: translateY(0); }
.cb-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.cb-thumbs { display: flex; gap: 10px; }
.cb-thumb { position: relative; width: 78px; }
.cb-thumb-media { width: 78px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--emerald-100); border: 1px solid var(--line); }
.cb-thumb-media img, .cb-thumb-media svg { width: 100%; height: 100%; object-fit: cover; }
.cb-x {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink-900); color: #fff; border: 2px solid #fff; font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.cb-actions { display: flex; align-items: center; gap: 12px; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* ---------- mortgage calculator ---------- */
.calc { background: #f0f7f5; border: 1px solid #d8ece6; border-radius: var(--radius); padding: 22px; }
.calc-result { text-align: center; padding: 8px 0 18px; }
.calc-result .big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; color: var(--emerald-700); }
.calc-result .big span { font-size: 18px; color: var(--ink-500); font-weight: 600; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc-grid .full { grid-column: 1 / -1; }
.calc label { font-size: 12px; font-weight: 700; color: var(--ink-700); display: block; margin-bottom: 5px; }
.calc input[type=range] { width: 100%; accent-color: var(--emerald-600); }
.calc .breakdown { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.calc .brow { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-top: 1px dashed #cfe3dd; }
.calc .brow:first-child { border-top: 0; }
.calc .brow b { font-weight: 700; }
.calc .bar { height: 10px; border-radius: 6px; overflow: hidden; display: flex; background: #e0eee9; margin-top: 4px; }
.calc .bar i { display: block; height: 100%; }

/* ---------- neighborhood / schools ---------- */
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.score { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.score .ring {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center;
  font-weight: 800; font-size: 19px; color: #fff;
}
.score small { display: block; color: var(--ink-500); font-size: 12px; }
.score b { font-size: 14px; }
.schools { width: 100%; border-collapse: collapse; }
.schools th, .schools td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.schools th { color: var(--ink-500); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.rating-badge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; font-weight: 800; font-size: 14px; }

/* ---------- compare page ---------- */
.compare-page { padding: 32px 0 90px; }
.compare-scroll { overflow-x: auto; }
.compare-table { border-collapse: collapse; width: 100%; min-width: 640px; }
.compare-table th, .compare-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table thead th { border-bottom: 2px solid var(--line); }
.compare-table .rowlabel { font-weight: 700; color: var(--ink-700); background: #fff; position: sticky; left: 0; width: 150px; }
.compare-table .best { color: var(--emerald-700); font-weight: 800; }
.compare-table .best::after { content: " ★"; color: var(--amber-500); }
.cmp-head-media { width: 100%; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; margin-bottom: 8px; background: var(--emerald-100); }
.cmp-head-media img, .cmp-head-media svg { width: 100%; height: 100%; object-fit: cover; }
.cmp-remove { color: var(--danger); font-size: 13px; background: none; border: 0; padding: 4px 0; }

/* ---------- file upload ---------- */
.uploader { border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 18px; text-align: center; transition: .15s; cursor: pointer; background: #fafdfc; }
.uploader:hover, .uploader.drag { border-color: var(--emerald-500); background: #f0f7f5; }
.uploader input { display: none; }
.upload-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-preview .thumb { position: relative; width: 92px; height: 70px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.upload-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(14,26,24,.8); color: #fff; border: 0; font-size: 12px; line-height: 1; }

/* keep page content clear of the floating compare bar */
body.has-compare-pad { padding-bottom: 96px; }

/* ---------- agents directory ---------- */
.agent-avatar { border-radius: 50%; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.agent-avatar.gen { line-height: 1; }
.agent-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; transition: .2s; }
.agent-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.agent-tile-head { display: flex; gap: 14px; align-items: center; }
.agent-tile-head b { font-size: 18px; display: block; }
.agent-tile-title { color: var(--emerald-700); font-size: 13px; font-weight: 600; display: block; }
.agent-rating { color: var(--amber-500); font-size: 13px; letter-spacing: 1px; }
.agent-rating i { color: var(--ink-500); font-style: normal; font-weight: 700; }
.agent-bio { color: var(--ink-700); font-size: 14px; margin: 0; }
.agent-meta { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-500); margin-top: auto; }
.agent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- agent profile page ---------- */
.agent-profile { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; margin-top: 18px; }
.agent-profile-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); text-align: center; position: sticky; top: 90px; }
.agent-profile-card .agent-avatar { margin: 0 auto; }
.agent-profile-meta { display: flex; flex-direction: column; gap: 0; margin-top: 18px; text-align: left; }
.agent-profile-meta > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.agent-profile-meta span { color: var(--ink-500); }
.agent-profile-meta b { text-align: right; }
.agent-tile-head { color: inherit; }
@media (max-width: 900px) { .agent-profile { grid-template-columns: 1fr; } .agent-profile-card { position: static; } }

/* ---------- become-an-agent page ---------- */
.agent-hero { background: linear-gradient(160deg, #0b3b34, #14776a); color: #fff; padding: 64px 0; }
.agent-hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 5vw, 50px); }
.agent-hero p { color: rgba(255,255,255,.85); font-size: 18px; max-width: 560px; }
.agent-perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px; }
.agent-perk { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 20px; }
.agent-perk .ic { font-size: 26px; }
.agent-perk b { display: block; margin: 8px 0 4px; }
.agent-perk span { color: rgba(255,255,255,.78); font-size: 14px; }
.apply-card { max-width: 760px; margin: -40px auto 0; position: relative; z-index: 2; }
.agent-success { text-align: center; padding: 40px 24px; }
.agent-success .check { width: 64px; height: 64px; border-radius: 50%; background: var(--emerald-100); color: var(--emerald-700); display: grid; place-items: center; font-size: 32px; margin: 0 auto 14px; }
.agent-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--emerald-100); color: var(--emerald-700); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
@media (max-width: 900px) { .agent-perks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .agent-perks { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: var(--emerald-900); color: rgba(255,255,255,.8); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-grid a { display: block; padding: 5px 0; color: rgba(255,255,255,.72); font-size: 14px; }
.footer-grid a:hover { color: var(--amber-500); }
.footer-brand p { max-width: 280px; font-size: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 10px; }

/* ---------- lightbox ---------- */
.gallery > * { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(8,14,13,.92);
  display: none; align-items: center; justify-content: center;
}
.lightbox.show { display: flex; }
.lb-stage { width: min(1100px, 92vw); height: min(74vh, 760px); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); background: #0b3b34; }
.lb-stage img, .lb-stage svg { width: 100%; height: 100%; object-fit: cover; }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; border: 0; font-size: 26px; display: grid; place-items: center;
  backdrop-filter: blur(4px); transition: .15s;
}
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-prev { left: max(16px, 3vw); }
.lb-next { right: max(16px, 3vw); }
.lb-close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; border: 0; font-size: 22px; }
.lb-close:hover { background: rgba(255,255,255,.28); }
.lb-count { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0,0,0,.4); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink-900); color: #fff; padding: 13px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 200; font-weight: 600;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .map-layout { grid-template-columns: 1fr; height: auto; }
  #map { height: 60vh; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .g-main { grid-column: span 2; }
}
@media (max-width: 560px) {
  .searchbar { flex-direction: column; }
  .searchbar .seg + .seg { border-left: 0; border-top: 1px solid var(--line); }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   Small-screen (phone) hardening — prevent horizontal overflow so
   mobile browsers don't zoom the whole page out.
   =================================================================== */
@media (max-width: 600px) {
  /* a touch less breathing room so content isn't cramped/oversized */
  .container { width: 100%; padding-inline: 18px; }
  .section { padding: 40px 0; }
  .hero { padding: 56px 0 72px; }
  .hero p { font-size: 17px; }

  /* header: keep brand + actions on one line on narrow phones */
  .nav { gap: 12px; }
  .brand { font-size: 18px; }
  .brand .logo { width: 30px; height: 30px; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn { padding: 8px 12px; font-size: 14px; }

  /* listing detail */
  .detail-price { font-size: 30px; }
  .detail-facts { gap: 14px 22px; }
  .detail-facts .f b { font-size: 19px; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; }
  .feature-list { grid-template-columns: 1fr; }
  .scores { grid-template-columns: 1fr 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .detail-section h3 { font-size: 18px; }

  /* tables that can get wide → allow horizontal scroll instead of pushing the page */
  .schools { display: block; overflow-x: auto; white-space: nowrap; }

  /* forms / cards */
  .form-card { padding: 22px; }
  .formwrap, .auth-panel { padding-left: 0; padding-right: 0; }
  .agent-perks { grid-template-columns: 1fr; }

  /* compare floating bar: let thumbnails scroll, keep actions reachable */
  .cb-inner { gap: 12px; }
  .cb-thumbs { overflow-x: auto; }

  /* never let an oversized media/word force the layout wider than the screen */
  img, svg, table, pre { max-width: 100%; }
  h1, h2, h3, p, a, .card-price, .detail-price { overflow-wrap: anywhere; }
}

/* Extra-small phones */
@media (max-width: 380px) {
  .hero h1 { font-size: 34px; }
  .detail-price { font-size: 26px; }
  .nav-actions .btn-ghost { display: none; } /* drop "Log in" pill; Sign up + ☰(Account) remain */
}
