:root {
  --bg: #f3f6f2;
  --panel: #ffffff;
  --panel-soft: #f7faf6;
  --line: #d9e3dc;
  --text: #15241f;
  --muted: #5f7067;
  --deep: #082b24;
  --deep-soft: #113a32;
  --brand: #d3b36e;
  --brand-strong: #a07b34;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.site-wrap {
  width: min(1220px, 94vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(211, 179, 110, 0.2);
  background: rgba(15, 22, 19, 0.9);
  backdrop-filter: blur(8px);
}

.header-row {
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-family: "Space Grotesk", sans-serif;
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.main-nav a:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-sync-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.site-sync-pill.site-sync-ok {
  color: #d7f0e4;
  border-color: rgba(105, 189, 145, 0.6);
  background: rgba(28, 71, 54, 0.85);
}

.site-sync-pill.site-sync-warn {
  color: #ffeec2;
  border-color: rgba(219, 184, 108, 0.65);
  background: rgba(79, 58, 18, 0.85);
}

.site-sync-pill.site-sync-off {
  color: #d0d8d3;
  border-color: rgba(123, 136, 127, 0.55);
  background: rgba(25, 35, 30, 0.8);
}

.hero {
  padding: 28px 0 20px;
  border-bottom: 1px solid rgba(47, 61, 52, 0.7);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.hero h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 34px;
}

.hero-copy {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-metrics {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
}

.trust-band {
  border-bottom: 1px solid rgba(47, 61, 52, 0.7);
}

.trust-grid {
  padding: 16px 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trust-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.trust-grid strong {
  font-size: 14px;
}

.trust-grid p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.section {
  padding: 22px 0;
  border-bottom: 1px solid rgba(47, 61, 52, 0.6);
}

.top-gap {
  margin-top: 12px;
}

.section-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.controls {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111a16;
  color: var(--text);
  padding: 10px 11px;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

.layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  align-items: start;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.property-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.property-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.property-gallery-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: #111a16;
}

.property-thumb-sub {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.property-body {
  padding: 10px;
}

.property-title {
  margin: 0;
  font-size: 16px;
}

.property-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.property-price {
  margin-top: 8px;
  color: var(--brand);
  font-weight: 700;
  font-size: 17px;
}

.row-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.lead-box h3 {
  margin: 0;
}

.lead-box p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.tips-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tools-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tool-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.tool-card h4 {
  margin: 0;
  font-size: 15px;
}

.tool-card p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.mini-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.tool-result {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
  font-size: 12px;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.broker-panel .tips-grid {
  margin-top: 8px;
}

.broker-panel .tip-card h4 {
  font-size: 13px;
}

.broker-panel .tip-card p {
  font-size: 12px;
}

.broker-property-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.broker-mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
}

.broker-mini-card h5 {
  margin: 0;
  font-size: 13px;
}

.broker-mini-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.chat-online-wrap {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.chat-online-wrap strong {
  font-size: 12px;
}

.chat-online-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chat-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text);
  background: var(--panel-soft);
}

.chat-list {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  min-height: 170px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.chat-msg {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101815;
  padding: 7px 8px;
}

.chat-msg.self {
  border-color: rgba(211, 179, 110, 0.5);
}

.chat-head {
  font-size: 11px;
  color: var(--muted);
}

.chat-body {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

#brokerPropertyForm {
  margin-top: 8px;
}

#brokerPropertyStatus {
  margin-top: 10px;
}

.table-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.table-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.table-wrap-public {
  width: 100%;
  overflow: auto;
}

.table-wrap-public table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table-wrap-public th,
.table-wrap-public td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px;
  font-size: 12px;
}

.table-wrap-public th {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap-public td {
  color: var(--text);
}

.tip-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.tip-card h4 {
  margin: 0;
  font-size: 15px;
}

.tip-card p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
  margin-top: 8px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.faq p {
  margin: 8px 0 0;
  color: var(--muted);
}

.site-footer {
  padding: 16px 0 22px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.footer-row strong {
  display: block;
}

.footer-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: inherit;
}

.btn-primary {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #1d1a12;
}

.btn-soft {
  background: #111a16;
  color: var(--text);
}

.wa-float {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #1d1a12;
}

@media (max-width: 1050px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

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

  .tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-row {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .main-nav {
    flex-wrap: wrap;
  }

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

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

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

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

  .broker-property-grid {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 28px;
  }

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

/* Public-site polish */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(8, 43, 36, 0.12);
  box-shadow: 0 8px 28px rgba(8, 43, 36, 0.06);
}

.header-row {
  min-height: 78px;
}

.brand h1 {
  max-width: 310px;
  font-size: 18px;
  line-height: 1.05;
  color: var(--deep);
}

.brand p,
.main-nav a {
  color: var(--muted);
}

.main-nav a:hover {
  color: var(--deep);
}

.hero {
  min-height: 560px;
  display: grid;
  align-items: end;
  padding: 96px 0 34px;
  color: #f7f2e7;
  background:
    linear-gradient(90deg, rgba(4, 25, 20, 0.95) 0%, rgba(8, 43, 36, 0.86) 48%, rgba(8, 43, 36, 0.52) 100%),
    url("logo-carneiro.png") right 10% center / min(520px, 70vw) no-repeat,
    var(--deep);
  border-bottom: 0;
}

.hero-content {
  display: grid;
  gap: 16px;
}

.hero h2 {
  max-width: 820px;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 0.96;
  color: #fffaf0;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  font-size: 18px;
  color: #dce8df;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0;
  color: var(--brand);
}

.hero-actions {
  margin-top: 2px;
}

.hero-metrics {
  width: min(780px, 100%);
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(211, 179, 110, 0.35);
  backdrop-filter: blur(8px);
}

.metric {
  background: rgba(5, 26, 21, 0.54);
  border-color: rgba(211, 179, 110, 0.2);
}

.metric-label {
  color: #cbd9d1;
}

.metric-value {
  color: #fff7e7;
}

.trust-band {
  background: #fff;
  border-bottom-color: var(--line);
}

.trust-grid div,
.property-card,
.lead-box,
.tool-card,
.table-card,
.tip-card,
.faq details,
.broker-mini-card {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 10px 30px rgba(8, 43, 36, 0.05);
}

.section {
  padding: 56px 0;
  border-bottom-color: var(--line);
}

.section:nth-of-type(even) {
  background: #fff;
}

.section-head {
  max-width: 820px;
}

.section-head h3 {
  color: var(--deep);
}

.service-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.service-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8faf6 100%);
  padding: 16px;
  box-shadow: 0 12px 32px rgba(8, 43, 36, 0.05);
}

.service-card span {
  display: inline-flex;
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 18px;
}

.service-card h4 {
  margin: 0;
  color: var(--deep);
  font-size: 17px;
}

.service-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  background: #fff;
  color: var(--text);
}

.property-card {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(8, 43, 36, 0.11);
}

.property-gallery-strip {
  background: #f5f8f4;
}

.property-title,
.tool-card h4,
.table-card h4,
.tip-card h4,
.lead-box h3 {
  color: var(--deep);
}

.btn {
  min-height: 40px;
}

.btn-primary {
  border-color: rgba(160, 123, 52, 0.45);
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #1f1a10;
}

.btn-soft {
  background: #fff;
  color: var(--deep);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  color: #fff7e7;
}

.tool-result,
.chat-list,
.chat-msg {
  background: var(--panel-soft);
  color: var(--muted);
}

.site-footer {
  color: #eef6f0;
  background: var(--deep);
}

.site-footer .btn-soft {
  border-color: rgba(211, 179, 110, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff7e7;
}

.wa-float {
  box-shadow: 0 14px 35px rgba(8, 43, 36, 0.22);
}

@media (max-width: 1120px) {
  .header-row {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 620px;
    padding: 74px 0 28px;
    background:
      linear-gradient(180deg, rgba(4, 25, 20, 0.96) 0%, rgba(8, 43, 36, 0.86) 72%, rgba(8, 43, 36, 0.8) 100%),
      url("logo-carneiro.png") center 34% / min(330px, 78vw) no-repeat,
      var(--deep);
  }

  .hero h2 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .service-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
