/* =====================================================
   Kenya Property Hub - Design System
   Inspired by the provided homepage design
   Primary green: #027E46  |  Navy: #102231
   ===================================================== */

:root {
  --green: #027E46;
  --green-dark: #016538;
  --green-light: #e6f5ee;
  --navy: #102231;
  --navy-soft: #1a3347;
  --text: #102231;
  --text-muted: #5a6a7a;
  --bg: #ffffff;
  --bg-soft: #f5f8fc;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(16, 34, 49, 0.08);
  --shadow-lg: 0 10px 40px rgba(16, 34, 49, 0.12);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --container: 1200px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: #fff;
}
.btn-navy {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-navy:hover { background: var(--navy-soft); color: #fff; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--green);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}
.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.5rem;
}
.nav-desktop a {
  color: var(--text);
  font-weight: 500;
  font-size: .92rem;
  text-decoration: none;
}
.nav-desktop a:hover { color: var(--green); }
.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: .2s;
}

/* Mobile nav */
.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: #fff;
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 999;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
}
.nav-mobile .btn { margin-top: 1rem; width: 100%; }

@media (min-width: 992px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
  .header-actions .btn-sm { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #f0f7f4 0%, #e8f0f8 100%);
  padding: 3rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.hero-content h1 {
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 1rem;
}
.hero-content p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 520px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 2rem;
}

/* Search box */
.search-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
}
.search-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.search-tab {
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: .2s;
}
.search-tab.active,
.search-tab:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.search-fields {
  display: grid;
  gap: .75rem;
}
.search-fields input,
.search-fields select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  background: var(--bg-soft);
  color: var(--text);
}
.search-fields input:focus,
.search-fields select:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}
@media (min-width: 768px) {
  .search-fields {
    grid-template-columns: 1.5fr 1fr 1fr auto;
  }
}

/* AI Assistant teaser */
.ai-teaser {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  background: var(--green-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(2,126,70,.15);
  cursor: pointer;
  transition: .2s;
}
.ai-teaser:hover { background: #d4edda; }
.ai-teaser-icon {
  width: 36px;
  height: 36px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ai-teaser-text { font-size: .92rem; color: var(--navy); }
.ai-teaser-text strong { display: block; font-size: .95rem; }

/* ---------- Categories ---------- */
.section { padding: 3.5rem 0; }
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .5rem;
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 576px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
}
.category-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all .25s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.category-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  color: var(--text);
}
.category-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  background: var(--green-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--green);
}
.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .25rem;
}
.category-card span {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ---------- Property Cards ---------- */
.property-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 576px) {
  .property-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .property-grid { grid-template-columns: repeat(3, 1fr); }
}
.property-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow .25s, transform .25s;
}
.property-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.property-card-img {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--bg-soft);
  overflow: hidden;
}
.property-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.badge-sale { background: var(--green); color: #fff; }
.badge-rent { background: #2563eb; color: #fff; }
.badge-featured {
  background: #f59e0b;
  color: #fff;
  left: auto;
  right: .75rem;
}
.property-card-body { padding: 1.1rem; }
.property-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: .35rem;
}
.property-title {
  font-size: .98rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.property-location {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.property-meta {
  display: flex;
  gap: 1rem;
  font-size: .82rem;
  color: var(--text-muted);
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.property-meta span { display: flex; align-items: center; gap: .3rem; }
.property-agent {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-light);
  object-fit: cover;
}
.agent-name { font-size: .85rem; font-weight: 500; }
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .7rem;
  color: var(--green);
  font-weight: 600;
}

/* ---------- CTA Section ---------- */
.cta-section {
  background: var(--navy);
  color: #fff;
  padding: 3.5rem 0;
  text-align: center;
}
.cta-section h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: .75rem;
}
.cta-section p {
  opacity: .85;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #c8d4e0;
  padding: 3.5rem 0 1.5rem;
  font-size: .9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 576px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-brand .logo { color: #fff; margin-bottom: 1rem; }
.footer-brand p { line-height: 1.7; max-width: 280px; }
.footer-col h4 {
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  color: #c8d4e0;
  padding: .3rem 0;
  text-decoration: none;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
}
.social-links { display: flex; gap: .75rem; }
.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.social-links a:hover { background: var(--green); }

/* ---------- Auth Forms ---------- */
.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg-soft);
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
}
.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--navy);
}
.auth-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-weight: 500;
  font-size: .9rem;
  margin-bottom: .4rem;
  color: var(--navy);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green);
}
.password-wrap {
  position: relative;
}
.password-wrap input { padding-right: 3rem; }
.password-toggle {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  padding: .25rem;
}
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: .9rem;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.account-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1rem;
}
.account-type-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  font-size: .85rem;
  font-weight: 500;
}
.account-type-option:has(input:checked),
.account-type-option.active {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
}
.account-type-option input { display: none; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state h2 { color: var(--navy); margin-bottom: .5rem; }

/* Placeholder page */
.placeholder-page {
  padding: 4rem 0;
  text-align: center;
}
.placeholder-page h1 { margin-bottom: 1rem; }
