:root {
  --rv-forest: #173f35;
  --rv-forest-deep: #0b2720;
  --rv-gold: #b6803d;
  --rv-gold-soft: #eccd91;
  --rv-ink: #18231f;
  --rv-muted: #58645f;
  --rv-line: rgba(24, 35, 31, 0.1);
  --rv-surface: #ffffff;
  --rv-bg: #f7f8f5;
  --rv-radius: 1.25rem;
  --rv-shadow-sm: 0 6px 20px rgba(20, 47, 40, 0.06);
  --rv-shadow-md: 0 1.25rem 3rem rgba(20, 47, 40, 0.13);
}

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--rv-ink);
  background-color: var(--rv-bg);
}

/* Let the main content region grow so the footer rests at the bottom */
.villa-page-container {
  flex: 1 0 auto;
  padding-top: 1.75rem;
}

/* Accessible, consistent focus treatment */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(23, 63, 53, 0.55);
}

a:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--rv-gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ---------- Navigation ---------- */
.villa-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding-block: 1rem;
  background: rgba(247, 248, 245, 0.85);
  border-bottom: 1px solid var(--rv-line);
  backdrop-filter: blur(18px);
}

.villa-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #132a24;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.villa-brand:hover {
  color: #132a24;
}

.villa-brand > span:last-child > span {
  color: var(--rv-gold);
}

.villa-brand__mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  border-radius: 50%;
  background: var(--rv-forest);
}

.villa-navbar .nav-link {
  position: relative;
  margin-left: 1rem;
  color: var(--rv-muted);
  font-weight: 600;
  transition: color 160ms ease;
}

.villa-navbar .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.35rem;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--rv-gold);
  transition: width 200ms ease;
}

.villa-navbar .nav-link:hover,
.villa-navbar .nav-link:focus {
  color: var(--rv-forest);
}

.villa-navbar .nav-link:hover::after {
  width: 100%;
}

.villa-navbar__auth {
  gap: 0.35rem;
}

.villa-navbar__cta {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  padding: 0.5rem 1.25rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  background: var(--rv-forest);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.villa-navbar__cta:hover,
.villa-navbar__cta:focus {
  color: #fff;
  background: var(--rv-gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* ---------- Alerts ---------- */
.villa-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 1rem;
  box-shadow: var(--rv-shadow-sm);
}

.villa-alert__icon {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  font-weight: 800;
  border: 1px solid currentColor;
  border-radius: 50%;
}

/* ---------- Hero ---------- */
.villa-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 560px;
  overflow: hidden;
  padding: clamp(2.2rem, 7vw, 5.5rem);
  color: #fff;
  border-radius: 2rem;
  background:
    linear-gradient(90deg, rgba(11, 39, 32, 0.94) 0%, rgba(11, 39, 32, 0.75) 48%, rgba(11, 39, 32, 0.2) 100%),
    url("https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?auto=format&fit=crop&w=1800&q=85") center/cover;
  box-shadow: 0 28px 70px rgba(21, 48, 40, 0.18);
}

.villa-hero__content {
  position: relative;
  z-index: 2;
  max-width: 670px;
}

.villa-hero__eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--rv-gold-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.villa-hero__eyebrow span {
  display: inline-block;
  width: 2rem;
  height: 1px;
  margin-right: 0.75rem;
  vertical-align: middle;
  background: currentColor;
}

.villa-hero h1 {
  max-width: 620px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.villa-hero h1 em {
  color: #f2d29a;
  font-family: Georgia, serif;
  font-weight: 400;
}

.villa-hero p {
  max-width: 560px;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.15rem;
  line-height: 1.7;
}

.villa-hero__button {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.35rem;
  color: var(--rv-forest);
  font-weight: 700;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.villa-hero__button:hover {
  color: #fff;
  background: var(--rv-gold);
  transform: translateY(-2px);
}

.villa-hero__button span {
  margin-left: 0.65rem;
  font-size: 1.2rem;
  transition: transform 180ms ease;
}

.villa-hero__button:hover span {
  transform: translateX(4px);
}

.villa-hero__note {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
}

.villa-hero__stats {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  z-index: 2;
  display: flex;
  gap: 0.25rem;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.25rem;
  background: rgba(8, 29, 24, 0.58);
  backdrop-filter: blur(16px);
}

.villa-hero__stats div {
  display: flex;
  min-width: 110px;
  padding: 0.65rem 1rem;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.villa-hero__stats div:last-child {
  border-right: 0;
}

.villa-hero__stats strong {
  font-size: 1.15rem;
}

.villa-hero__stats span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}

.villa-hero__glow {
  position: absolute;
  z-index: 1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(5px);
  background: rgba(214, 174, 103, 0.12);
}

.villa-hero__glow--one {
  top: -180px;
  left: 35%;
}

.villa-hero__glow--two {
  right: -120px;
  bottom: -200px;
}

/* ---------- Section heading ---------- */
.section-eyebrow {
  display: block;
  margin-bottom: 0.55rem;
  color: #a36e2f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.villa-section-heading h2 {
  color: #142f28;
  letter-spacing: -0.045em;
}

.property-count {
  align-self: flex-start;
  padding: 0.55rem 0.9rem;
  color: #315d51;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid #d7e2dd;
  border-radius: 999px;
  background: #edf3f0;
}

/* ---------- Villa cards ---------- */
.villa-card {
  overflow: hidden;
  border-radius: var(--rv-radius);
  background: var(--rv-surface);
  box-shadow: var(--rv-shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: villa-card-in 480ms ease both;
}

.villa-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--rv-shadow-md) !important;
}

.villa-card__media {
  position: relative;
  overflow: hidden;
}

.villa-card__image {
  width: 100%;
  height: 245px;
  object-fit: cover;
  transition: transform 500ms ease;
}

.villa-card:hover .villa-card__image {
  transform: scale(1.05);
}

.villa-card__placeholder {
  display: grid;
  place-items: center;
  color: #6c757d;
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
}

.villa-card__label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.38rem 0.7rem;
  color: var(--rv-forest);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.villa-card__location {
  display: block;
  margin-bottom: 0.25rem;
  color: #a36e2f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.villa-card__rate {
  flex: 0 0 auto;
  text-align: right;
}

.villa-card__rate strong {
  display: block;
  color: var(--rv-forest);
  font-size: 1.1rem;
}

.villa-card__rate span {
  color: #89938f;
  font-size: 0.72rem;
}

.villa-card__details {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.65;
}

.villa-card__footer {
  border-top: 1px solid #edf0ee;
}

.villa-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #52605b;
  font-size: 0.875rem;
  font-weight: 600;
}

.villa-feature svg {
  width: 1rem;
  height: 1rem;
  fill: #a36e2f;
}

/* ---------- Empty state ---------- */
.villa-empty-state {
  color: #334155;
  border-style: dashed !important;
  background-color: #fff;
}

.villa-empty-state__icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  place-items: center;
  color: #fff;
  font-size: 1.7rem;
  border-radius: 50%;
  background: var(--rv-forest);
}

/* ---------- Footer ---------- */
.villa-footer {
  margin-top: 3rem;
  padding-block: 1.5rem;
  font-size: 0.875rem;
  border-top: 1px solid var(--rv-line);
}

.villa-footer a {
  color: #315d51;
  text-decoration: none;
}

.villa-footer a:hover {
  text-decoration: underline;
}

/* ---------- Manage villas table ---------- */
.villa-table-card {
  border-radius: var(--rv-radius);
  overflow: hidden;
}

.villa-table {
  --bs-table-bg: transparent;
}

.villa-table thead th {
  color: var(--rv-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rv-line);
}

.villa-table tbody td {
  padding-block: 1rem;
  vertical-align: middle;
}

.villa-table__thumb {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 0.75rem;
  background: #edf3f0;
}

.villa-table__thumb--empty {
  color: var(--rv-forest);
  font-size: 1.3rem;
}

/* ---------- Villa form ---------- */
.villa-form-card {
  border-radius: var(--rv-radius);
}

.villa-form-label {
  color: var(--rv-ink);
  font-weight: 600;
}

.villa-form-card .form-control,
.villa-form-card .input-group-text {
  border-color: #dbe2de;
}

.villa-form-card .form-control:focus {
  border-color: var(--rv-forest);
  box-shadow: 0 0 0 0.2rem rgba(23, 63, 53, 0.12);
}

.villa-form-card .input-group-text {
  color: var(--rv-muted);
  background: #f1f4f2;
}

.villa-preview {
  overflow: hidden;
  border-radius: 1rem;
  background: #edf3f0;
}

.villa-preview__image {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.d-none-empty:empty {
  display: none;
}

/* ---------- Delete confirmation ---------- */
.villa-delete__media {
  overflow: hidden;
  border-radius: var(--rv-radius) 0 0 var(--rv-radius);
}

.villa-delete__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
}

.villa-delete__facts dt {
  color: var(--rv-muted);
  font-weight: 600;
}

.villa-delete__facts dd {
  color: var(--rv-ink);
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .villa-delete__media {
    border-radius: var(--rv-radius) var(--rv-radius) 0 0;
  }
}

/* ---------- Motion ---------- */
@keyframes villa-card-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .villa-card:hover {
    transform: none;
  }

  .villa-card:hover .villa-card__image {
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
  .villa-hero {
    min-height: 540px;
    align-items: flex-start;
    border-radius: 1.25rem;
    background-position: 62% center;
  }

  .villa-hero__stats {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    justify-content: space-around;
  }

  .villa-hero__stats div {
    min-width: auto;
    padding-inline: 0.55rem;
  }

  .villa-hero__stats span {
    font-size: 0.62rem;
  }

  .villa-navbar .nav-link {
    margin-left: 0;
  }
}