:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --text: #142033;
  --muted: #627086;
  --line: #dbe1ea;
  --primary: #246bfe;
  --primary-dark: #174fc0;
  --accent: #e68a00;
  --success: #168a4a;
  --warning: #b86a00;
  --danger: #c0392b;
  --shadow: 0 18px 45px rgba(18, 31, 54, 0.12);
  --radius: 22px;
}

body.dark {
  --bg: #0b1020;
  --surface: #11182b;
  --surface-2: #18223a;
  --text: #f4f7fb;
  --muted: #aab5c6;
  --line: #27344d;
  --primary: #6da2ff;
  --primary-dark: #8bb5ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(36, 107, 254, 0.13), transparent 35%),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(18px, 5vw, 72px);
  background: rgba(246, 247, 251, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

body.dark .topbar {
  background: rgba(11, 16, 32, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #6f4cff);
  color: white;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.nav-actions a:hover {
  color: var(--primary);
}

main {
  padding: 0 clamp(18px, 5vw, 72px) 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 32px;
  align-items: center;
  min-height: 470px;
}

.hero-visual {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 5.2vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
}

.hero-actions,
.filter-actions,
.view-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn {
  background: var(--primary);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(36, 107, 254, 0.28);
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
}

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.secondary-btn:hover,
.ghost-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.photo-carousel {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.carousel-viewport,
.carousel-track,
.carousel-slide {
  min-height: 290px;
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
}

.carousel-slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 290px;
  object-fit: cover;
}

.carousel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 16, 30, 0.72));
}

.carousel-slide figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  color: white;
  font-weight: 850;
  line-height: 1.25;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.42);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background: rgba(12, 18, 34, 0.46);
  color: white;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(12, 18, 34, 0.72);
}

.carousel-btn.prev {
  left: 14px;
}

.carousel-btn.next {
  right: 14px;
}

.carousel-dots {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  gap: 7px;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
}

.carousel-dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: white;
}

.stats-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.stats-card div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
}

body.dark .stats-card div {
  background: rgba(255, 255, 255, 0.03);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.stats-card strong {
  font-size: 2.3rem;
  letter-spacing: -0.05em;
}

.search-shell,
.results-section,
.info-section {
  margin-top: 26px;
}

.search-shell,
.results-section {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 32px);
  box-shadow: var(--shadow);
}

body.dark .search-shell,
body.dark .results-section {
  background: rgba(17, 24, 43, 0.76);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.muted {
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 16px;
  align-items: start;
}

label,
.field-group {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.field-group > label {
  display: block;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 107, 254, 0.12);
}

.autocomplete-field {
  position: relative;
}

.combo-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.combo-add {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.combo-add:hover,
.combo-add:focus {
  border-color: var(--primary);
  background: rgba(36, 107, 254, 0.1);
}

.suggestions {
  position: absolute;
  top: 78px;
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 224px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(18, 31, 54, 0.16);
}

.suggestions.is-open {
  display: grid;
  gap: 4px;
}

.suggestion-option {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggestion-option:hover,
.suggestion-option.is-highlighted {
  background: var(--surface-2);
  color: var(--primary);
}

.suggestion-option small {
  color: var(--muted);
  font-weight: 700;
}

.suggestion-empty {
  padding: 10px 11px;
  color: var(--muted);
  font-size: 0.86rem;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
}

.selected-tags:empty {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 7px;
  border: 1px solid rgba(36, 107, 254, 0.24);
  border-radius: 999px;
  padding: 6px 8px 6px 10px;
  background: rgba(36, 107, 254, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
}

.filter-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(36, 107, 254, 0.18);
  color: inherit;
  line-height: 1;
  cursor: pointer;
}

.filter-actions {
  align-items: end;
}

.status {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.property-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(18, 31, 54, 0.07);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(36, 107, 254, 0.12);
  color: var(--primary);
}

.badge.success {
  background: rgba(22, 138, 74, 0.12);
  color: var(--success);
}

.badge.warning {
  background: rgba(184, 106, 0, 0.12);
  color: var(--warning);
}

.property-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
}

.address {
  color: var(--muted);
  line-height: 1.45;
  min-height: 42px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price-box {
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-2);
}

.price-box span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.price-box strong {
  letter-spacing: -0.03em;
}

.description {
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.card-actions a,
.card-actions button {
  flex: 1;
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.info-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.info-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.info-card p {
  color: var(--muted);
  line-height: 1.6;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 30px clamp(18px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .filters {
    grid-template-columns: repeat(3, 1fr);
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .hero-visual {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar,
  .section-heading,
  footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .filters,
  .results-grid,
  .info-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 42px 0 20px;
  }

  .photo-carousel,
  .carousel-viewport,
  .carousel-track,
  .carousel-slide,
  .carousel-slide img {
    min-height: 230px;
  }

  .suggestions {
    position: static;
  }

  .price-row {
    grid-template-columns: 1fr;
  }
}
