/* CruxListing — base styles (server-rendered pages) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #0B1F3A;
  --brand: #1E7BE8;
  --brand-dark: #1868c9;
  --ink: #0f172a;
  --soft: #f7f8fa;
  --muted: #6b7280;
  --border: #e5e7eb;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--soft);
  color: var(--ink);
  line-height: 1.5;
  padding-bottom: 80px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}
.logo { height: 40px; width: auto; }
.search-form { flex: 1; max-width: 640px; }
.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  outline: none;
}
.search-input:focus { border-color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); }

.header-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}
.header-icon:hover { background: rgba(0,0,0,0.05); }
.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Hero */
.hero { padding: 32px 0 16px; }
.hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 15px; }
.text-brand { color: var(--brand); }

/* Category tiles */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0 32px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.tile:hover { border-color: var(--brand); }
.tile-icon { font-size: 28px; }
.tile-label { font-size: 12px; font-weight: 600; text-align: center; }

/* Section title */
.section-title { font-size: 20px; font-weight: 700; margin: 24px 0 16px; }

/* Listing grid */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Listing card */
.listing-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.listing-card:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { color: var(--muted); font-size: 13px; }
.badge-verified {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.card-price { font-size: 22px; font-weight: 700; line-height: 1.1; }
.card-title { font-size: 15px; font-weight: 600; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 10px; }

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 40px 0;
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Mobile */
@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .category-tiles { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .tile { padding: 12px 4px; }
  .tile-icon { font-size: 22px; }
  .tile-label { font-size: 10px; }
  .listing-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-price { font-size: 18px; }
  .card-title { font-size: 13px; }
  .header-inner { gap: 8px; }
  .search-form { max-width: none; }
}

/* Free banner */
.free-banner {
  background: linear-gradient(135deg, #0B1F3A 0%, #152a4a 50%, #1E7BE8 100%);
  border-radius: 20px;
  padding: 16px 20px;
  margin: 20px 0 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  position: relative;
}
.free-icon { font-size: 28px; flex-shrink: 0; }
.free-text { flex: 1; min-width: 0; }
.free-title { font-size: 15px; font-weight: 700; }
.free-sub { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 2px; }
.free-dismiss {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.free-dismiss:hover { background: rgba(255,255,255,0.15); }

/* Section header with See all link */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 32px 0 16px;
}
.section-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-link { font-size: 14px; color: var(--brand); font-weight: 600; }
.section-link:hover { text-decoration: underline; }

/* Trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  margin: 40px 0;
}
.trust-item { display: flex; align-items: flex-start; gap: 12px; }
.trust-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #eff6ff;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.trust-title { font-size: 14px; font-weight: 700; }
.trust-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (max-width: 640px) {
  .trust-strip { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .free-banner { padding: 12px 14px; gap: 10px; }
  .free-title { font-size: 14px; }
  .free-sub { font-size: 11px; }
}

/* Footer */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
  text-align: left;
}
.footer-brand { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.footer-tag { font-size: 12px; color: var(--muted); line-height: 1.6; }
.footer-head { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { font-size: 13px; color: var(--muted); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* Listing detail page */
.listing-detail { padding: 20px 16px; }
.back-link { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
}
.detail-gallery { min-width: 0; }
.main-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}
.thumb {
  width: 72px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  flex-shrink: 0;
}
.detail-info { min-width: 0; }
.detail-category { font-size: 12px; font-weight: 600; color: var(--brand); }
.detail-title { font-size: 24px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.detail-price { font-size: 32px; font-weight: 700; margin: 12px 0; }
.badge-sold { display: inline-block; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; text-transform: uppercase; }
.btn-apply {
  display: block;
  width: 100%;
  height: 56px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 56px;
  border-radius: 16px;
  margin: 12px 0;
}
.btn-apply:hover { background: var(--brand-dark); }
.detail-meta { font-size: 13px; color: var(--muted); margin: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.spec-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin: 16px 0;
}
.spec-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.spec-row { min-width: 0; }
.spec-row dt { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.spec-row dd { font-size: 14px; font-weight: 600; word-break: break-word; }
.card-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin: 16px 0;
}
.block-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.description-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.contact-link { color: var(--brand); font-weight: 600; font-size: 14px; }
.no-photo-big {
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

/* Subcategory pills */
.subcategory-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 24px;
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}
.pill:hover { border-color: var(--brand); }
.pill-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.listing-count { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.empty-message { text-align: center; color: var(--muted); padding: 60px 0; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .detail-title { font-size: 20px; }
  .detail-price { font-size: 26px; }
}

/* =========================================================
   NEW HOMEPAGE MODULES
   ========================================================= */

/* Hero */
.hero {
  min-height: 320px;
  position: relative;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0B1F3A 0%, #152a4a 50%, #1E7BE8 100%);
  color: white;
  margin-bottom: 0;
}
.hero-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}
.hero-content { max-width: 760px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.08;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.hero h1 span { color: #4FA8FF; }
.hero-subtitle {
  color: rgba(255,255,255,.9);
  font-size: 15px;
  margin-bottom: 24px;
}
.search-box {
  background: white;
  border-radius: 12px;
  padding: 6px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 110px;
  gap: 6px;
  box-shadow: 0 8px 25px rgba(20, 30, 50, 0.15);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: #7a8495;
}
.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 14px;
  background: transparent;
}
.search-button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
}
.search-button:hover { background: var(--brand-dark); }
.popular-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(255,255,255,.9);
}
.popular-searches a { color: white; opacity: .9; }
.popular-searches a:hover { text-decoration: underline; }

/* Category nav */
.category-nav {
  background: white;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.category-list {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding: 18px 0;
}
.category-item {
  text-align: center;
  padding: 10px 5px;
  border-radius: 12px;
  transition: 0.2s;
}
.category-item:hover { background: #f5f8fd; transform: translateY(-2px); }
.category-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 7px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #eaf3ff;
}
.category-name { font-size: 12px; font-weight: 650; }

/* Section header (additions) */
.section-title-icon { font-size: 20px; }

/* Jobs section side panel */
.jobs-side { min-width: 0; }
.jobs-side-card {
  background: linear-gradient(135deg, #0B1F3A, #1E7BE8);
  color: white;
  border-radius: 14px;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.jobs-side-card h3 { font-size: 20px; margin-bottom: 8px; }
.jobs-side-card p { color: rgba(255,255,255,.8); font-size: 14px; margin-bottom: 16px; }
.jobs-side-btn {
  display: inline-block;
  background: white;
  color: var(--navy);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  align-self: flex-start;
}

/* Vehicle card location */
.vehicle-location { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* Property title */
.property-title { font-size: 13px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pet card in new layout */
.pet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pet-card { background: white; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: 0.2s; }
.pet-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.pet-image { aspect-ratio: 1.25 / 1; position: relative; overflow: hidden; background: #f1f4f8; }
.pet-image img { width: 100%; height: 100%; object-fit: cover; }
.pet-body { padding: 12px; }
.pet-name { font-size: 15px; font-weight: 800; }
.pet-breed { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pet-details { display: flex; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--muted); }

/* Property big card */
.property-card { background: white; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: 0.2s; }
.property-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.property-image { aspect-ratio: 1.7 / 1; position: relative; overflow: hidden; background: #f1f4f8; }
.property-image img { width: 100%; height: 100%; object-fit: cover; }
.property-body { padding: 14px; }
.property-price { font-size: 22px; font-weight: 800; }
.property-specs { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; color: #5e6878; font-weight: 600; }
.property-location { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Marketplace compact card */
.market-item { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; transition: 0.15s; }
.market-item:hover { border-color: var(--brand); }
.market-image { width: 76px; height: 66px; border-radius: 8px; overflow: hidden; background: #f1f3f6; }
.market-image img { width: 100%; height: 100%; object-fit: cover; }
.market-price { font-size: 14px; font-weight: 800; }
.market-title { font-size: 12px; font-weight: 650; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-location { color: var(--muted); font-size: 10px; margin-top: 3px; }

/* Trust grid spacing */
.trust-grid { margin-top: 40px; margin-bottom: 40px; }

/* CTA margin */
.post-cta { margin-top: 40px; margin-bottom: 40px; }

@media (max-width: 1000px) {
  .category-list { grid-template-columns: repeat(4, 1fr); }
  .vehicle-grid { grid-template-columns: repeat(2, 1fr); }
  .pet-grid { grid-template-columns: repeat(2, 1fr); }
  .real-estate-grid { grid-template-columns: 1fr; }
  .marketplace-grid { grid-template-columns: repeat(2, 1fr); }
  .jobs-side { display: none; }
}
@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .search-box { grid-template-columns: 1fr; padding: 8px; }
  .search-field { height: 44px; border-bottom: 1px solid #edf0f4; }
  .search-button { height: 44px; }
  .category-list { gap: 4px; }
  .category-icon { width: 38px; height: 38px; font-size: 18px; }
  .category-name { font-size: 10px; }
  .vehicle-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pet-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .marketplace-grid { grid-template-columns: 1fr; }
  .real-estate-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   USER PROFILE PAGE
   ========================================================= */

.profile-page { padding: 20px 16px 60px; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin: 12px 0 20px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-info { min-width: 0; flex: 1; }
.profile-name {
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}
.profile-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.profile-username {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}
.profile-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.profile-bio {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}
.profile-bio p { font-size: 14px; line-height: 1.6; color: #333; }

@media (max-width: 640px) {
  .profile-header { flex-direction: column; align-items: flex-start; padding: 20px; }
  .profile-avatar { width: 80px; height: 80px; font-size: 34px; }
  .profile-name { font-size: 22px; }
}

/* =========================================================
   AUTH PAGES (LOGIN + REGISTER)
   ========================================================= */

.auth-page {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(30, 123, 232, 0.08), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(11, 31, 58, 0.06), transparent 45%),
    #f7f9fc;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow:
    0 1px 3px rgba(20, 30, 50, 0.04),
    0 12px 40px rgba(20, 30, 50, 0.08);
  border: 1px solid rgba(0,0,0,0.04);
}

.auth-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(30, 123, 232, 0.12);
}
.auth-input::placeholder { color: #9ca3af; }

.auth-submit {
  height: 52px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background-color 0.15s, transform 0.05s;
}
.auth-submit:hover { background: var(--brand-dark); }
.auth-submit:active { transform: translateY(1px); }

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.auth-footer:first-of-type { margin-top: 24px; }

.auth-link {
  color: var(--brand);
  font-weight: 600;
}
.auth-link:hover { text-decoration: underline; }

.auth-link-bold {
  color: var(--brand);
  font-weight: 700;
}
.auth-link-bold:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .auth-page { padding: 24px 16px; min-height: calc(100vh - 58px); }
  .auth-card { padding: 32px 22px; border-radius: 20px; }
  .auth-title { font-size: 24px; }
}

/* Password wrap with eye toggle */
.auth-password-wrap {
  position: relative;
}
.auth-password-wrap .auth-input {
  padding-right: 50px;
}
.auth-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background-color 0.15s;
}
.auth-eye:hover { background: rgba(0,0,0,0.05); }

/* Remember me checkbox */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  padding: 2px 4px;
}
.auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* =========================================================
   USER MENU DROPDOWN
   ========================================================= */

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 4px 12px 4px 4px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.user-menu-trigger:hover {
  border-color: var(--brand);
  background: #f9fbff;
}

.user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu-trigger img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-menu-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(20, 30, 50, 0.12);
  overflow: hidden;
  z-index: 100;
}
.user-menu-panel.open {
  display: block;
  animation: userMenuIn 0.15s ease-out;
}

@keyframes userMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #f9fbff;
}
.user-menu-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.user-menu-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-menu-header-info {
  min-width: 0;
  flex: 1;
}
.user-menu-header-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-header-username {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-items {
  padding: 6px 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink);
  transition: background-color 0.1s;
}
.user-menu-item:hover {
  background: #f5f8fd;
}
.user-menu-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.user-menu-logout {
  border-top: 1px solid var(--border);
  padding: 6px 0;
}
.user-menu-logout-item {
  color: #dc2626;
  font-weight: 600;
}
.user-menu-logout-item:hover {
  background: #fef2f2;
}

@media (max-width: 640px) {
  .user-menu-name { display: none; }
  .user-menu-trigger { padding: 4px; border: 0; }
  .user-menu-panel {
    right: -8px;
    width: 240px;
  }
}

/* =========================================================
   POST AN AD — MODERN FORM
   ========================================================= */

.post-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.post-page .page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 24px;
}

.post-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(20,30,50,0.03);
}

.post-section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ink);
}

.post-input,
.post-textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-input {
  height: 52px;
}
.post-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
.post-input:focus,
.post-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(30, 123, 232, 0.1);
}
.post-input::placeholder,
.post-textarea::placeholder {
  color: #9ca3af;
}
.post-input + .post-input,
.post-textarea + .post-input,
.post-input + .post-textarea {
  margin-top: 12px;
}
.post-section > .post-input + .post-input,
.post-section > .post-textarea + .post-input {
  margin-top: 12px;
}
.post-section select.post-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
  cursor: pointer;
}

/* Category select spacing */
.post-section select + select {
  margin-top: 12px;
}

/* City search */
.post-city-wrap {
  position: relative;
}
.post-city-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,30,50,0.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.post-city-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
}
.post-city-results button:hover {
  background: #f5f8fd;
}

.post-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.post-center { text-align: center; }

/* Optional location/details */
.post-details {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.post-details summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  background: #f9fbff;
  list-style: none;
}
.post-details summary::-webkit-details-marker { display: none; }
.post-details summary::before {
  content: "▸";
  margin-right: 8px;
  display: inline-block;
  transition: transform 0.15s;
  color: var(--brand);
}
.post-details[open] summary::before {
  transform: rotate(90deg);
}
.post-details-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.post-row .post-input { flex: 1; }

.post-btn-secondary {
  height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  transition: border-color 0.15s, background-color 0.15s;
}
.post-btn-secondary:hover {
  border-color: var(--brand);
  background: #f9fbff;
}

/* Contact row */
.post-section .post-input + .post-input { margin-top: 12px; }

/* Photos */
.post-file {
  display: block;
  width: 100%;
  font-size: 14px;
  padding: 12px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: #f9fbff;
  transition: border-color 0.15s, background-color 0.15s;
}
.post-file:hover {
  border-color: var(--brand);
  background: #eff6ff;
}
.post-file::file-selector-button {
  margin-right: 12px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.post-photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.post-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.post-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-photo-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Submit */
.post-submit {
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  border: 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
  margin-top: 4px;
}
.post-submit:hover { background: var(--brand-dark); }
.post-submit:active { transform: translateY(1px); }
.post-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error */
.post-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 4px;
}

/* Mobile */
@media (max-width: 640px) {
  .post-page { padding: 16px 12px 80px; }
  .post-page .page-title { font-size: 24px; margin-bottom: 16px; }
  .post-section { padding: 18px; border-radius: 16px; }
  .post-section-title { font-size: 15px; margin-bottom: 12px; }
  .post-input { height: 48px; font-size: 15px; }
  .post-row { flex-direction: column; }
  .post-btn-secondary { width: 100%; }
  .post-submit { height: 52px; font-size: 15px; }
  .post-photo-preview {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }
}

/* Owner actions on listing detail */
.detail-owner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.btn-mark-sold,
.btn-delete {
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-mark-sold {
  background: #10b981;
  color: #fff;
}
.btn-mark-sold:hover { opacity: 0.9; }
.btn-delete {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-delete:hover { background: #fee2e2; }
.btn-mark-sold:disabled,
.btn-delete:disabled { opacity: 0.5; cursor: not-allowed; }

/* Upload progress */
.post-progress-wrap {
  margin-top: 14px;
}
.post-progress-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.post-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1E7BE8, #4FA8FF);
  border-radius: 999px;
  transition: width 0.2s ease-out;
}
.post-progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  margin-top: 8px;
  text-align: center;
}

/* Maps: always 1:1, fit the screen on every device */
.post-map-wrap,.listing-map-wrap{display:block;width:100%;margin:16px 0 0}
.post-map-circle,.listing-map-square{width:min(100%,85vh);width:min(100%,85svh);height:auto;max-width:none;max-height:none;aspect-ratio:1/1;margin:0 auto;position:relative;overflow:hidden;isolation:isolate}
.post-map-circle{border-radius:50%;border:3px solid var(--brand);box-shadow:0 8px 32px rgba(30,123,232,.25)}
.listing-map-square{border-radius:20px;border:1px solid var(--border);background:#f5f8fd}
.post-map-circle .leaflet-control-zoom{margin:12px}
.post-map-circle .leaflet-control-zoom a{width:32px;height:32px;line-height:32px;font-size:18px;color:var(--navy);background:#fff;border-radius:8px;margin-bottom:4px;box-shadow:0 2px 6px rgba(0,0,0,.15)}
.post-map-circle .leaflet-control-zoom a:hover{background:var(--brand);color:#fff}

/* --- Attribute Hashtag Strip --- */
.attr-tags-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 0;
}
.attr-tag {
  display: inline-flex;
  align-items: center;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.attr-tag:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}
