/* ===== Header / nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-8);
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h-mobile);
}
@media (min-width: 720px) {
  .site-header .inner {
    height: var(--header-h-desktop);
  }
}
.site-header .brand {
  display: inline-flex;
  align-items: center;
  border: none;
  line-height: 0;
  /* Subtle hover lift on the wordmark */
  transition: opacity var(--dur-fast) var(--ease-out);
}
.site-header .brand:hover {
  opacity: 0.85;
}
.site-header .brand img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 60vw;
}
@media (min-width: 720px) {
  .site-header .brand img {
    height: 44px;
  }
}
.site-header nav {
  display: none;
  gap: var(--s-6);
  align-items: center;
}
@media (min-width: 720px) {
  .site-header nav {
    display: flex;
  }
}
.site-header nav a {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: none;
}
.site-header nav a:hover {
  color: var(--color-bronze-bright);
}

/* ===== Footer ===== */
.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--surface-8);
  background: var(--surface-0);
  padding: var(--s-8) 0;
  color: var(--text-faint);
  font-size: 12px;
  margin-top: var(--s-10);
}
.site-footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  justify-content: space-between;
}
.site-footer a {
  color: var(--text-muted);
  border: none;
}
.site-footer .brand {
  color: var(--text-primary);
  font-family: var(--font-serif);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  min-height: 44px;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: 2px solid var(--color-bronze-bright);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--color-bronze);
  color: var(--text-on-bronze);
}
.btn-primary:hover {
  background: var(--color-bronze-bright);
  border-bottom: 1px solid transparent;
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--surface-8);
}
.btn-secondary:hover {
  border-color: var(--color-bronze);
  color: var(--color-bronze-bright);
}
.btn-ghost {
  background: transparent;
  color: var(--color-bronze-bright);
  padding: 10px 14px;
  letter-spacing: 0.05em;
}
.btn-ghost:hover {
  background: var(--color-bronze-tint);
}
.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  min-height: 36px;
}
.btn-lg {
  padding: 18px 36px;
  font-size: 15px;
}
.btn-block {
  width: 100%;
}

.link-underline {
  position: relative;
  border: none;
  padding-bottom: 2px;
  color: var(--text-primary);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-bronze);
  transform-origin: left center;
  transition: transform var(--dur-base) var(--ease-out);
}
.link-underline:hover::after {
  transform: scaleX(1.06);
}

/* ===== Forms ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--s-5);
}

/* "or" divider between the password and magic-link sign-in forms. */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: var(--s-5) 0;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(160, 122, 68, 0.18);
}
.field label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.field .hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
}
.field .error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 4px;
}
.input,
.textarea,
.select {
  background: var(--surface-2);
  border: 1px solid var(--surface-8);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  width: 100%;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--color-bronze);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(160, 122, 68, 0.15);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}
.textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}
.field.has-error .input {
  border-color: var(--color-danger);
}

.checkbox,
.radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out);
}
.checkbox:hover,
.radio:hover {
  background: var(--surface-3);
}
.checkbox input,
.radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-bronze);
  margin-top: 2px;
  flex-shrink: 0;
}
.checkbox .body,
.radio .body {
  display: flex;
  flex-direction: column;
}
.checkbox strong,
.radio strong {
  color: var(--text-primary);
  font-weight: 500;
}
.checkbox small,
.radio small {
  color: var(--text-muted);
  font-size: 13px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--surface-8);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.stepper button {
  background: var(--surface-2);
  border: none;
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
}
.stepper button:hover {
  background: var(--surface-4);
}
.stepper .val {
  padding: 0 20px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 40px;
  text-align: center;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}
.badge-guest {
  background: var(--surface-4);
  color: var(--text-muted);
}
.badge-insider {
  background: rgba(160, 122, 68, 0.15);
  color: var(--color-bronze-bright);
  border: 1px solid var(--color-bronze);
}
.badge-resident {
  background: linear-gradient(135deg, rgba(200, 154, 90, 0.2), rgba(160, 122, 68, 0.1));
  color: var(--tier-resident);
  border: 1px solid var(--tier-resident);
}
.badge-success {
  background: rgba(110, 163, 106, 0.15);
  color: var(--color-success);
}
.badge-warning {
  background: rgba(212, 162, 74, 0.15);
  color: var(--color-warning);
}
.badge-danger {
  background: rgba(201, 93, 74, 0.15);
  color: var(--color-danger);
}
.badge-info {
  background: rgba(107, 143, 181, 0.15);
  color: var(--color-info);
}
.badge-neutral {
  background: var(--surface-4);
  color: var(--text-muted);
}

/* ===== Cards ===== */
.card {
  background: var(--surface-6);
  border: 1px solid var(--surface-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out);
}
.card:hover {
  border-color: var(--color-bronze);
}
.card-image {
  aspect-ratio: 4 / 3;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body {
  padding: var(--s-5);
}
.card-eyebrow {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-bronze);
  margin-bottom: var(--s-2);
  display: block;
}

/* ===== Alerts ===== */
.alert {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-bottom: var(--s-4);
  font-size: 14px;
  line-height: 1.5;
}
/* `.alert` uses `display: flex` which overrides the browser default
   `[hidden] { display: none }`. Re-assert hidden so the JS pattern
   `el.hidden = true/false` actually toggles visibility. */
.alert[hidden] {
  display: none;
}
.alert-info {
  background: rgba(107, 143, 181, 0.1);
  border-left: 3px solid var(--color-info);
  color: var(--text-secondary);
}
.alert-success {
  background: rgba(110, 163, 106, 0.1);
  border-left: 3px solid var(--color-success);
  color: var(--text-secondary);
}
.alert-warning {
  background: rgba(212, 162, 74, 0.1);
  border-left: 3px solid var(--color-warning);
  color: var(--text-secondary);
}
.alert-danger {
  background: rgba(201, 93, 74, 0.1);
  border-left: 3px solid var(--color-danger);
  color: var(--text-secondary);
}
.alert strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

/* ===== Progress / step indicator ===== */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--s-6);
}
.step-indicator .step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-4);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.step-indicator .step.done {
  background: var(--color-bronze);
  color: var(--text-on-bronze);
}
.step-indicator .step.active {
  background: var(--color-bronze-bright);
  color: var(--text-on-bronze);
  box-shadow: 0 0 0 3px rgba(160, 122, 68, 0.2);
}
.step-indicator .bar {
  flex: 1;
  height: 2px;
  background: var(--surface-4);
}
.step-indicator .bar.done {
  background: var(--color-bronze);
}

.progress {
  height: 4px;
  background: var(--surface-4);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--color-bronze);
  transition: width var(--dur-base) var(--ease-out);
}

/* ===== Hero ===== */
.hero {
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.45), rgba(10, 10, 10, 0.9)),
    #1e1e1e center/cover no-repeat;
  padding: var(--s-10) var(--s-4);
  text-align: center;
  border-bottom: 1px solid var(--surface-8);
}
.hero h6 {
  margin-bottom: var(--s-3);
}
.hero h1 {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
  max-width: 18ch;
  margin: 0 auto var(--s-4);
}
.hero p {
  max-width: 52ch;
  margin: 0 auto var(--s-6);
  color: var(--text-secondary);
  font-family: var(--font-editorial);
  font-size: 16px;
  line-height: 1.8;
}
/* =========================================================
   Image lightbox — shared across pages with galleries.
   ---------------------------------------------------------
   Hidden by default. JS toggles `[data-open="true"]` on the
   root which fades in the backdrop and zooms the image in.
   ESC, click-backdrop, ← / →, and tap-to-close are wired by
   the consuming page (public-site.js on /resort; an inline
   driver on /villas/info/:slug).
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 8, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base);
  padding: var(--s-5);
}
.lightbox[data-open='true'] {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-base) var(--ease-out);
}
.lightbox__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: min(94vw, 1600px);
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  background: var(--surface-2);
  transform: scale(0.97);
  transition: transform var(--dur-base) var(--ease-out);
}
.lightbox[data-open='true'] .lightbox__img {
  transform: scale(1);
}
.lightbox__btn {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.lightbox__btn:hover,
.lightbox__btn:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--color-bronze-soft);
  outline: none;
}
.lightbox__btn:active {
  transform: scale(0.96);
}
.lightbox__btn--close {
  top: var(--s-5);
  right: var(--s-5);
}
.lightbox__btn--prev {
  left: var(--s-5);
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__btn--next {
  right: var(--s-5);
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__btn--prev:active,
.lightbox__btn--next:active {
  transform: translateY(-50%) scale(0.96);
}
.lightbox__counter {
  position: absolute;
  bottom: var(--s-5);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
@media (max-width: 600px) {
  .lightbox__btn--prev {
    left: var(--s-3);
  }
  .lightbox__btn--next {
    right: var(--s-3);
  }
  .lightbox__btn--close {
    top: var(--s-3);
    right: var(--s-3);
  }
}
/* Lock background scroll while lightbox is open */
body.lightbox-open {
  overflow: hidden;
}
