/* Find-A-Home Liberia — seller signup
   Mobile-first. All styles external (CSP: style-src 'self'). */

:root {
  --primary: #0E7C66;
  --primary-dark: #0A5C4C;
  --primary-soft: #E3F2EE;
  --accent: #E8A33D;
  --accent-dark: #C9862B;
  --ink: #10241F;
  --muted: #5B6E67;
  --bg: #F4F7F6;
  --card: #FFFFFF;
  --line: #DCE7E3;
  --danger: #B3261E;
  --danger-bg: #FDEBEA;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 36, 31, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-dark); }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #0B1F1A;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; letter-spacing: 0.2px; }
.brand-text small { font-size: 0.62rem; letter-spacing: 0.28em; color: var(--accent); }

.site-nav { display: flex; gap: 14px; font-size: 0.9rem; }
.site-nav a { color: #D9E7E2; text-decoration: none; }
.site-nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- Layout ---------- */
.site-main { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 28px 16px 48px; }

.signup-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

@media (min-width: 860px) {
  .signup-wrap { grid-template-columns: 1fr 1.15fr; gap: 34px; }
}

.signup-hero { padding-top: 8px; }
.eyebrow {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 0 14px;
}

.signup-hero h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 12px; }
@media (min-width: 860px) { .signup-hero h1 { font-size: 2.1rem; } }

.lead { color: var(--muted); margin: 0 0 18px; }
.verified-badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 0.85em;
}

.hero-points { margin: 0 0 0 18px; padding: 0; color: var(--ink); }
.hero-points li { margin-bottom: 8px; }

/* ---------- Card & form ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

@media (min-width: 600px) { .card { padding: 32px 30px; } }

.alert {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.92rem;
}

.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F3C1BD; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.opt { color: var(--muted); font-weight: 400; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--ink);
  background: #FBFDFC;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.18);
}

.hint { font-size: 0.8rem; color: var(--muted); margin: 5px 0 0; }
.fineprint { font-size: 0.78rem; color: var(--muted); margin: 12px 0 0; }

/* Honeypot — hidden from humans, visible to naive bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* Required-field asterisk */
.req { color: #dc2626; font-weight: 700; }

/* Sold/Rented status badges (public tracker) */
.card-status-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 12px; border-radius: 6px; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.06em; color: #fff; text-transform: uppercase;
}
.card-status-sold { background: #dc2626; }
.card-status-rented { background: #5a3d99; }
.tracker-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.tracker-header h2 { margin: 0 0 4px; font-size: 1.2rem; }
.tracker-sub { color: var(--muted); font-size: 0.85rem; display: block; margin-bottom: 1rem; }

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #FBFDFC;
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover, .dropzone.has-file { border-color: var(--primary); background: var(--primary-soft); }

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dz-icon { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.dz-text { font-size: 0.92rem; color: var(--muted); }
.dz-text small { display: block; margin-top: 2px; }

/* ---------- Password strength ---------- */
.strength { height: 6px; border-radius: 999px; background: var(--line); margin-top: 8px; overflow: hidden; }
.strength-bar { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--line); transition: width 0.25s, background 0.25s; }

.strength-bar[data-level="1"] { width: 25%; background: #E5484D; }
.strength-bar[data-level="2"] { width: 50%; background: #F5A524; }
.strength-bar[data-level="3"] { width: 75%; background: #30A46C; }
.strength-bar[data-level="4"] { width: 100%; background: #0E7C66; }

/* ---------- Checkbox ---------- */
.check-label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 0.88rem !important; }
.check-label input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex: none; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary:hover { box-shadow: 0 8px 18px rgba(14, 124, 102, 0.35); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.65; cursor: wait; transform: none; }

.btn-secondary {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Field row (side-by-side on desktop) ---------- */
.field-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.field-row .field { flex: 1; min-width: 160px; }

/* ---------- Select ---------- */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235B6E67' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px !important;
}

/* ---------- GPS button ---------- */
.btn-gps {
  padding: 12px 14px;
  font-size: 1.2rem;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}
.btn-gps:hover { background: var(--primary); color: #fff; }
.btn-gps.loading { opacity: 0.5; cursor: wait; }

/* ---------- Photo previews ---------- */
.photo-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.photo-preview-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #F0F4F3;
}
.photo-preview-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-preview-item .remove-photo {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo-preview-item.cover::after {
  content: "Cover";
  position: absolute; bottom: 4px; left: 4px;
  background: var(--primary); color: #fff;
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.06em;
}

/* ---------- Video preview ---------- */
.video-preview { margin-top: 10px; }
.video-preview-item {
  position: relative;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line);
  background: #0B1F1A;
  max-width: 320px;
}
.video-preview-item video {
  width: 100%; display: block;
}
.video-preview-item .remove-video {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(179,38,30,0.9);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Flash messages ---------- */
.flash-msg {
  padding: 10px 16px; border-radius: 8px; margin-bottom: 16px;
  font-size: 0.92rem;
}
.flash-success { background: #D1FAE5; color: #064E3B; border: 1px solid #6EE7B7; }
.flash-info { background: #DBEAFE; color: #1E3A5F; border: 1px solid #93C5FD; }
.flash-error { background: #FDEBEA; color: #991B1B; border: 1px solid #FCA5A5; }

/* ---------- Screen-reader only ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ---------- Success ---------- */
.success-wrap { max-width: 640px; margin: 0 auto; }
.success-card { text-align: center; padding-top: 40px; padding-bottom: 40px; }
.success-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 2rem;
  line-height: 64px;
}
.steps { text-align: left; margin: 20px 0; padding-left: 22px; }
.steps li { margin-bottom: 10px; }

/* ---------- Legal ---------- */
.legal { max-width: 780px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 22px; }
@media (min-width: 600px) { .legal { padding: 36px 40px; } }
.legal h1 { margin-top: 0; }
.legal h2 { font-size: 1.05rem; margin-top: 26px; }
.legal .meta { color: var(--muted); font-size: 0.85rem; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 20px 16px 26px;
  font-size: 0.82rem;
  color: var(--muted);
  background: #0B1F1A;
  color: #9DB8AF;
}
.site-footer a { color: #CFE5DE; }
.footer-links { margin: 4px 0 0; }

/* ========================================================================
   Buyer search page — mobile-first
   ======================================================================== */

.buyer-page { width: 100%; }

/* ---- Search bar ---- */
.search-bar-wrap {
  background: #0B1F1A;
  padding: 14px 16px;
  position: sticky;
  top: 56px;
  z-index: 8;
}

.search-bar {
  display: flex;
  gap: 0;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.search-icon {
  flex: none;
  margin: 12px 0 12px 14px;
  color: var(--muted);
}

.search-input {
  flex: 1;
  border: none;
  padding: 12px 8px;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  outline: none;
  min-width: 0;
}

.search-input::placeholder { color: #9CA3AF; }

.search-btn {
  flex: none;
  padding: 10px 18px;
  margin: 4px 4px 4px 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

/* ---- Layout ---- */
.buyer-layout {
  display: flex;
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  min-height: 60vh;
}

/* ---- Filter panel (sidebar on desktop, slide-out on mobile) ---- */
.filter-panel {
  width: 260px;
  flex: none;
  padding: 20px 18px;
  background: var(--card);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  position: sticky;
  top: 116px;
  max-height: calc(100vh - 116px);
}

.filter-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.filter-header { display: flex; align-items: center; justify-content: space-between; }

.filter-close, .filter-toggle { display: none; }

.filter-group { margin-bottom: 16px; }

.filter-group label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 5px;
  color: var(--ink);
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 9px 10px;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FBFDFC;
  color: var(--ink);
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.15);
}

.range-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.range-input { flex: 1; min-width: 0; }
.range-sep { color: var(--muted); font-size: 0.85rem; flex: none; }

.btn-filter-reset {
  width: 100%;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--muted);
  background: #F4F7F6;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-filter-reset:hover { background: #E8EDEB; }

/* ---- Results area ---- */
.results-area {
  flex: 1;
  min-width: 0;
  padding: 16px;
}

.results-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn-filter-open {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.results-count { font-size: 0.85rem; color: var(--muted); flex: 1; }

.sort-select {
  padding: 8px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
}

/* ---- Listing grid ---- */
.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 520px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
}

.property-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.property-card:hover {
  box-shadow: 0 8px 24px rgba(16,36,31,0.12);
  transform: translateY(-3px);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-image-wrap {
  position: relative;
  background: var(--primary-soft);
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--primary);
  opacity: 0.4;
}

.card-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(11,31,26,0.78);
  color: #fff;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-body { padding: 14px; }

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-location {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 0 0 8px;
}

.card-meta {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

.card-beds::before { content: '🛏 '; }
.card-baths::before { content: '🛁 '; }

/* ---- States ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h2 { font-size: 1.2rem; margin: 0 0 8px; color: var(--ink); }
.empty-state p { margin: 0; }

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Mobile: filter as slide-out ---- */
@media (max-width: 759px) {
  .search-bar-wrap { top: 48px; padding: 10px 12px; }

  .filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 2px solid var(--line);
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    padding: 20px;
    top: 0;
  }

  .filter-panel.open { transform: translateX(0); }

  .filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
  }

  .filter-close {
    display: block;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
  }

  .btn-filter-open {
    display: flex;
  }

  .results-area { padding: 12px; }
}


/* ========================================================================
   Property Detail page
   ======================================================================== */

.detail-page { max-width: 1100px; margin: 0 auto; }

.detail-nav { padding: 12px 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary-dark); text-decoration: none; font-weight: 600;
  font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }

/* Gallery */
.detail-gallery { margin-bottom: 20px; }
.gallery-main {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  background: #0B1F1A; border-radius: var(--radius);
  overflow: hidden;
}
.gallery-hero {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: var(--primary-soft); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--muted);
}
.gallery-placeholder-icon { font-size: 4rem; opacity: 0.4; }

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  font-size: 1.8rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background 0.15s;
}
.gallery-nav:hover { background: rgba(0,0,0,0.75); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-video-badge {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: rgba(179,38,30,0.9); color: #fff;
  border-radius: 8px; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; z-index: 2;
}
.gallery-video-badge:hover { background: var(--danger); }

.gallery-thumbs {
  display: flex; gap: 8px; margin-top: 10px; overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumb {
  flex: none; width: 80px; height: 60px; border-radius: 8px;
  overflow: hidden; border: 2px solid transparent; cursor: pointer;
  padding: 0; background: var(--line);
}
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Video overlay (lightbox) */
.video-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  z-index: 100; display: flex; align-items: center; justify-content: center;
}
.video-overlay[hidden] {
  display: none;
}
.gallery-thumb-video {
  position: relative;
  background: #0f1b2e;
  border: 1px solid var(--line);
  overflow: hidden;
}
.thumb-play-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 27, 46, 0.35);
}
.thumb-play-badge svg {
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.45); border-radius: 50%; padding: 4px;
  box-sizing: content-box;
}
.thumb-video-label {
  position: absolute; bottom: 4px; left: 0; right: 0;
  text-align: center; font-size: 10px; font-weight: 700;
  color: #fff; text-transform: uppercase; letter-spacing: 0.5px;
}
.gallery-video-poster {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(160deg, #1e3a5f, #0f1b2e);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer; color: #fff; border-radius: var(--radius);
}
.gallery-poster-play {
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
}
.gallery-poster-play svg { margin-left: 6px; }
.gallery-video-poster p { font-weight: 600; font-size: 0.95rem; }
.gallery-video-poster:hover .gallery-poster-play { background: rgba(255,255,255,0.28); }
.gallery-hero[hidden] { display: none; }
.gallery-video-poster[hidden] { display: none; }
.video-container {
  position: relative; width: 90%; max-width: 960px;
}
.video-player {
  width: 100%; border-radius: 12px; display: block;
}
.video-close {
  position: absolute; top: -40px; right: 0;
  background: none; border: none; color: #fff; font-size: 2rem;
  cursor: pointer; line-height: 1;
}

/* Detail content layout */
.detail-content {
  display: grid; grid-template-columns: 1fr; gap: 24px;
}
@media (min-width: 820px) {
  .detail-content { grid-template-columns: 1fr 340px; }
}
.detail-main { min-width: 0; }

.detail-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.detail-type-badge {
  padding: 3px 10px; font-size: 0.75rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.detail-status {
  padding: 3px 10px; font-size: 0.75rem; font-weight: 700;
  border-radius: 6px;
}
.detail-status.active { background: #D1FAE5; color: #064E3B; }
.detail-status.sold { background: #FDEBEA; color: #dc2626; }
.detail-status.rented { background: #EDE9FE; color: #5a3d99; }

.detail-sold-banner {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px; border-radius: 10px; margin: 14px 0;
  font-size: 0.95rem; border: 1px solid;
}
.detail-sold-banner.sold { background: #FDEBEA; border-color: #f5c6c6; color: #7f1d1d; }
.detail-sold-banner.rented { background: #EDE9FE; border-color: #d8cdf0; color: #472e7a; }
.detail-sold-banner span { font-size: 0.82rem; opacity: 0.8; }

.detail-title {
  font-size: 1.6rem; margin: 0 0 6px; line-height: 1.25;
}
@media (min-width: 820px) { .detail-title { font-size: 2rem; } }

.detail-location {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 0.95rem; margin: 0 0 12px;
}

.detail-price-row {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px;
}
.detail-price {
  font-size: 1.8rem; font-weight: 800; color: var(--primary-dark);
}
.detail-price-lrd {
  font-size: 1.1rem; color: var(--muted); font-weight: 600;
}

.detail-specs {
  display: flex; gap: 24px; padding: 16px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.detail-spec { text-align: center; }
.spec-value { display: block; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.spec-label { display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }

.detail-description { margin-bottom: 20px; }
.detail-description h2 { font-size: 1.1rem; margin: 0 0 8px; }
.detail-description p { color: var(--muted); line-height: 1.7; margin: 0; }

.detail-actions {
  display: flex; gap: 12px; margin-bottom: 20px;
}

.btn-favorite, .btn-share {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  transition: all 0.15s;
}
.btn-favorite:hover, .btn-share:hover { background: var(--bg); }
.btn-favorite.favorited { background: #FDEBEA; color: var(--danger); border-color: #F3C1BD; }
.btn-favorite.favorited svg { fill: var(--danger); }

/* Detail sidebar */
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; }

.detail-map {
  width: 100%; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
}
.detail-map .map-placeholder {
  width: 100%; height: 220px; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
}

.detail-contact-card {
  background: var(--primary-soft); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--line);
}
.detail-contact-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.detail-contact-card p { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }

.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; margin-bottom: 10px;
  background: #25d366; color: #fff; font-weight: 700; font-size: 0.9rem;
  border: none; border-radius: 10px; text-decoration: none; cursor: pointer;
}
.btn-whatsapp:hover { background: #1eb958; }
.btn-whatsapp svg { flex-shrink: 0; }

.btn-contact {
  width: 100%; padding: 12px; font-weight: 700; font-size: 0.9rem;
  border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.btn-contact:hover { opacity: 0.9; }

.contact-info { margin-top: 12px; }
.contact-note { color: var(--muted); font-size: 0.85rem; }


/* ========================================================================
   Video badge on search cards
   ======================================================================== */

.card-video-badge {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(179,38,30,0.9); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; z-index: 2;
}

.card-reserved-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(245,158,11,0.92); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: .02em;
  z-index: 2;
}


/* ========================================================================
   Map page
   ======================================================================== */

.map-page { width: 100%; height: calc(100vh - 56px - 56px); display: flex; flex-direction: column; }

.map-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.map-stats { font-size: 0.85rem; color: var(--muted); flex: 1; }
.map-controls { display: flex; align-items: center; gap: 10px; }

.map-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--ink);
}
.map-btn:hover { background: var(--bg); }

.radius-control { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.radius-control input[type="range"] { width: 100px; accent-color: var(--primary); }

.map-container-wrap {
  display: flex; flex: 1; min-height: 0;
}
.map-container {
  flex: 1; min-width: 0; background: var(--primary-soft);
}
.map-loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--muted);
}

.map-sidebar {
  width: 320px; flex: none; border-left: 1px solid var(--line);
  background: var(--card); overflow-y: auto; display: flex; flex-direction: column;
}
@media (max-width: 759px) {
  .map-page { height: calc(100vh - 48px - 48px); }
  .map-sidebar { display: none; }
  .map-toolbar { padding: 6px 10px; }
}

.map-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.map-sidebar-header h3 { font-size: 0.95rem; margin: 0; }
.map-sidebar-count {
  font-size: 0.8rem; color: var(--muted); background: var(--bg);
  padding: 2px 10px; border-radius: 999px;
}

.map-sidebar-list { padding: 8px 12px; flex: 1; overflow-y: auto; }
.map-sidebar-empty { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 24px 12px; }

.sidebar-property { border-bottom: 1px solid var(--line); }
.sidebar-property:last-child { border-bottom: none; }

.sidebar-prop-link {
  display: flex; gap: 10px; padding: 10px 0; text-decoration: none; color: inherit;
}
.sidebar-prop-link:hover { opacity: 0.85; }

.sidebar-prop-image {
  flex: none; width: 80px; height: 60px; border-radius: 8px;
  overflow: hidden; background: var(--primary-soft);
}
.sidebar-prop-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.sidebar-prop-placeholder {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center;
  font-size: 1.5rem; opacity: 0.4;
}

.sidebar-prop-info { min-width: 0; }
.sidebar-prop-info h4 {
  font-size: 0.85rem; margin: 0 0 2px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-prop-loc { font-size: 0.75rem; color: var(--muted); margin: 0; }
.sidebar-prop-price { font-size: 0.9rem; font-weight: 700; color: var(--primary-dark); margin: 2px 0; }
.sidebar-prop-meta { font-size: 0.7rem; color: var(--muted); margin: 0; }

/* Leaflet popup tweaks */
.map-popup { font-size: 0.85rem; line-height: 1.5; }
.map-popup strong { font-size: 0.9rem; }


/* ========================================================================
   Video feed page
   ======================================================================== */

.video-page { max-width: 1100px; margin: 0 auto; }

.video-hero { text-align: center; padding: 24px 16px 16px; }
.video-hero h1 { font-size: 1.6rem; margin: 0 0 6px; }
.video-hero p { color: var(--muted); margin: 0; }

.video-filters {
  display: flex; gap: 10px; max-width: 500px;
  margin: 0 auto 20px; padding: 0 16px;
}
.video-filters .filter-select,
.video-filters .filter-input {
  flex: 1; padding: 8px 10px; font-size: 0.88rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; padding: 0 16px 24px;
}

.video-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.video-card:hover {
  box-shadow: 0 8px 24px rgba(16,36,31,0.12);
  transform: translateY(-2px);
}

.video-card-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #0B1F1A; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.video-play-btn {
  position: absolute; z-index: 2;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0,0,0,0.6); display: flex;
  align-items: center; justify-content: center;
  transition: background 0.15s;
}
.video-card-thumb:hover .video-play-btn { background: rgba(179,38,30,0.9); }
.video-thumb-bg {
  font-size: 3rem; opacity: 0.3; color: var(--primary);
}

.video-card-body { padding: 14px; }
.video-card-title {
  font-size: 0.95rem; margin: 0 0 4px; font-weight: 700;
}
.video-card-title a { color: var(--ink); text-decoration: none; }
.video-card-title a:hover { color: var(--primary-dark); }
.video-card-loc { font-size: 0.8rem; color: var(--muted); margin: 0 0 6px; }
.video-card-price {
  font-size: 1.1rem; font-weight: 800; color: var(--primary-dark); margin: 0 0 4px;
}
.video-card-meta { font-size: 0.75rem; color: var(--muted); margin: 0; }

.video-load-more { text-align: center; padding: 0 16px 24px; }
.btn-load-more {
  padding: 10px 32px; font-weight: 700; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); cursor: pointer;
}
.btn-load-more:hover { background: var(--bg); }

/* Video lightbox */
.video-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 100; display: flex; align-items: center; justify-content: center;
}
.video-lightbox[hidden] {
  display: none;
}
.video-lightbox-inner {
  position: relative; width: 90%; max-width: 900px;
}
.video-lightbox-player {
  width: 100%; border-radius: 12px; display: block; max-height: 80vh;
}
.video-lightbox-close {
  position: absolute; top: -40px; right: 0;
  background: none; border: none; color: #fff; font-size: 2rem;
  cursor: pointer; line-height: 1;
}
.video-lightbox-info {
  color: #fff; font-size: 0.9rem; margin-top: 10px; text-align: center;
}


/* ========================================================================
   Favorites section & Alert signup
   ======================================================================== */

.favorites-section {
  margin-top: 32px; padding-top: 20px;
  border-top: 2px solid var(--line);
}
.favorites-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.favorites-header h2 { font-size: 1.15rem; margin: 0; }
.favorites-count {
  font-size: 0.82rem; color: var(--muted);
  background: var(--bg); padding: 3px 12px; border-radius: 999px;
}

.alert-signup { margin-top: 32px; }
.alert-signup-card {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; padding: 20px;
  background: var(--primary-soft); border-radius: var(--radius);
  border: 1px solid var(--line);
}
.alert-signup-icon { font-size: 2.2rem; flex: none; }
.alert-signup-text { flex: 1; min-width: 200px; }
.alert-signup-text h3 { font-size: 1rem; margin: 0 0 4px; }
.alert-signup-text p { font-size: 0.82rem; color: var(--muted); margin: 0; }

.alert-signup-form {
  display: flex; gap: 8px; flex: 1; min-width: 250px;
}
.alert-email-input {
  flex: 1; padding: 10px 14px; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink);
  min-width: 0;
}
.btn-alert-submit {
  padding: 10px 20px; font-weight: 700; font-size: 0.88rem;
  border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; white-space: nowrap;
}
.btn-alert-submit:hover { opacity: 0.9; }

.alert-signup-status { flex-basis: 100%; margin: 8px 0 0; font-size: 0.85rem; }
