:root {
  --charcoal: #0f2a4d;
  --charcoal-light: #17406e;
  --cream: #f4f8fc;
  --gold: #2f6fed;
  --gold-dark: #1a4fc9;
  --blue: #1e40af;
  --blue-dark: #142f7a;
  --text: #16233b;
  --text-light: #5b6b85;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--cream);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.site-header {
  background: var(--charcoal);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.site-header .brand img {
  height: 46px;
  width: 46px;
  border-radius: 50%;
  object-fit: cover;
}

.site-header .brand .sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header nav a {
  color: #eee;
  margin-left: 20px;
  font-size: 0.92rem;
}

.site-header nav a:hover { color: var(--gold); }

.hero {
  background: linear-gradient(135deg, var(--charcoal) 0%, var(--charcoal-light) 100%);
  color: #fff;
  padding: 48px 28px 36px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.hero p {
  color: #c3d6f0;
  margin: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

.card { position: relative; }

.card .thumb {
  height: 180px;
  background: #ddd;
  background-size: cover;
  background-position: center;
}

.card .body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.card .loc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.card .price {
  margin-top: auto;
  font-weight: 700;
  color: var(--blue-dark);
}

.card .price .from { font-weight: 400; color: var(--text-light); font-size: 0.8rem; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover { background: var(--blue-dark); }

.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: var(--gold-dark); }

.btn-block { width: 100%; text-align: center; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

/* Detail page */
.detail-wrap {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: flex-start;
}

@media (max-width: 800px) {
  .detail-wrap { grid-template-columns: 1fr; }
}

.gallery-main {
  position: relative;
  width: 100%;
  height: 360px;
  background: #ddd;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumbs img {
  height: 64px;
  width: 90px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.75;
  border: 2px solid transparent;
}

.gallery-thumbs img:hover, .gallery-thumbs img.active {
  opacity: 1;
  border-color: var(--gold);
}

.detail-title h1 {
  margin: 18px 0 4px;
  font-size: 1.6rem;
}

.detail-title .loc { color: var(--text-light); margin-bottom: 16px; }

.desc { white-space: pre-line; line-height: 1.6; color: var(--text); }

.booking-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.1);
  position: sticky;
  top: 20px;
}

.booking-card .rate {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 2px;
}

.booking-card .rate .unit { font-size: 0.85rem; font-weight: 400; color: var(--text-light); }

.tier-list {
  font-size: 0.82rem;
  color: var(--text-light);
  margin: 4px 0 16px;
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.82rem; margin-bottom: 4px; color: var(--text-light); }
.field input, .field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #d6e2f0;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 3px 0;
}
.summary-line.total { font-weight: 700; border-top: 1px solid #dbe6f5; margin-top: 8px; padding-top: 8px; }

.error-msg {
  background: #fbe4e4;
  color: #a33;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}
.success-msg {
  background: #e3f3e8;
  color: #2f7a48;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.confirm-wrap {
  max-width: 560px;
  margin: 60px auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  box-shadow: 0 2px 14px rgba(0,0,0,0.1);
}
.confirm-wrap .icon { font-size: 2.6rem; margin-bottom: 8px; }
.confirm-wrap.ok .icon { color: #3a9d5b; }
.confirm-wrap.cancel .icon { color: #c96b3b; }

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-light);
  font-size: 0.82rem;
}

/* Account nav */
.nav-account {
  color: var(--gold);
  margin-left: 20px;
  font-size: 0.92rem;
}

.nav-inline-form {
  display: inline;
  margin-left: 20px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #eee;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

.link-btn:hover { color: var(--gold); }

.nav-host-link {
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 20px;
}

/* Auth pages */
.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.auth-sub {
  color: var(--text-light);
  font-size: 0.88rem;
  margin: 0 0 18px;
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 16px;
}

.auth-switch a { color: var(--blue); font-weight: 600; }

/* Booking-card login gate */
.login-prompt p { margin: 0 0 12px; color: var(--text-light); font-size: 0.9rem; }

.booking-as {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0 0 14px;
}

.booking-as .link-btn { color: var(--blue); text-decoration: underline; }

/* Host dashboard */
.page-title { margin: 0 0 20px; font-size: 1.5rem; }

.review-row {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.review-head { margin-bottom: 6px; }

.tag-host {
  background: var(--gold);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.review-row details { margin-top: 8px; font-size: 0.85rem; }
.review-row summary { cursor: pointer; color: var(--blue); }

.btn-danger { background: #a33; color: #fff; }
.btn-danger:hover { background: #822; }

/* Nav booking-alert badge */
.nav-badge {
  display: inline-block;
  background: #c0392b;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 9px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Host bookings list */
.bookings-filter { margin-bottom: 16px; font-size: 0.88rem; }
.bookings-filter a { color: var(--text-light); margin-right: 14px; padding-bottom: 3px; }
.bookings-filter a.active { color: var(--blue); font-weight: 700; border-bottom: 2px solid var(--blue); }

.booking-row {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.booking-row .info strong { display: block; margin-bottom: 3px; }
.booking-row .info .meta { color: var(--text-light); font-size: 0.85rem; }

.tag-new {
  background: #c0392b;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.tag-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag-status.pending { background: #fbe9d0; color: #96650f; }
.tag-status.confirmed { background: #d9f0e1; color: #1d7a45; }
.tag-status.host_review { background: #e4ecfa; color: var(--blue-dark); }
.tag-status.cancelled { background: #eee; color: var(--text-light); }
.tag-status.open { background: #fbe0d0; color: #a3450f; }
.tag-status.resolved { background: #d9f0e1; color: #1d7a45; }
.tag-status.closed { background: #eee; color: var(--text-light); }

/* Message thread */
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.msg-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.msg-bubble .meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
}

.msg-bubble.mine {
  align-self: flex-end;
  background: var(--gold);
  color: #fff;
}
.msg-bubble.mine .meta { color: rgba(255,255,255,0.8); }

.msg-bubble.theirs {
  align-self: flex-start;
  background: #eef2f9;
  color: var(--text);
}

.msg-empty { color: var(--text-light); font-size: 0.88rem; margin: 16px 0; }

.msg-form { display: flex; gap: 8px; margin-top: 8px; }
.msg-form textarea { flex: 1; resize: vertical; min-height: 44px; }

/* Availability calendar */
.avail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.avail-day {
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  font-size: 0.78rem;
}

.avail-day .d { font-weight: 700; margin-bottom: 2px; }
.avail-day .s { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; }

.avail-day.open { background: #d9f0e1; color: #1d7a45; }
.avail-day.blocked { background: #eee; color: var(--text-light); }
.avail-day.booked { background: #fbe9d0; color: #96650f; }

.avail-day form { margin: 0; }
.avail-day button {
  width: 100%;
  background: none;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 3px;
  font-size: 0.68rem;
  cursor: pointer;
  color: inherit;
  margin-top: 4px;
}

.avail-legend {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 4px;
}
.avail-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}
.avail-legend .lg-open::before { background: #d9f0e1; }
.avail-legend .lg-blocked::before { background: #eee; }
.avail-legend .lg-booked::before { background: #fbe9d0; }

/* Search filters (browse page) */
.filter-bar {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.filter-field label { font-size: 0.76rem; color: var(--text-light); }
.filter-field input, .filter-field select {
  padding: 8px 10px;
  border: 1px solid #d6e2f0;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
}
.amenity-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; }
.amenity-checks label { font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.amenity-checks input { width: auto; }

/* Badges (Featured / Guest Favorite / Instant Book) */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 6px;
}
.badge-featured { background: var(--gold); color: #fff; }
.badge-favorite { background: #1d7a45; color: #fff; }
.badge-instant { background: #eef2f9; color: var(--blue-dark); }
.badge-request { background: #f3efe6; color: #7a5c14; }

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 56px);
}

/* Wishlist heart */
.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15,42,77,0.55);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  color: #fff;
  z-index: 2;
  line-height: 1;
}
.wishlist-btn.active { color: #e0455a; }
.wishlist-btn.active::before { content: "\2665"; }
.wishlist-btn:not(.active)::before { content: "\2661"; }

.rating-line { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }

/* Map (Leaflet) */
.map-embed { height: 260px; border-radius: var(--radius); margin: 12px 0 20px; }

/* Amenities / house rules on detail page */
.amenity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 16px;
  margin: 12px 0 20px;
}
.amenity-grid div { font-size: 0.88rem; }
.house-rules { white-space: pre-line; line-height: 1.6; font-size: 0.9rem; color: var(--text); margin: 8px 0 20px; }

/* Featured-placement (auction) bid rows */
.bid-row {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bid-row .price-to-beat { font-size: 0.82rem; color: var(--text-light); margin-top: 3px; }

/* "Continue with Google" button + divider on the login/signup forms */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
}
.btn-google:hover { background: #f7f7f8; }
.btn-google svg { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  margin: 14px 0;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e3e3e3;
}
.auth-divider span { padding: 0 10px; }

/* Identity verification status badges + upload page */
.tag-status.unverified { background: #eee; color: var(--text-light); }
.tag-status.verified { background: #d9f0e1; color: #1d7a45; }
.tag-status.rejected { background: #fbe4e4; color: #a33; }
.notice-msg {
  background: #eaf1fb;
  color: #2a5a94;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.verify-doc-preview { max-width: 260px; border-radius: 8px; margin: 10px 0; display: block; }
