:root {
  --rv-ink-950: #102a43;
  --rv-ink-800: #243b53;
  --rv-atlantic-700: #0f5d66;
  --rv-atlantic-600: #147985;
  --rv-moss-600: #34745a;
  --rv-coral-500: #dc7455;
  --rv-sand-50: #faf9f6;
  --rv-sand-100: #f3f0e9;
  --rv-slate-100: #edf1f4;
  --rv-slate-300: #c9d2da;
  --rv-slate-600: #526575;
  --rv-white: #ffffff;
  --rv-danger: #b42318;
  --rv-warning: #9a6700;
  --rv-success: #18794e;

  --rv-radius: 0.75rem;
  --rv-radius-sm: 0.4rem;
  --rv-shadow: 0 12px 40px rgba(16, 42, 67, 0.12);
  --rv-font-display: "Fraunces", Georgia, serif;
  --rv-font-body: "Source Sans 3", "Segoe UI", sans-serif;

  --bp-sm: 36rem;
  --bp-md: 48rem;
  --bp-lg: 64rem;
  --bp-xl: 80rem;

  --display: clamp(2rem, 4vw, 3.75rem);
  --h1: clamp(1.75rem, 3vw, 2.75rem);
  --h2: clamp(1.35rem, 2vw, 2rem);
  --h3: 1.25rem;
  --body-lg: 1.125rem;
  --body: 1rem;
  --small: 0.875rem;
  --caption: 0.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--rv-font-body);
  font-size: var(--body);
  color: var(--rv-ink-950);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20, 121, 133, 0.18), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(220, 116, 85, 0.12), transparent 55%),
    linear-gradient(180deg, var(--rv-sand-50), #eef3f5 40%, var(--rv-sand-100));
  min-height: 100vh;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--rv-atlantic-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--rv-coral-500);
}

h1, h2, h3, .brand-mark {
  font-family: var(--rv-font-display);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--rv-ink-950);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(250, 249, 246, 0.86);
  border-bottom: 1px solid rgba(201, 210, 218, 0.7);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand-mark {
  font-size: 1.45rem;
  color: var(--rv-ink-950);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.brand-mark span {
  color: var(--rv-atlantic-600);
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.brand-logo img {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
}
.brand-logo--sidebar img {
  width: 3.25rem;
  height: 3.25rem;
}
.brand-logo--auth img {
  width: 4.5rem;
  height: 4.5rem;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav a {
  color: var(--rv-ink-800);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--small);
}
.nav a:hover { color: var(--rv-atlantic-600); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible {
  outline: 3px solid rgba(20, 121, 133, 0.45);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--rv-atlantic-700);
  color: white;
  box-shadow: 0 8px 20px rgba(15, 93, 102, 0.28);
}
.btn-primary:hover { background: var(--rv-atlantic-600); color: white; }
.btn-accent {
  background: var(--rv-coral-500);
  color: white;
  box-shadow: 0 8px 20px rgba(220, 116, 85, 0.28);
}
.btn-accent:hover { filter: brightness(1.05); color: white; }
.btn-ghost {
  background: transparent;
  color: var(--rv-ink-800);
  border: 1px solid var(--rv-slate-300);
}
.btn-sm { padding: 0.45rem 0.85rem; font-size: var(--small); }

.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: white;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 42, 67, 0.15) 0%, rgba(16, 42, 67, 0.72) 55%, rgba(16, 42, 67, 0.92) 100%),
    linear-gradient(120deg, rgba(15, 93, 102, 0.55), rgba(16, 42, 67, 0.2)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%230f5d66'/%3E%3Cstop offset='1' stop-color='%23102a43'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect fill='url(%23g)' width='1600' height='900'/%3E%3Cpath fill='%23147985' opacity='.35' d='M0 560c180-90 320-40 480-70s280-120 460-90 300 120 460 90 200-80 200-80v400H0z'/%3E%3Cpath fill='%23dc7455' opacity='.18' d='M0 680c220-60 360 20 560-20s340-90 520-40 320 70 520 40v260H0z'/%3E%3C/svg%3E") center/cover no-repeat;
  z-index: -1;
  animation: heroDrift 18s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.08) translateY(-1.5%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__bg { animation: none; }
  .btn:hover { transform: none; }
}

.hero__content {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 3.5rem;
}
.hero__brand {
  margin: 0 0 0.75rem;
}
.hero__logo {
  display: block;
  width: clamp(7.5rem, 18vw, 13.5rem);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}
.hero__lead {
  max-width: 36rem;
  font-size: var(--body-lg);
  color: rgba(255,255,255,0.9);
  margin: 0 0 1.5rem;
}

.search-panel {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  background: rgba(255,255,255,0.96);
  color: var(--rv-ink-950);
  padding: 1rem;
  border-radius: var(--rv-radius);
  box-shadow: var(--rv-shadow);
  border-left: 5px solid var(--rv-coral-500);
}
@media (min-width: 48rem) {
  .search-panel {
    grid-template-columns: 140px 1fr 1fr auto;
    align-items: end;
  }
}
.field { display: grid; gap: 0.3rem; }
.field label { font-size: var(--caption); font-weight: 700; color: var(--rv-slate-600); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius-sm);
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: white;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(20, 121, 133, 0.25);
  border-color: var(--rv-atlantic-600);
}

.section {
  padding: 3rem 0;
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section__head h2 { margin: 0; font-size: var(--h2); }
.section__head p { margin: 0.3rem 0 0; color: var(--rv-slate-600); }

.property-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 36rem) {
  .property-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .property-grid { grid-template-columns: repeat(3, 1fr); }
}

.property-card {
  display: grid;
  grid-template-rows: 180px auto;
  background: transparent;
  border: 0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}
.property-card:hover { transform: translateY(-3px); }
.property-card__media {
  border-radius: var(--rv-radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--rv-atlantic-700), var(--rv-ink-950));
  position: relative;
}
.property-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.property-card__badge {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  background: rgba(16,42,67,0.82);
  color: white;
  font-size: var(--caption);
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.property-card__body { padding: 0.85rem 0.15rem 0; }
.property-card__price {
  font-family: var(--rv-font-display);
  font-size: 1.35rem;
  margin: 0;
}
.property-card__title {
  margin: 0.2rem 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.property-card__meta {
  color: var(--rv-slate-600);
  font-size: var(--small);
  margin: 0;
}

.search-layout {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem 0 3rem;
}
@media (min-width: 64rem) {
  .search-layout {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
}
.filters {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius);
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
#map {
  height: 520px;
  border-radius: var(--rv-radius);
  border: 1px solid var(--rv-slate-300);
}

.detail-layout {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem 0 3rem;
}
@media (min-width: 64rem) {
  .detail-layout {
    grid-template-columns: 1.6fr 0.9fr;
    align-items: start;
  }
}
.gallery {
  display: grid;
  gap: 0.5rem;
}
.gallery__main {
  aspect-ratio: 16/10;
  border-radius: var(--rv-radius);
  overflow: hidden;
  background: var(--rv-ink-950);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.4rem;
}
.gallery__thumbs button {
  border: 2px solid transparent;
  padding: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  cursor: pointer;
  background: none;
}
.gallery__thumbs button[aria-current="true"] { border-color: var(--rv-atlantic-600); }
.gallery__thumbs img { width: 100%; height: 64px; object-fit: cover; }

.contact-box {
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius);
  padding: 1.1rem;
  position: sticky;
  top: 5rem;
}
.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  list-style: none;
}
.feature-list li {
  background: var(--rv-slate-100);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: var(--small);
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--rv-slate-300);
  padding: 2rem 0;
  color: var(--rv-slate-600);
  font-size: var(--small);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.auth-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius);
  padding: 1.5rem;
  box-shadow: var(--rv-shadow);
}
.auth-card h1 {
  margin-top: 0;
  font-size: var(--h2);
}
.stack { display: grid; gap: 0.85rem; }
.muted { color: var(--rv-slate-600); }
.alert {
  padding: 0.75rem 0.9rem;
  border-radius: var(--rv-radius-sm);
  background: #fef3f2;
  color: var(--rv-danger);
  font-size: var(--small);
}
.alert-success {
  background: #e8f7ef;
  color: var(--rv-success);
}

/* App panel */
.app-shell {
  display: grid;
  min-height: 100vh;
  background: var(--rv-sand-50);
}
@media (min-width: 64rem) {
  .app-shell { grid-template-columns: 240px 1fr; }
}
.app-sidebar {
  background: linear-gradient(180deg, var(--rv-ink-950), var(--rv-atlantic-700));
  color: white;
  padding: 1.25rem 1rem;
}
.app-sidebar a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  font-weight: 600;
}
.app-sidebar a:hover, .app-sidebar a[aria-current="page"] {
  background: rgba(255,255,255,0.12);
  color: white;
}
.app-sidebar .brand-mark { color: white; margin-bottom: 1.5rem; display: inline-block; }
.app-sidebar .brand-logo { margin-bottom: 1.5rem; }
.app-main { padding: 1.25rem; }
.app-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--rv-radius);
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--rv-slate-100);
  font-size: var(--small);
}
.table th { background: var(--rv-slate-100); }
.stats {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1.5rem;
}
.stat {
  background: white;
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius);
  padding: 1rem;
}
.stat strong {
  display: block;
  font-family: var(--rv-font-display);
  font-size: 1.8rem;
}
.chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--rv-slate-100);
  font-size: var(--caption);
  font-weight: 700;
}
.empty {
  padding: 2rem;
  text-align: center;
  color: var(--rv-slate-600);
  border: 1px dashed var(--rv-slate-300);
  border-radius: var(--rv-radius);
}

.import-review__head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.import-actions {
  background: white;
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--rv-shadow-sm, 0 1px 2px rgba(16, 42, 67, 0.06));
}
.import-actions__form {
  display: grid;
  gap: 0.85rem;
}
.import-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.import-listings {
  display: grid;
  gap: 1rem;
}
.import-listing {
  background: white;
  border: 1px solid var(--rv-slate-300);
  border-radius: var(--rv-radius);
  padding: 1rem 1.1rem;
}
.import-listing__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.import-listing__title {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
}
.import-listing__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.import-listing__grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 48rem) {
  .import-listing__grid {
    grid-template-columns: minmax(14rem, 18rem) 1fr;
  }
}
.import-listing__facts {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.import-listing__facts > div {
  display: grid;
  gap: 0.1rem;
}
.import-listing__facts dt {
  font-size: var(--caption);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rv-slate-600);
}
.import-listing__facts dd {
  margin: 0;
  font-weight: 700;
}
.import-listing__subtitle {
  margin: 0 0 0.35rem;
  font-size: var(--small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rv-slate-600);
}
.import-listing__description {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}
.import-listing__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}
.import-listing__thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.35rem;
  background: var(--rv-slate-100);
}
.import-listing__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.import-listing__raw {
  margin-top: 0.85rem;
  border-top: 1px solid var(--rv-slate-100);
  padding-top: 0.65rem;
}
.import-listing__raw summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--small);
}
.import-listing__raw pre {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: var(--rv-sand-50);
  border-radius: 0.5rem;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.4;
}
.chip--ok { background: #e4f5ec; color: var(--rv-success); }
.chip--bad { background: #fce8e6; color: var(--rv-danger); }
.chip--warn { background: #fff4d6; color: var(--rv-warning); }
.alert--error {
  background: #fce8e6;
  color: var(--rv-danger);
  border: 1px solid #f3c0ba;
}
