/* ============================================================
   DUTTO HOMES — design system
   Deep teal + warm gold · Fraunces display · DM Sans body
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --teal-900: #093843;
  --teal-700: #0E4F5C;
  --teal-500: #17707F;
  --teal-100: #DDEBEC;
  --teal-50:  #EEF5F5;
  --gold-600: #B8862E;
  --gold-500: #D9A441;
  --gold-100: #F6E8CB;
  --ivory:    #FAF7F0;
  --ink:      #16292E;
  --muted:    #5E7378;
  --line:     #E4DED2;
  --white:    #FFFFFF;
  --danger:   #B4433A;
  --success:  #2E7D5B;
  --radius:   14px;
  --shadow:   0 8px 28px rgba(9, 56, 67, .10);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--ivory); color: var(--ink); line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; color: var(--teal-900); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--teal-900); color: var(--white);
  border-bottom: 3px solid var(--gold-500);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; color: var(--white); display: flex; align-items: baseline; gap: 2px; }
.brand .dot { color: var(--gold-500); }
.nav-links { display: flex; gap: 22px; align-items: center; font-weight: 500; font-size: .95rem; }
.nav-links a { color: rgba(255,255,255,.85); transition: color .15s; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--gold-500); }
.nav-links a.active { color: var(--gold-500); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: none;
  font-weight: 700; font-size: .95rem; transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.btn:active { transform: scale(.98); }
.btn-gold { background: var(--gold-500); color: var(--teal-900); }
.btn-gold:hover { background: var(--gold-600); color: var(--white); }
.btn-teal { background: var(--teal-700); color: var(--white); }
.btn-teal:hover { background: var(--teal-500); }
.btn-ghost { background: transparent; color: var(--teal-700); border: 2px solid var(--teal-700); }
.btn-ghost:hover { background: var(--teal-50); }
.btn-danger { background: transparent; color: var(--danger); border: 2px solid var(--danger); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards & forms ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; color: var(--teal-900); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--white); transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100);
}
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
.badge-teal { background: var(--teal-100); color: var(--teal-700); }
.badge-green { background: #E2F1EA; color: var(--success); }
.badge-red { background: #F7E4E2; color: var(--danger); }
.badge-grey { background: #ECEAE4; color: var(--muted); }

/* ---------- Listing grid ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.unit-card { overflow: hidden; transition: transform .15s, box-shadow .15s; }
.unit-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(9,56,67,.16); }
.unit-photo { height: 190px; background: var(--teal-100) center/cover no-repeat; position: relative; }
.unit-photo .price-seal {
  position: absolute; bottom: -16px; right: 14px;
  background: var(--gold-500); color: var(--teal-900);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .85rem;
  box-shadow: 0 4px 12px rgba(184,134,46,.4); border: 2px solid var(--white);
}
.unit-body { padding: 22px 16px 16px; }
.unit-body h3 { font-size: 1.05rem; margin-bottom: 2px; }
.unit-meta { color: var(--muted); font-size: .85rem; display: flex; gap: 10px; flex-wrap: wrap; }
.stars { color: var(--gold-600); font-weight: 700; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-700) 70%, var(--teal-500) 100%);
  color: var(--white); padding: 72px 0 96px; position: relative; overflow: hidden;
}
.hero h1 { color: var(--white); max-width: 640px; }
.hero h1 em { font-style: italic; color: var(--gold-500); }
.hero p { color: rgba(255,255,255,.82); max-width: 520px; margin-top: 12px; font-size: 1.05rem; }
.hero::after {
  content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px;
  border-radius: 50%; border: 60px solid rgba(217,164,65,.14);
}

/* Search bar overlapping the hero */
.searchbar {
  background: var(--white); border-radius: 18px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr auto; gap: 0;
  margin-top: -44px; position: relative; z-index: 5; overflow: hidden; border: 1px solid var(--line);
}
.searchbar > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.searchbar > div:last-child { border-right: none; padding: 10px; display: flex; align-items: center; }
.searchbar label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.searchbar select, .searchbar input { border: none; width: 100%; padding: 4px 0; background: transparent; font-weight: 500; }
.searchbar select:focus, .searchbar input:focus { outline: none; }

/* ---------- Section headers ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-600); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--teal-900); color: var(--white); padding: 14px 24px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 999; transition: transform .3s; max-width: 90vw;
  border-left: 4px solid var(--gold-500); font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-left-color: var(--danger); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9,56,67,.55); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: 10px 12px; background: var(--teal-50); color: var(--teal-900); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); }

/* ---------- Payment method picker ---------- */
.pay-methods { display: grid; gap: 10px; }
.pay-method {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--line);
  border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; background: var(--white);
}
.pay-method:hover { border-color: var(--teal-500); }
.pay-method.selected { border-color: var(--gold-500); background: var(--gold-100); }
.pay-method .pm-icon { width: 44px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: .65rem; color: var(--white); }
.pm-mpesa { background: #17A64A; }
.pm-airtel { background: #E4002B; }
.pm-card { background: var(--teal-700); }

/* ---------- Spinner ---------- */
.spinner { width: 34px; height: 34px; border: 4px solid var(--teal-100); border-top-color: var(--gold-500); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.footer { background: var(--teal-900); color: rgba(255,255,255,.7); padding: 40px 0; margin-top: 60px; font-size: .9rem; }
.footer .brand { font-size: 1.2rem; margin-bottom: 8px; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .searchbar { grid-template-columns: 1fr 1fr; }
  .searchbar > div { border-right: none; border-bottom: 1px solid var(--line); }
  .nav-links { gap: 14px; font-size: .85rem; }
}
@media (max-width: 560px) {
  .searchbar { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 80px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
