/* ============================================================
   Brokerix — Design System
   Moderno, mobile-first, estilo marketplace (iFood-like).
   ============================================================ */

:root {
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eff4ff;

  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e9edf3;
  --bg: #f6f7fb;
  --surface: #ffffff;

  --ok: #10b981;
  --ok-soft: #e7f9f1;
  --warn: #f59e0b;
  --warn-soft: #fff5e6;
  --danger: #ef4444;
  --hot: #ff5a5f;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --sh: 0 6px 20px rgba(15, 23, 42, 0.08);
  --sh-lg: 0 18px 50px rgba(15, 23, 42, 0.16);

  --gut: 20px;
  --maxw: 1180px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
select,
textarea {
  font-family: inherit;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
p {
  margin: 0;
}

/* --------- layout --------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}
.stack {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
}
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.wrap-flex { flex-wrap: wrap; }
.grow { flex: 1; }
.center { justify-content: center; }
.between { justify-content: space-between; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.hide-mob { }
@media (max-width: 720px) {
  .hide-mob { display: none !important; }
}
.only-mob { display: none; }
@media (max-width: 720px) {
  .only-mob { display: initial; }
}

/* --------- buttons --------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.btn-brand:hover { box-shadow: 0 12px 28px rgba(37, 99, 235, 0.36); }
.btn-wa {
  background: linear-gradient(135deg, #25d366, #12b356);
  color: #fff;
  box-shadow: 0 8px 20px rgba(18, 179, 86, 0.28);
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-soft {
  background: var(--brand-soft);
  color: var(--brand);
}
.btn-block { width: 100%; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-sm { padding: 9px 14px; font-size: 13px; }

/* --------- chips / badges --------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  background: var(--surface);
  color: var(--ink-2);
  border: 1.5px solid var(--line);
  white-space: nowrap;
  transition: all 0.14s ease;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
}
.badge-brand { background: var(--brand); color: #fff; }
.badge-ok { background: var(--ok-soft); color: #0a7d5a; }
.badge-warn { background: var(--warn-soft); color: #b26a00; }
.badge-hot {
  background: linear-gradient(135deg, #ff7a45, var(--hot));
  color: #fff;
}
.badge-glass {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  backdrop-filter: blur(6px);
  box-shadow: var(--sh-sm);
}

/* --------- inputs --------- */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  height: 50px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field input,
.field select {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 15px;
  color: var(--ink);
}
.inp {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inp:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
textarea.inp { height: auto; padding: 12px 14px; resize: vertical; }
.lbl {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: block;
}

/* --------- cards --------- */
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--line);
}
.card-pad { padding: 18px; }

/* --------- property card --------- */
.imovel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
@media (max-width: 520px) {
  .imovel-grid { grid-template-columns: 1fr; gap: 16px; }
}
.imovel {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.imovel:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh);
}
.imovel-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  overflow: hidden;
}
.imovel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.imovel:hover .imovel-cover img { transform: scale(1.06); }
.imovel-cover .tags {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.imovel-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.imovel-price {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.imovel-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.imovel-loc {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.specs {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}
.spec { display: inline-flex; align-items: center; gap: 5px; }

/* --------- scroller (chips horizontais) --------- */
.scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroller::-webkit-scrollbar { display: none; }

/* --------- top bar --------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-dot {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

/* --------- section headings --------- */
.eyebrow {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.h-sec { font-size: clamp(24px, 4vw, 34px); font-weight: 820; }

/* --------- modal --------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fade 0.2s ease;
}
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 20px; }
}
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 460px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 24px;
  box-shadow: var(--sh-lg);
  animation: slideup 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  overflow-y: auto;
}
@media (min-width: 640px) {
  .modal { border-radius: var(--r-lg); }
}
@keyframes slideup {
  from { transform: translateY(40px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------- misc --------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.skeleton {
  background: linear-gradient(100deg, #eef1f6 30%, #f7f9fc 50%, #eef1f6 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--r);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.pill-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

/* ============================================================
   Layout do painel (grid lateral + conteúdo).
   No Next.js isto vivia em componentes React; aqui é CSS puro,
   consumido por <%= Seguranca.SideNav("modulo") %>.
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.side {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto; /* a nav cresce; sem isto os últimos itens somem */
}

.side .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  padding: 6px 10px 14px;
  letter-spacing: -0.02em;
}
.side .brand i { color: var(--brand); }

.side .nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side .nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: #cbd5e1;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.side .nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.side .nav a.active { background: var(--brand); color: #fff; }
.side .nav a i { width: 18px; text-align: center; opacity: 0.9; }

.side .nav .sep {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 14px 12px 6px;
}

.main {
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.content { padding: 24px; flex: 1; min-width: 0; }

/* Mobile: a lateral vira topo rolável */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side {
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
  }
  .side .brand { padding: 0 10px 0 4px; white-space: nowrap; }
  .side .nav { flex-direction: row; }
  .side .nav a { white-space: nowrap; }
  .side .nav .sep { display: none; }
  .content { padding: 16px; }
  .top { padding: 12px 16px; }
}

/* Item de menu cujo módulo ainda não foi portado (migração em andamento). */
.side .nav .soon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: #64748b;
  font-size: 14.5px;
  font-weight: 600;
  cursor: default;
  opacity: 0.55;
}
.side .nav .soon i { width: 18px; text-align: center; }
.side .nav .soon em {
  margin-left: auto;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}
@media (max-width: 900px) { .side .nav .soon em { display: none; } }

/* Degraus de gap que faltavam. O design system tinha só 4/8/12/16/24, mas as
   páginas usam 2/6/10/14/20 — sem estas regras, elas caíam em gap 0 e os
   elementos ficavam colados. */
.gap-2 { gap: 2px; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 10px; }
.gap-14 { gap: 14px; }
.gap-20 { gap: 20px; }
