:root {
  --forest: #164C3B;
  --forest-ink: #12382D;
  --deep-green-3: #102E26;
  --plum: #EF8E45;
  --sapphire: #EF8E45;
  --sapphire-ink: #C97434;
  --gold: #EF8E45;
  --maroon: #7A1F3D;
  --lime: #D7EE6E;
  --verified-blue: #1B4F91;
  --rent-teal: #1B7A72;
  --bg: #FBFCF8;
  --surface: #FFFFFF;
  --surface-2: #EFF3EB;
  --ink: #1A2420;
  --ink-soft: #4B5750;
  --ink-mute: #7C8880;
  --line: #E2E8DE;
  --line-strong: #C9D3C2;
  --font-head: "Mitr", Georgia, "Noto Serif Thai", serif;
  --font-body: "Mitr", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}

h1, h2 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink);
}

h2 { font-size: 1.5rem; }

.subtext {
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.6;
}

.caption {
  color: var(--ink-mute);
  font-size: 0.85rem;
  margin: 10px 0 24px;
  line-height: 1.6;
}

.note {
  color: var(--ink-mute);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 14px;
}

.field-error {
  color: #B3261E;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: -8px 0 16px;
}
.field-error[hidden] { display: none; }

/* Brand bar */
.brandbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brandbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: flex;
  align-items: center;
  height: 34px;
  width: 34px;
  flex-shrink: 0;
}
.brand-mark img {
  height: 100%;
  width: auto;
  object-fit: contain;
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.brand-chan { color: var(--forest); }
.brand-space { color: var(--maroon); }

/* Stepper */
.stepper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 0;
}
.stepper-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}
.step-item {
  flex: 1;
  text-align: center;
}
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink-mute);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.step-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-mute);
}
.step-item.active .step-num {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}
.step-item.active .step-label { color: var(--ink); font-weight: 500; }
.step-item.done .step-num {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.screen { display: none; }
.screen.active { display: block; animation: fadein 0.25s ease; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero (step 1) */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-ink) 100%);
  border-radius: 20px;
  padding: 72px 48px;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
}
.hero-motif {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, var(--gold) 3px, transparent 3px),
    radial-gradient(circle, var(--gold) 2px, transparent 2px),
    radial-gradient(circle, var(--gold) 4px, transparent 4px);
  background-size: 140px 140px, 90px 90px, 200px 200px;
  background-position: 10% 20%, 70% 60%, 85% 15%;
  opacity: 0.35;
}
.hero-content { position: relative; z-index: 1; }
.hero-headline {
  color: var(--surface);
  font-size: 2.4rem;
  line-height: 1.25;
  max-width: 620px;
}

.landing-body {
  max-width: 640px;
  margin: 40px auto 0;
  text-align: center;
}
.landing-body h2 { font-size: 1.75rem; }

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.btn-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  outline: 2px solid var(--sapphire);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--forest);
  color: white;
}
.btn-primary:hover { background: var(--forest-ink); }
.btn-gold {
  background: var(--gold);
  color: white;
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-full { width: 100%; margin-top: 8px; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 20px;
}
.btn-back:hover { color: var(--ink); }
.btn-back svg { width: 16px; height: 16px; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px;
  max-width: 560px;
  margin: 0 auto;
}
.card-center { text-align: center; }

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 18px 0 6px;
}
.field-label:first-of-type { margin-top: 0; }

.input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.input:focus {
  outline: none;
  border-color: var(--sapphire);
  box-shadow: 0 0 0 3px rgba(239, 142, 69, 0.18);
}
.input-mono { font-family: 'IBM Plex Mono', monospace; }

.map-picker {
  width: 100%;
  height: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
}
.map-instruction {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 8px 0;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5750' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

/* OTP */
.otp-row {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}
.otp-box {
  width: 56px;
  height: 56px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.otp-box:focus {
  outline: none;
  border-color: var(--sapphire);
  box-shadow: 0 0 0 3px rgba(239, 142, 69, 0.18);
}
.otp-box.filled {
  background: var(--sapphire);
  border-color: var(--sapphire-ink);
  color: white;
}

/* Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 10px;
}
.chip {
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--plum); }
.chip-selected {
  background: var(--plum);
  border-color: var(--plum);
  color: white;
}

/* Agent badge — shown to buyers when a listing's seller_type is 'agent' */
.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--maroon);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.agent-badge-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Verified badge — shown when the LISTING OWNER's account is verified (account-level,
   distinct concept from seller_type/agent-badge which is a role, not an identity check) */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--verified-blue);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.verified-badge-check {
  font-size: 0.85rem;
  line-height: 1;
}
.verified-badge-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Purpose badge — sale vs rent, shown on listing cards and the detail page */
.purpose-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
}
.purpose-badge-sale { background: var(--forest); }
.purpose-badge-rent { background: var(--rent-teal); }

/* Trust badge */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 7px 14px;
  border: 1px solid var(--forest);
  color: var(--forest);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover {
  border-color: var(--forest);
  background: var(--surface-2);
}
.dropzone span { font-size: 0.9rem; font-weight: 500; }

.thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.thumb-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* Confirmation */
.check-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--forest);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.center { text-align: center; }

/* ===== Responsive: desktop-first, collapse at narrow widths ===== */
@media (min-width: 720px) {
  .hero { padding: 88px 64px; }
  .hero-headline { font-size: 2.9rem; }
  .card { padding: 48px; }
}

@media (max-width: 640px) {
  .brandbar-inner { padding: 14px 16px; }
  .stepper { padding: 14px 16px 0; }
  .step-label { display: none; }
  main { padding: 16px 16px 48px; }
  .hero { padding: 48px 24px; border-radius: 16px; min-height: unset; }
  .hero-headline { font-size: 1.9rem; }
  .landing-body h2 { font-size: 1.4rem; }
  .btn-row { flex-direction: column; }
  .card { padding: 24px; border-radius: 16px; }
  .otp-box { width: 100%; height: 52px; }
  .chip { padding: 9px 16px; font-size: 0.86rem; }
}
