/* BK Home Broker — public search page.
   Designed to embed in a Wix iframe at up to 720px content width. */

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0891b2;         /* teal — matches bkhomebroker.com.au */
  --brand-deep: #0c4a6e;
  --brand-soft: #ecfeff;
  --accent: #f97316;
  --success: #059669;
  --shadow: 0 6px 28px rgba(15, 23, 42, .06);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Pretendard", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 8px 0 22px; }
.kicker {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand);
  background: var(--brand-soft);
  padding: 6px 12px; border-radius: 999px;
}
.hero h1 {
  margin: 14px 0 6px;
  font-size: 30px; line-height: 1.2; font-weight: 800;
  letter-spacing: -.01em;
}
.hero .sub {
  margin: 0 auto; max-width: 520px;
  color: var(--ink-2); font-size: 15px;
}

/* ---------- Search ---------- */
.search {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 10px;
}

.search-row {
  display: flex; gap: 10px;
}
.search-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  color: var(--ink);
  background: #fff;
}
.search-row input[type="text"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, .14);
}

button.primary {
  position: relative;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 0 22px;
  border-radius: 10px;
  cursor: pointer;
  min-width: 150px;
  transition: background .15s, transform .05s;
}
button.primary:hover { background: #0e7490; }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { opacity: .7; cursor: wait; }

button.primary .spinner {
  display: none;
  width: 14px; height: 14px; margin-left: 8px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
button.primary.loading .spinner { display: inline-block; }
button.primary.loading .label { opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Suggestion chips ---------- */
.suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px; align-items: center;
}
.suggestions-label {
  font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  margin-right: 2px;
}
.chip-btn {
  font: inherit;
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s, transform .05s;
}
.chip-btn:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}
.chip-btn:active { transform: translateY(1px); }

/* ---------- Filters ---------- */
.filters { margin-top: 14px; }
.filters summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .12s, background .12s, color .12s;
}
.filters summary:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.filters summary::-webkit-details-marker { display: none; }
.filters-icon {
  display: inline-block;
  color: var(--brand);
  font-size: 11px;
  transition: transform .15s;
}
.filters[open] .filters-icon { transform: rotate(90deg); }
.filters-label { letter-spacing: .01em; }
.filters-hint {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0;
}
.filters[open] .filters-hint { display: none; }

.filters .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.filters label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--ink-2); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.filters select, .filters input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  text-transform: none; letter-spacing: 0;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.filters select:focus, .filters input[type="text"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .12);
}

/* ---------- Results ---------- */
.results { margin-top: 20px; }
.count {
  font-size: 14px; color: var(--muted);
  margin: 6px 2px 10px;
}
.count strong { color: var(--ink); font-weight: 700; }

.teasers {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}
.teaser { display: block; }
.teaser-card {
  position: relative;
  display: flex; align-items: stretch; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 14px 46px;
  cursor: pointer;
  transition: transform .1s, border-color .15s, box-shadow .15s;
}
.teaser-card:hover { border-color: #bae6fd; }
.teaser-check {
  position: absolute; left: 14px; top: 50%;
  width: 20px; height: 20px;
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.check-indicator {
  position: absolute; left: 14px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.check-indicator::after {
  content: "";
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  margin-bottom: 2px;
  transition: transform .15s;
}
.teaser-check:checked ~ .check-indicator {
  background: var(--brand);
  border-color: var(--brand);
}
.teaser-check:checked ~ .check-indicator::after { transform: rotate(45deg) scale(1); }
.teaser-card:has(.teaser-check:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8,145,178,.08);
}

.thumb {
  width: 64px; height: 64px; border-radius: 10px;
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 60%, #67e8f9 100%);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { font-size: 28px; opacity: .7; }

.teaser-card .meta { flex: 1; min-width: 0; }
.teaser-card .line1 {
  display: flex; justify-content: space-between; gap: 8px;
  align-items: baseline;
}
.teaser-card .where { font-weight: 700; font-size: 15px; color: var(--ink); }
.teaser-card .price { color: var(--brand); font-weight: 700; font-size: 14px; white-space: nowrap; }
.teaser-card .line2 {
  margin-top: 4px; color: var(--muted); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.specs {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  font-size: 12.5px; color: var(--ink-2);
}
.specs strong { color: var(--ink); font-weight: 700; }
.specs .dot { color: #cbd5e1; }
.specs.muted { color: var(--muted); font-style: italic; font-size: 12px; }

.chip {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-deep);
}
.chip.hot { background: #fff7ed; color: var(--accent); }
.project { font-weight: 600; color: var(--ink-2); }
.muted-inline { color: var(--muted); font-size: 12.5px; }

.selection-bar {
  position: sticky; bottom: 10px;
  margin: 14px 0 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
  z-index: 5;
}
.sel-info {
  font-size: 14px; color: var(--ink-2);
  display: flex; align-items: center; gap: 10px;
}
.sel-info #sel-count {
  font-weight: 800; color: var(--brand-deep);
  font-size: 16px;
}
.linkish {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 0;
  text-decoration: underline;
}
.linkish:hover { color: var(--brand); }
#sel-continue { min-width: 200px; }
#sel-continue:disabled { opacity: .5; cursor: not-allowed; }

.empty {
  padding: 22px 18px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-2);
  text-align: center;
}

/* ---------- Email gate ---------- */
.gate {
  margin-top: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 22px;
}
.gate h2 {
  margin: 0 0 4px;
  font-size: 19px; font-weight: 800;
  color: var(--brand-deep);
}
.gate > p {
  margin: 0 0 14px;
  color: var(--ink-2); font-size: 14px;
}
#gate-form {
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
}
#gate-form input[type="text"],
#gate-form input[type="email"],
#gate-form input[type="tel"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#gate-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, .14);
}
#g-name { grid-column: 1; }
#g-email { grid-column: 2; }
#g-phone { grid-column: 1 / -1; }
#gate-form button.primary { grid-column: 1 / -1; padding: 14px; }
.disclaimer {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}
.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 16px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hero h1 { font-size: 26px; }
  .search-row { flex-direction: column; }
  .search-row input[type="text"] { width: 100%; }
  button.primary { width: 100%; padding: 14px; }
  .filters .grid { grid-template-columns: 1fr; }
  #gate-form { grid-template-columns: 1fr; }
  #g-name, #g-email, #g-phone { grid-column: 1; }
}

/* ---------- Alert / Watchlist banner ---------- */
.alert-banner {
  background: var(--brand-soft);
  border: 1px solid #a5f3fc;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0 6px;
}
.alert-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.alert-bell { font-size: 18px; flex-shrink: 0; }
.alert-text { flex: 1; font-size: 14px; color: var(--ink-2); min-width: 120px; }
.alert-btn {
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.alert-btn:hover { background: var(--brand-deep); }

.alert-form-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 8px 0 12px;
}
.alert-form-inner {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.alert-form-inner input {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color .15s;
}
.alert-form-inner input:focus { outline: none; border-color: var(--brand); }
.alert-disclaimer {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 540px) {
  .alert-form-inner { grid-template-columns: 1fr 1fr; }
  .alert-form-inner button.primary { grid-column: 1; }
  .alert-form-inner .linkish { grid-column: 2; }
}
@media (max-width: 380px) {
  .alert-form-inner { grid-template-columns: 1fr; }
  .alert-form-inner button, .alert-form-inner .linkish { grid-column: 1; }
}

/* ---------- Filter chips (State / Type multi-select) ---------- */
.filter-full-row {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; gap: 7px;
}
.filter-label {
  font-size: 12px; color: var(--ink-2); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.filter-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.fchip-break { flex-basis: 100%; height: 0; }
/* Override .filters label which forces flex-direction:column */
.filters .fchip {
  display: inline-flex !important;
  flex-direction: row !important;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: inherit;
  gap: 0;
}
.filters .fchip input[type="checkbox"] { display: none; }
.filters .fchip span {
  font-size: 13px; font-family: inherit;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: all .12s;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.filters .fchip:hover span {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}
.filters .fchip input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ---------- Filter hint text ---------- */
.filter-hint-text {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 3px;
}

/* ---------- Suburb tag-input ---------- */
.tag-input-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px 10px;
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  min-height: 44px;
  transition: border-color .12s, box-shadow .12s;
  cursor: text;
}
.tag-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8,145,178,.12);
}
.tag-chips { display: contents; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px; font-weight: 600;
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-chip-remove {
  background: none; border: none; color: rgba(255,255,255,.8);
  cursor: pointer; padding: 0; font-size: 14px; line-height: 1;
  display: flex; align-items: center;
}
.tag-chip-remove:hover { color: #fff; }
#f-loc {
  border: none !important; outline: none !important;
  box-shadow: none !important;
  padding: 4px 4px !important;
  font-size: 14px;
  min-width: 120px; flex: 1;
  background: transparent;
  color: var(--ink);
}

/* ---------- Iframe-friendly ---------- */
@media (max-width: 480px) { .wrap { padding: 16px 12px 32px; } }
