/* ==========================================================================
   Behomu Apartments — base: tokens, reset, typography, layout, buttons, forms
   ========================================================================== */

:root {
  /* Brand palette */
  --c-charcoal: #202823;
  /* Primary = logo burnt orange (images/logo.png); accent = warm gold.
   * (Token names are historical: --c-forest* is the primary brand colour.) */
  --c-forest: #b45308;
  --c-forest-700: #8f4206;
  --c-forest-50: #fbf0e6;
  --c-gold: #c49a62;
  --c-gold-600: #835e2e;
  --c-gold-50: #f6efe4;
  --c-gold-light: #e8b27a; /* accent for text/icons on dark backgrounds */
  --c-ivory: #faf8f4;
  --c-sand: #f3efe8;
  --c-white: #ffffff;
  --c-text: #25302b;
  --c-muted: #626964; /* darkened from #777E79 for AA contrast on ivory */
  --c-border: #e8e4dd;
  --c-danger: #a8402c;
  --c-success: #2f6b4f;
  --c-overlay: rgba(20, 26, 22, 0.55);

  /* Typography */
  --f-serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --f-sans: "Inter", "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --fs-2xl: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  --fs-3xl: clamp(2.6rem, 1.7rem + 4.2vw, 5rem);

  /* Spacing & shape */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --section-y: clamp(4rem, 3rem + 4vw, 7.5rem);
  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --container: 1240px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(32, 40, 35, 0.06), 0 2px 8px rgba(32, 40, 35, 0.05);
  --shadow: 0 6px 24px rgba(32, 40, 35, 0.08), 0 2px 6px rgba(32, 40, 35, 0.04);
  --shadow-lg: 0 24px 60px rgba(32, 40, 35, 0.16);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 160ms;
  --t: 320ms;

  --header-h: 72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
video,
svg { display: block; max-width: 100%; }
img,
video { height: auto; }
button,
input,
select,
textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-forest); text-underline-offset: 3px; }
a:hover { color: var(--c-forest-700); }
p { margin: 0 0 var(--sp-4); }
ul,
ol { margin: 0; padding: 0; }
figure { margin: 0; }
address { font-style: normal; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--c-charcoal);
  color: var(--c-white);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--c-white); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  margin: 0 0 var(--sp-4);
  color: var(--c-charcoal);
  line-height: 1.15;
  font-weight: 600;
}
h1, h2, .serif {
  font-family: var(--f-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-md); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-gold-600);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}
.on-dark .eyebrow { color: var(--c-gold-light); }

.lead {
  font-size: var(--fs-md);
  color: var(--c-muted);
  max-width: 60ch;
}
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-sm); }
em.accent { font-style: italic; color: var(--c-forest); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 860px; }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--sand { background: var(--c-sand); }
.section--white { background: var(--c-white); }
.section--dark {
  background: var(--c-charcoal);
  color: rgba(255, 255, 255, 0.82);
}
.section--dark h2,
.section--dark h3 { color: var(--c-white); }
.section--dark .lead { color: rgba(255, 255, 255, 0.72); }

.section-head {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: var(--sp-7);
}
.section-head h2 { margin: 0; }
.section-head .lead { margin: 0; }
.section-head--center { text-align: center; justify-items: center; }
.section-head--split { align-items: end; }

.grid { display: grid; gap: var(--sp-5); }
.stack > * + * { margin-top: var(--sp-4); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--c-forest);
  --btn-fg: var(--c-white);
  --btn-bd: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.btn:hover {
  --btn-bg: var(--c-forest-700);
  color: var(--btn-fg);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(180, 83, 8, 0.22);
}
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--gold { --btn-bg: var(--c-forest); --btn-fg: var(--c-white); }
.btn--gold:hover { --btn-bg: var(--c-forest-700); box-shadow: 0 8px 20px rgba(180, 83, 8, 0.3); }
.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--c-charcoal);
  --btn-bd: rgba(32, 40, 35, 0.25);
}
.btn--outline:hover { --btn-bg: var(--c-charcoal); --btn-fg: var(--c-white); --btn-bd: var(--c-charcoal); box-shadow: none; }
.btn--ghost-light {
  --btn-bg: rgba(255, 255, 255, 0.08);
  --btn-fg: var(--c-white);
  --btn-bd: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
}
.btn--ghost-light:hover { --btn-bg: var(--c-white); --btn-fg: var(--c-charcoal); --btn-bd: var(--c-white); }
.btn--whatsapp { --btn-bg: #1f7a4d; }
.btn--whatsapp:hover { --btn-bg: #17603c; }
.btn--sm { min-height: 40px; padding: 0.5rem 1.1rem; font-size: var(--fs-xs); }
.btn--block { width: 100%; }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--c-forest);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--t-fast) var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.4rem; }
.field label,
.field .label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-charcoal);
}
.field .req { color: var(--c-danger); }
.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-white);
  color: var(--c-text);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 130px; resize: vertical; }
/* Date fields: iOS Safari gives them an intrinsic width and no empty-state text. */
input[type="date"].input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: block;
  min-width: 0;
  max-width: 100%;
  line-height: 1.4;
  text-align: left;
  padding-left: 0.75rem;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b45308' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 17px 17px;
}
input[type="date"].input::-webkit-date-and-time-value { margin: 0; min-height: 1.4em; text-align: left; }
input[type="date"].input::-webkit-calendar-picker-indicator {
  position: absolute; top: 0; right: 0;
  width: 2.2rem; height: 100%;
  margin: 0; padding: 0;
  opacity: 0;
  cursor: pointer;
}
.select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2325302b' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--c-forest);
  box-shadow: 0 0 0 3px rgba(180, 83, 8, 0.15);
}
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.field-error {
  min-height: 1em;
  font-size: var(--fs-xs);
  color: var(--c-danger);
}
.field-hint { font-size: var(--fs-xs); color: var(--c-muted); }
.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--c-forest); flex: none; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mb-0 { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
