body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8fafc;
  color: #111827;
}

/* HEADER */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 30px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.logo {
  height: 130px;
  width: auto;
  display: block;
}

nav a {
  margin-left: 16px;
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  font-size: 14px;
}

nav a:hover {
  color: #0078ff;
}

.btn {
  background: #0078ff;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.nav-join {
  margin-left: 20px;
}

/* HERO */

.hero {
  text-align: center;
  padding: 50px 20px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  margin-bottom: 10px;
}

.hero p {
  color: #4b5563;
  margin-bottom: 24px;
}

.search-box {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}

/* AI-style search suggestions */

.search-input-wrapper {
  position: relative;
  min-width: 220px;
}

#locationInput {
  width: 100%;
}

.search-box input,
.search-box select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  min-width: 150px;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 10px 25px rgba(15,23,42,0.08);
  max-height: 180px;
  overflow-y: auto;
  font-size: 13px;
  z-index: 20;
  display: none;
}

.search-suggestions.visible {
  display: block;
}

.search-suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
}

.search-suggestion-item:hover {
  background: #eff6ff;
}

/* SECTIONS */

.section {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.section h2 {
  text-align: left;
  margin-bottom: 8px;
}

.section-lead {
  color: #4b5563;
  margin-bottom: 24px;
}

/* LISTINGS */

.listings-section {
  margin-top: 20px;
}

.listing-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.listing-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.listing-card:hover {
  transform: translateY(-4px);
}

.listing-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.listing-body {
  padding: 14px 16px 16px;
  font-size: 14px;
}

.listing-body h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.listing-body .price {
  font-weight: 700;
  margin: 0 0 4px;
}

.listing-body .meta {
  color: #6b7280;
  margin: 0 0 8px;
}

.listing-tag {
  display: inline-block;
  font-size: 12px;
  background: #e5f0ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 999px;
}

/* Deal snapshot button in cards */

.deal-btn {
  margin-top: 10px;
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
  background: #0f172a;
}

.deal-btn:hover {
  background: #111827;
}

.listing-empty {
  margin-top: 16px;
  font-size: 14px;
  color: #6b7280;
}

.hidden {
  display: none;
}

/* Investor mode toggle */

.investor-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.investor-toggle input {
  display: none;
}

.toggle-switch {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.investor-toggle input:checked + .toggle-switch {
  background: #22c55e;
}

.investor-toggle input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

/* FEATURES */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 16px;
  font-size: 14px;
}

/* AI SECTION */

.section-ai {
  background: #020617;
  color: #e5e7eb;
  padding: 50px 20px;
}

.ai-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.ai-points {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  font-size: 14px;
}

.ai-card {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
}

/* JOIN */

.join-form {
  max-width: 400px;
  display: grid;
  gap: 10px;
}

.join-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.65);
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(15,23,42,0.3);
  z-index: 51;
  font-size: 14px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.modal-location {
  color: #4b5563;
  margin-top: 2px;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 14px 0 10px;
}

.modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-list li {
  margin-bottom: 4px;
}

.modal-notes {
  margin-top: 10px;
}

.modal-disclaimer {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* FLOATING BUTTONS */

.floating-join {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: #16a34a;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(22,163,74,0.4);
  cursor: pointer;
}

.floating-join:hover {
  background: #15803d;
}

/* AI CHAT WIDGET */

.ai-chat-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.5);
  cursor: pointer;
}

.ai-chat-toggle:hover {
  background: #111827;
}

.ai-chat {
  position: fixed;
  left: 16px;
  bottom: 70px;
  width: 280px;
  max-height: 360px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 45;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ai-chat.collapsed {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.ai-chat-header {
  background: #0f172a;
  color: #f9fafb;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.ai-chat-close {
  border: none;
  background: transparent;
  color: #f9fafb;
  font-size: 16px;
  cursor: pointer;
}

.ai-chat-body {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  background: #f9fafb;
}

.ai-chat-message {
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  max-width: 85%;
}

.ai-chat-message.ai {
  background: #e5f0ff;
  align-self: flex-start;
}

.ai-chat-message.user {
  background: #d1fae5;
  align-self: flex-end;
}

.ai-chat-input {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.ai-chat-input input {
  flex: 1;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

/* FOOTER */

footer {
  text-align: center;
  padding: 20px;
  background: #0f172a;
  color: #9ca3af;
  font-size: 13px;
  margin-top: 40px;
}

/* MOBILE */

@media (max-width: 640px) {
  header {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  .logo {
    height: 110px;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .ai-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 30px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .listing-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ai-chat {
    width: calc(100% - 32px);
  }
}
.form-message {
  font-size: 13px;
  margin-top: 8px;
}

.form-message.success {
  color: #16a34a; /* green */
}

.form-message.error {
  color: #b91c1c; /* red */
}

.hidden {
  display: none;
}
