/* =====================================================================
   HOMETOR — Real Estate & Direct Negotiation Platform
   Design System + Glassmorphism
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. THEME ENGINE — root variables
   --------------------------------------------------------------------- */
:root {
  /* Brand accent (shared) */
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-3: #06b6d4;
  --accent-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #06b6d4 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.18));

  /* Radius */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.18s var(--ease);
  --t-med: 0.32s var(--ease);
  --t-slow: 0.5s var(--ease);

  /* Layout */
  --header-h: 72px;
  --maxw: 1240px;

  /* Typography */
  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.35), 0 8px 30px rgba(37, 99, 235, 0.45);
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg: #030712;
  --bg-2: #0b1220;
  --panel: rgba(15, 23, 42, 0.85);
  --card: rgba(30, 41, 59, 0.45);
  --card-solid: #111827;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --glass-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 30px rgba(0, 0, 0, 0.45),
    0 30px 60px -20px rgba(0, 0, 0, 0.6);
  --chip: rgba(255, 255, 255, 0.06);
  --field-bg: rgba(15, 23, 42, 0.6);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(124, 58, 237, 0.18), transparent 70%);
  color-scheme: dark;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-2: #eef2f7;
  --panel: rgba(255, 255, 255, 0.85);
  --card: rgba(255, 255, 255, 0.65);
  --card-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --glass-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.6) inset,
    0 8px 30px rgba(15, 23, 42, 0.08),
    0 30px 60px -20px rgba(15, 23, 42, 0.12);
  --chip: rgba(15, 23, 42, 0.04);
  --field-bg: rgba(255, 255, 255, 0.7);
  --hero-glow: radial-gradient(60% 50% at 50% 0%, rgba(124, 58, 237, 0.12), transparent 70%);
  color-scheme: light;
}

/* ---------------------------------------------------------------------
   2. GLOBAL RESET & SPACING
   --------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* ensure content never slides under fixed header */
  padding-top: 90px;
  transition: background var(--t-med), color var(--t-med);
  overflow-x: hidden;
}

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

::selection { background: rgba(124, 58, 237, 0.35); color: #fff; }

/* Ambient background orbs */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
}
body::before {
  width: 520px; height: 520px;
  top: -120px; left: -120px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.45), transparent 70%);
}
body::after {
  width: 560px; height: 560px;
  top: 10%; right: -160px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.4), transparent 70%);
}
[data-theme="light"] body::before,
[data-theme="light"]::before { opacity: 0.35; }

/* ---------------------------------------------------------------------
   3. LAYOUT HELPERS
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.glass {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
}

/* ---------------------------------------------------------------------
   4. BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--r-pill);
  padding: 11px 20px;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
    background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(124, 58, 237, 0.45); }

.btn-glow {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-glow:hover { transform: translateY(-1px); }

.btn-ghost {
  background: var(--chip);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); background: rgba(127, 127, 127, 0.12); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 8px 14px; font-size: 0.84rem; }
.btn-block { width: 100%; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------------------------------------------------------------------
   5. FIXED GLASS HEADER & NAVIGATION
   --------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transition: background var(--t-med), border-color var(--t-med);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Nav links */
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--t-fast), background var(--t-fast);
}
.main-nav a:hover { color: var(--text); background: var(--chip); }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px;
  background: var(--accent-grad);
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: rotate(-12deg); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* Guest view */
.guest-actions { display: flex; align-items: center; gap: 8px; }

/* User view */
.user-view { display: none; align-items: center; gap: 10px; }
.user-view.is-visible { display: flex; }
.guest-actions.is-hidden { display: none; }

.avatar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  border-radius: var(--r-pill);
  background: var(--chip);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all var(--t-fast);
}
.avatar-pill:hover { border-color: var(--border-strong); }
.avatar-pill .name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  background: var(--accent-grad);
}

.menu-toggle { display: none; }

/* ---------------------------------------------------------------------
   6. HERO SECTION & GLASS SEARCH BAR
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  text-align: center;
  padding: 72px 24px 56px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero .container { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.glass-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--chip);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}
.glass-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 10px #22c55e; }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero .subtitle {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: var(--text-muted);
  max-width: 60ch;
}

/* Glass search bar grid */
.search-bar {
  margin-top: 8px;
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr auto;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-xl);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.search-field > .field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  width: 18px; height: 18px;
}
.search-field input,
.search-field select {
  width: 100%;
  height: 52px;
  padding: 0 14px 0 42px;
  border-radius: var(--r-md);
  background: var(--field-bg);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none;
}
.search-field select {
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.search-field input::placeholder { color: var(--text-dim); }
.search-field input:focus,
.search-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.search-bar .btn-glow {
  height: 52px;
  padding: 0 26px;
  border-radius: var(--r-md);
}

/* City chips */
.city-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 14px;
}
.city-chips a {
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--chip);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.city-chips a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ---------------------------------------------------------------------
   7. FEATURED RESIDENCES GRID & FILTERING
   --------------------------------------------------------------------- */
.section {
  padding: 56px 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.section-head .titles h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-head .titles p { color: var(--text-muted); margin-top: 4px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar .chip {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--chip);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.filter-bar .chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-bar .chip.is-active {
  color: #fff;
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}
.filter-bar .reset {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  transition: opacity var(--t-fast);
}
.filter-bar .reset:hover { opacity: 0.75; }

.residences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

/* Card */
.card {
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.card .img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--card-solid);
}
.card .img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.card:hover .img-wrap img { transform: scale(1.06); }
.price-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}
.tag-badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--accent-grad-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.74rem;
}
.card .card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .loc-line {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.card .loc-line svg { width: 14px; height: 14px; color: var(--accent); }
.card h3 { font-size: 1.06rem; font-weight: 700; line-height: 1.3; }
.card .desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .specs {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
}
.card .specs span { display: inline-flex; align-items: center; gap: 6px; }
.card .specs svg { width: 16px; height: 16px; color: var(--accent); }

/* Loading pulse cards */
.card.is-loading .img-wrap,
.card.is-loading .skeleton-line { background: var(--field-bg); position: relative; overflow: hidden; }
.card.is-loading .img-wrap { aspect-ratio: 4 / 3; }
.card.is-loading .skeleton-line {
  height: 14px; border-radius: 6px; margin-bottom: 10px;
}
.card.is-loading .skeleton-line.w70 { width: 70%; }
.card.is-loading .skeleton-line.w40 { width: 40%; height: 18px; }
.card.is-loading .skeleton-line:last-child { margin-bottom: 0; }
.card.is-loading .img-wrap::after,
.card.is-loading .skeleton-line::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px dashed var(--border-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.empty-state .icon-circle {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad-soft);
  color: var(--accent);
}
.empty-state .icon-circle svg { width: 32px; height: 32px; }
.empty-state h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); max-width: 42ch; margin: 0 auto 22px; }

/* ---------------------------------------------------------------------
   8. CTA BAND
   --------------------------------------------------------------------- */
.cta-band {
  margin: 24px 0 0;
  padding: 52px 40px;
  border-radius: var(--r-xl);
  text-align: center;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent-grad-soft);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; }
.cta-band p { color: var(--text-muted); margin: 10px auto 22px; max-width: 52ch; }

/* ---------------------------------------------------------------------
   9. MODALS & DASHBOARDS
   --------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.is-open { display: flex; animation: fade var(--t-med); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--r-xl);
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--glass-shadow);
  animation: pop var(--t-med);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

.modal-header {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  z-index: 2;
}
.modal-header h2 { font-size: 1.3rem; font-weight: 800; }
.modal-header .sub { color: var(--text-muted); font-size: 0.86rem; margin-top: 2px; }
.modal-close {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text); transform: rotate(90deg); border-color: var(--border-strong); }
.modal-body { padding: 22px 26px 26px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-pill);
  background: var(--chip);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}
.tabs button {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.tabs button.is-active { color: #fff; background: var(--accent-grad); box-shadow: 0 4px 14px rgba(124,58,237,0.3); }

/* Form fields */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-muted);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--field-bg);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-foot { margin-top: 8px; text-align: center; font-size: 0.84rem; color: var(--text-muted); }
.form-foot a { color: var(--accent); font-weight: 600; }

.divider-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Dashboard modal — wider, split pane */
.modal.modal-dashboard { max-width: 920px; }
.dash {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 520px;
}
.dash-sidebar {
  padding: 24px;
  border-right: 1px solid var(--border);
  background: var(--card);
  display: flex; flex-direction: column; gap: 18px;
}
.dash-profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.dash-profile .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.dash-profile .name { font-weight: 700; font-size: 1.05rem; }
.dash-profile .role { color: var(--text-muted); font-size: 0.82rem; }
.dash-profile .stats { display: flex; gap: 18px; margin-top: 6px; }
.dash-profile .stat { text-align: center; }
.dash-profile .stat b { display: block; font-size: 1.1rem; }
.dash-profile .stat span { font-size: 0.74rem; color: var(--text-dim); }

.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.dash-nav button svg { width: 18px; height: 18px; }
.dash-nav button:hover { background: var(--chip); color: var(--text); }
.dash-nav button.is-active { background: var(--accent-grad-soft); color: var(--text); border: 1px solid var(--border); }

.dash-content { padding: 24px; overflow: auto; }
.dash-pane { display: none; }
.dash-pane.is-active { display: block; animation: fade var(--t-med); }
.dash-pane h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }

/* Managed listings mini rows */
.mini-list { display: flex; flex-direction: column; gap: 12px; }
.mini-listing {
  display: flex; gap: 14px; align-items: center;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--border);
}
.mini-listing img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.mini-listing .ml-info { flex: 1; min-width: 0; }
.mini-listing .ml-info b { display: block; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-listing .ml-info span { font-size: 0.8rem; color: var(--text-muted); }
.mini-listing .ml-price { font-weight: 700; color: var(--accent); }

/* Chat list */
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast);
}
.chat-row:hover { border-color: var(--border-strong); }
.chat-row .avatar { width: 40px; height: 40px; }
.chat-row .chat-meta { flex: 1; min-width: 0; }
.chat-row .chat-meta b { font-size: 0.9rem; }
.chat-row .chat-meta p { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .chat-time { font-size: 0.74rem; color: var(--text-dim); }
.badge-count {
  background: var(--accent-grad);
  color: #fff;
  font-size: 0.7rem; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 5px;
  display: grid; place-items: center;
}

/* ---------------------------------------------------------------------
   10. ABOUT PAGE
   --------------------------------------------------------------------- */
.about-hero { padding: 56px 0 24px; text-align: center; }
.about-hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; max-width: 18ch; margin: 16px auto; }
.about-hero p { color: var(--text-muted); max-width: 60ch; margin: 0 auto; }

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.value-card {
  padding: 28px 24px;
  border-radius: var(--r-lg);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--glass-shadow);
  transition: transform var(--t-med), border-color var(--t-med);
}
.value-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.value-card .v-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-grad-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.value-card .v-icon svg { width: 24px; height: 24px; }
.value-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.value-card p { color: var(--text-muted); font-size: 0.9rem; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin: 16px 0;
}
.stat-card {
  text-align: center;
  padding: 28px 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.stat-card b { display: block; font-size: 2rem; font-weight: 800; }
.stat-card span { color: var(--text-muted); font-size: 0.88rem; }

/* ---------------------------------------------------------------------
   11. FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.site-footer .container { padding: 44px 24px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; max-width: 32ch; margin-top: 12px; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.9rem; padding: 5px 0; transition: color var(--t-fast); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 24px; text-align: center; color: var(--text-dim); font-size: 0.84rem; }

/* ---------------------------------------------------------------------
   12. RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .menu-toggle {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--chip);
    border: 1px solid var(--border);
    color: var(--text);
  }
  .search-bar { grid-template-columns: 1fr 1fr; }
  .search-bar .btn-glow { grid-column: 1 / -1; }
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar { border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .dash-profile { border-bottom: none; border-right: 1px solid var(--border); padding-right: 18px; padding-bottom: 0; }
  .dash-nav { flex: 1; flex-direction: row; flex-wrap: wrap; }
  .dash-nav button { width: auto; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { padding-top: 84px; }
  .hero { padding: 48px 16px 40px; }
  .container { padding: 0 16px; }
  .search-bar { grid-template-columns: 1fr; }
  .guest-actions .btn-outline { display: none; }
  .user-view .avatar-pill .name { display: none; }
  .avatar-pill { padding: 5px; }
  .field-row { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .site-footer .container { grid-template-columns: 1fr; }
  .residences-grid { grid-template-columns: 1fr; }
  .dash-sidebar { flex-direction: column; }
  .dash-profile { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 18px; width: 100%; }
  .dash-nav { flex-direction: column; }
  .dash-nav button { width: 100%; }
}

/* Mobile nav drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  z-index: 99;
  padding: 16px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-120%);
  transition: transform var(--t-med);
}
.mobile-drawer.is-open { transform: translateY(0); }
.mobile-drawer a { display: block; padding: 12px 14px; border-radius: var(--r-md); color: var(--text); font-weight: 600; }
.mobile-drawer a:hover { background: var(--chip); }

/* ---------------------------------------------------------------------
   11b. CONTACT PAGE
   --------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-info .glass { padding: 24px; border-radius: var(--r-lg); }
.contact-info h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.contact-info p { color: var(--text-muted); font-size: 0.92rem; }
.contact-info .info-row { display: flex; align-items: center; gap: 12px; }
.contact-info .info-row .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-grad-soft); color: var(--accent); flex: none; }
.contact-info .info-row .ic svg { width: 20px; height: 20px; }
.contact-form-card { padding: 28px; border-radius: var(--r-lg); }
.contact-form-card h2 { font-size: 1.5rem; font-weight: 800; }
.contact-form-card .sub { color: var(--text-muted); margin: 4px 0 22px; font-size: 0.92rem; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* Legal page prose */
.legal { padding: 56px 0; }
.legal .container { max-width: 820px; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
.legal .updated { color: var(--text-muted); font-size: 0.9rem; margin: 8px 0 32px; }
.legal h2 { font-size: 1.35rem; font-weight: 700; margin: 32px 0 12px; }
.legal h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 8px; }
.legal p { color: var(--text-muted); margin-bottom: 14px; }
.legal ul { margin: 0 0 14px 4px; color: var(--text-muted); }
.legal ul li { padding: 5px 0 5px 22px; position: relative; }
.legal ul li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.legal a { color: var(--accent); font-weight: 600; }
.legal .toc { padding: 20px 24px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); margin-bottom: 28px; }
.legal .toc b { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 8px; }
.legal .toc a { display: block; padding: 4px 0; font-weight: 500; color: var(--text-muted); }
.legal .toc a:hover { color: var(--text); }

/* ---------------------------------------------------------------------
   11c. FORM MESSAGES & MUTED NOTES
   --------------------------------------------------------------------- */
.form-msg { font-size: 0.84rem; min-height: 1em; margin: 4px 0 2px; color: var(--text-muted); }
.form-msg.error { color: #f87171; }
.form-msg.success { color: #34d399; }
.muted-note { color: var(--text-muted); font-size: 0.9rem; padding: 12px 4px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
