/* Carteira do Corretor — app claro, login e destaques em "noite" com o sinal limão.
   Pares de texto/fundo >= 4,5:1; o limão só aparece como fundo de texto escuro
   ou sobre a noite, nunca como cor de texto em fundo claro. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.f4634c3bc1fa.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --ink: #111315;
  --muted: #565c64;
  --line: #dde0e4;
  --line-strong: #b9bfc6;
  --hover: #eceef0;

  --night: #0d0f11;
  --night-2: #17191c;
  --night-3: #22252a;
  --night-line: #2c3036;
  --night-ink: #f4f5f6;
  --night-muted: #a3aab2;

  --signal: #c5f23e;
  --signal-ink: #111315;

  --ok-ink: #17663f;
  --ok-bg: #e2f2e8;
  --warn-ink: #7a4b00;
  --warn-bg: #fbeed2;
  --danger: #b42318;
  --danger-bg: #fdecea;

  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Nomes antigos, ainda usados por algum estilo inline. */
  --brand: var(--ink);
  --brand-ink: #ffffff;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  accent-color: var(--ink);
  caret-color: var(--ink);
}

::selection { background: var(--signal); color: var(--signal-ink); }

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 180ms; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  z-index: 3;
}

.skip-link:focus { top: 0.75rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.tnum, .count, .price, .summary dd, .table td { font-variant-numeric: tabular-nums; }

/* Estrutura */
.shell { min-height: 100vh; min-height: 100dvh; }

main {
  padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

body:not(:has(.bottom-nav)) main { padding-bottom: 3rem; }

h1, h2, h3 {
  line-height: 1.12;
  margin: 0 0 0.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: 1.85rem; letter-spacing: -0.03em; }
h2 { font-size: 1.15rem; margin-top: 2rem; }

p { margin: 0 0 1rem; }

.lede, .help, .empty, .text-muted { color: var(--muted); }

.empty { margin: 0.25rem 0 0.5rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.narrow { max-width: 36rem; }

.legal { margin-top: 1rem; font-size: 0.92rem; }
.legal a { color: var(--muted); }

/* Barra inferior fixa: ícone + texto, item ativo numa pílula limão. */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
}

.nav-brand { display: none; }

.bottom-nav a {
  flex: 1 1 0;
  max-width: 10rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 56px;
  padding: 0.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.bottom-nav .nav-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 2rem;
  border-radius: 999px;
  transition: background-color 240ms var(--ease);
}

.bottom-nav svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }

.bottom-nav a[aria-current="page"] .nav-icon { background: var(--signal); }

.bottom-nav a:hover:not([aria-current="page"]) .nav-icon { background: var(--hover); }

/* Cabeçalho de página e ações */
.page-head,
.actions,
.search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}

.page-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.page-head h1 { margin: 0; }

.actions { margin: 0 0 1.25rem; }

.actions > a { display: inline-flex; align-items: center; min-height: 44px; }

/* Botões: área de toque >= 44 px. */
.primary,
.secondary,
.danger,
.bottom-nav a,
.pager a {
  min-height: 44px;
}

.primary,
.secondary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.primary:active,
.secondary:active,
.danger:active { transform: scale(0.98); }

.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.primary:hover { background: #2a2e33; border-color: #2a2e33; }

.primary.wide { width: 100%; }

.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.secondary:hover { background: var(--hover); }

.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.danger-link { color: var(--danger); text-decoration-color: currentColor; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

button:disabled,
.primary[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* Formulários */
.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.req {
  font-weight: 450;
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.2rem;
}

.control,
select,
textarea,
input[type="search"],
input[type="password"],
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="month"],
input[type="file"],
input[type="number"] {
  width: 100%;
  min-height: 48px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

textarea { min-height: 7rem; line-height: 1.5; }

input::placeholder,
textarea::placeholder { color: #6b7179; }

.control:focus,
select:focus,
textarea:focus,
input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(17 19 21 / 0.14);
}

/* Grupos de rádio e caixas de marcar recebem "control" do form: sem moldura. */
div.control:has(input[type="radio"]),
div.control:has(input[type="checkbox"]) {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

input[type="file"] { padding: 0.45rem; color: var(--muted); }

input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 0.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgb(180 35 24 / 0.12);
}

fieldset.unit-set {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 0;
  margin: 0 0 1.25rem;
  min-width: 0;
}

fieldset.unit-set legend { font-weight: 650; padding: 0 0.4rem; }

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.error { color: var(--danger); margin: 0.4rem 0 0; font-size: 0.92rem; }

.error-summary {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
}

.error-summary .error { margin: 0.2rem 0; }

.help { font-size: 0.88rem; margin-top: 0.35rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }

.message {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.message.error {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Cartões e listas */
.cards { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }

.card {
  display: grid;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

a.card { min-height: 44px; }

a.card:hover { border-color: var(--line-strong); background: #fbfbfc; }

.card strong { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }

/* Nome do cliente dentro do card: o link cobre o alvo de toque mínimo. */
.card strong a { display: inline-flex; align-items: center; min-height: 44px; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.card-value {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card .tags { margin: 0.35rem 0 0; }

/* Abas das listas (Todos, Chamar hoje, Esfriando). */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0 0 1rem;
  background: var(--hover);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}

.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(17 19 21 / 0.12); }

/* Filtros extras recolhidos (lista de imóveis). */
details.filters { flex: 1 1 100%; }

details.filters > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Selos: sempre com texto (nunca só cor). */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--hover);
  color: var(--ink);
}

.badge-warn { color: var(--warn-ink); background: var(--warn-bg); }
.badge-ok { color: var(--ok-ink); background: var(--ok-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-muted { color: #3f444b; background: var(--hover); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.25rem 0 1rem; }

/* Ficha e resumos */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}

.facts div { margin: 0; min-width: 0; }
.facts dt { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.facts dd { margin: 0.15rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Resumo da importação: uma faixa só, números lado a lado. */
.summary {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 0 0 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary > div { padding: 0.75rem 0.7rem; min-width: 0; }

.summary > div + div { border-left: 1px solid var(--line); }

.summary dt { color: var(--muted); font-size: 0.75rem; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary dd { margin: 0.1rem 0 0; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; }

/* Ficha do cliente */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 44px;
  margin: -0.5rem 0 0.25rem -0.3rem;
  color: var(--muted);
  font-weight: 550;
  font-size: 0.92rem;
  text-decoration: none;
}

.back-link svg,
.phone-link svg,
.profile-actions svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-head .page-head { margin-bottom: 0.5rem; align-items: flex-start; }

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.9rem;
  margin: 0 0 1.1rem;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.profile-actions {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 0.5rem;
}

.profile-actions .primary { flex: 1 1 auto; min-height: 50px; }

.profile-actions .inline-form { display: flex; flex: 0 0 auto; }

.profile-actions .secondary { min-height: 50px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 2rem;
}

.section-head h2 { margin: 0; }

.section-note {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.pocket .match-list { margin-top: 0.75rem; }

.facts .wide { grid-column: 1 / -1; }

/* Textos longos (termos e privacidade) */
.prose { max-width: 40rem; }

.prose h2 { font-size: 1.15rem; margin: 2rem 0 0.6rem; }

.prose h3 { font-size: 0.98rem; margin: 1.25rem 0 0.4rem; }

.prose p,
.prose li { line-height: 1.6; max-width: 68ch; }

.prose ul { padding-left: 1.2rem; margin: 0 0 1rem; }

.prose li + li { margin-top: 0.4rem; }

.prose li::marker { color: var(--muted); }

/* Lacuna que o Gui precisa preencher antes de publicar. */
.prose mark {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 0 0.25rem;
  border-radius: 4px;
  font-weight: 600;
}

body:not(:has(.bottom-nav)) .prose strong { color: var(--night-ink); }

body:not(:has(.bottom-nav)) .prose li { color: var(--night-muted); }

/* Início */
.home-date {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.home-head { margin-bottom: 1rem; }

.home-head h1 { margin: 0; }

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
}

.home-actions .secondary { width: 100%; }

.home-actions svg,
.plus-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.home-grid { display: grid; gap: 0.75rem; margin: 0 0 1rem; }

.home-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.5rem;
}

.home-card h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.home-card .count {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}

.home-card ul { list-style: none; padding: 0; margin: 0.25rem 0 0; }

.home-card li + li { border-top: 1px solid var(--line); }

.home-card li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  text-decoration: none;
  color: inherit;
}

.home-card li a > span:first-child { font-weight: 600; }

.home-card .text-muted { font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.home-card .more-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 0.92rem;
}

.home-card .empty { padding: 0.25rem 0 0.75rem; }

/* "Chamar hoje": o cartão da noite, a única área escura do app. */
.home-card.is-today {
  background: var(--night);
  border-color: var(--night);
  color: var(--night-ink);
  padding: 1.15rem 1.15rem 0.6rem;
}

.home-card.is-today h2 { font-size: 1.1rem; color: var(--night-ink); }

.home-card.is-today .count { font-size: 3rem; color: var(--signal); }

.home-card.is-today li + li { border-color: var(--night-line); }

.home-card.is-today .text-muted { color: var(--night-muted); }

.home-card.is-today a { color: var(--night-ink); text-decoration-color: var(--night-line); }

.home-card.is-today .more-link { color: var(--signal); text-decoration-color: rgb(197 242 62 / 0.4); }

.home-card.is-today .empty { color: var(--night-muted); }

.home-card.is-today :focus-visible { outline-color: var(--signal); }

.chev {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.5;
}

.row-end { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Recuperáveis: uma linha que leva à lista. */
.home-recover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}

.home-recover:hover { border-color: var(--line-strong); }

.home-recover .count-line {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.home-recover .help { display: block; margin: 0.1rem 0 0; }

.count-line { color: var(--muted); font-size: 0.95rem; }

/* Cruzamento */
.match-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }

.match-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.3rem;
}

.match-row .price { font-weight: 650; font-size: 1.15rem; letter-spacing: -0.02em; white-space: nowrap; }

.match-row .reason { color: var(--muted); font-size: 0.92rem; }

/* Régua do "Cabe no bolso": do 60% do orçamento ao limite com tolerância.
   O texto do motivo diz o mesmo em palavras; a régua é só leitura rápida. */
.match-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.match-top > div:first-child { min-width: 0; }

.match-top .price { flex: none; }

.match-top strong { font-weight: 650; }

.match-unit { color: var(--muted); }

.ruler {
  position: relative;
  height: 40px;
  margin: 0.2rem 0 0;
}

.ruler > span { position: absolute; top: 11px; }

/* Valor do orçamento colado à esquerda da marca: nunca vaza do cartão. */
.ruler > .ruler-label {
  top: 24px;
  right: calc(100% - var(--budget) + 6px);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ruler-track {
  left: 0;
  right: 0;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
  background: var(--hover);
}

.ruler-over {
  left: var(--budget);
  right: 0;
  height: 6px;
  margin-top: -3px;
  border-radius: 0 999px 999px 0;
  background: repeating-linear-gradient(135deg, var(--warn-bg) 0 4px, #f3d9a4 4px 7px);
}

.ruler-budget {
  left: var(--budget);
  width: 2px;
  height: 18px;
  margin: -9px 0 0 -1px;
  border-radius: 2px;
  background: var(--ink);
}

.ruler-dot {
  left: var(--price);
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--signal);
  border: 2px solid var(--ink);
  transform: scale(0);
  animation: dot-in 520ms var(--ease) 120ms forwards;
}

.match-row.is-over .ruler-dot { background: #f2c14e; }

@keyframes dot-in { to { transform: scale(1); } }

/* Busca e filtros */
.search { margin-bottom: 1rem; }
.search .control { width: auto; min-width: min(100%, 14rem); flex: 1 1 14rem; }
.search-field { flex: 1 1 12rem; }
.search-field .control { width: 100%; min-width: 0; }
.search button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  cursor: pointer;
}

/* Tabelas roláveis dentro do próprio container (a página não rola na horizontal) */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }

.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

.table tr:last-child td { border-bottom: 0; }

.table th { background: var(--bg); font-weight: 600; color: var(--muted); font-size: 0.82rem; }

/* Caixas de marcar com alvo de toque grande */
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.5rem; }

.check-list label {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  min-height: 44px;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 550;
  cursor: pointer;
}

.check-list label:has(input:checked) { border-color: var(--ink); }

.check-list input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  flex: none;
}

.check-list .why { display: block; color: var(--muted); font-weight: 400; font-size: 0.9rem; }

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.pager a { display: inline-flex; align-items: center; font-weight: 600; }

.row-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.row-links a { display: inline-flex; align-items: center; min-height: 44px; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 2.5rem;
  font-size: 0.85rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

.inline-form { display: inline; }

.edited-note { color: var(--warn-ink); font-size: 0.9rem; }

/* Caixa de marcar solta no formulário (ex.: "Quer suíte"). O rótulo também marca. */
.field input[type="checkbox"] {
  width: 26px;
  height: 26px;
  margin: 8px 0;
}

.field:has(> input[type="checkbox"]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.6rem;
}

.field:has(> input[type="checkbox"]) > label {
  order: 1;
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
}

.field:has(> input[type="checkbox"]) > :not(input, label) { order: 2; flex-basis: 100%; }

/* "Excluir esta tipologia": o rótulo inteiro é o alvo de toque. */
.delete-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}

.delete-row input[type="checkbox"] {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
}

/* Bloco recolhível do formulário (ex.: perfil de compra no cadastro). */
details.more {
  margin: 0.5rem 0 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

details.more > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--ink);
  font-weight: 650;
}

details.more > summary .help { font-weight: 400; margin: 0; }

/* Grupo de campos com legenda (botões de quantidade, lista de bairros). */
fieldset.field {
  border: 0;
  margin: 0 0 1.1rem;
  padding: 0;
  min-width: 0;
}

fieldset.field > legend {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  padding: 0;
}

/* Dormitórios e vagas: botões de toque (Qualquer, 1, 2, 3, 4+). */
fieldset.field > div:has(> div > label > input.segment) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

fieldset.field label:has(> input.segment) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  margin: 0;
  padding: 0 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

fieldset.field input.segment {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

fieldset.field label:has(> input.segment:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

fieldset.field label:has(> input.segment:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Bairros: caixas de marcar agrupadas por cidade. */
fieldset.field input.pick {
  width: 1.35rem;
  height: 1.35rem;
}

fieldset.field label:has(> input.pick) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 500;
}

fieldset.field > div > div > label:not(:has(input)) {
  display: block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Cidades escolhidas como etiquetas. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.chip {
  min-height: 44px;
  padding: 0 0.95rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Na tipologia, grupos de botões ocupam a linha inteira da grade. */
.unit-grid > fieldset.field { grid-column: 1 / -1; margin-bottom: 0; }

/* ---------- Entrada (login e telas sem sessão) ---------- */

.gate {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--night-ink);
  overflow: hidden;
  isolation: isolate;
}

.gate-map {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.gate-layer {
  position: absolute;
  inset: 0;
  animation: map-drift 40s var(--ease) both;
  transform-origin: 62% 30%;
}

.gate-map img,
.gate-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Escurece o mapa por baixo do formulário. */
.gate-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(13 15 17 / 0) 25%, rgb(13 15 17 / 0.82) 55%, var(--night) 72%);
}

.pin { fill: var(--signal); opacity: 0; animation: pin-in 700ms var(--ease) forwards; }
.pin-halo { fill: none; stroke: var(--signal); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.pin-halo.is-live { animation: halo 2.6s 2.2s ease-out infinite; }

@keyframes map-drift { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes pin-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes halo {
  0% { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(2.4); }
}

.gate-inner {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 26rem;
  margin: 0 auto;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.gate-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--signal);
}

.gate-mark svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: var(--signal-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.gate-body { margin-top: auto; padding-top: 26vh; }

.gate h1 {
  font-size: clamp(2.3rem, 11vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 650;
  margin: 0 0 0.75rem;
}

.gate h1 em { font-style: normal; color: var(--signal); }

.gate .lede { color: var(--night-muted); margin: 0 0 1.5rem; }

.gate label { color: var(--night-ink); font-weight: 550; }

.gate input[type="text"],
.gate input[type="password"] {
  background: var(--night-2);
  border-color: var(--night-line);
  color: var(--night-ink);
  caret-color: var(--signal);
}

.gate input:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgb(197 242 62 / 0.22);
}

.gate input[aria-invalid="true"] { border-color: #ff8a80; }

.gate .error,
.gate .error-summary { color: #ffb4ab; }

.gate .error-summary { background: rgb(180 35 24 / 0.18); border-color: rgb(255 138 128 / 0.5); }

.gate :focus-visible { outline-color: var(--signal); }

.gate .primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--signal-ink);
  min-height: 54px;
  font-size: 1.05rem;
  margin-top: 0.4rem;
}

.gate .primary:hover { background: #d3f86a; border-color: #d3f86a; }

.gate-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--night-muted);
}

.gate-foot a { color: var(--night-muted); text-decoration-color: var(--night-line); display: inline-flex; align-items: center; min-height: 44px; }

.gate-foot nav { display: flex; gap: 1rem; }

.gate-credit { width: 100%; font-size: 0.72rem; opacity: 0.8; }

/* Telas sem sessão que não são o login (termos, bloqueio, conta apagada, 404):
   a mesma noite do login, sem o mapa. */
body:not(:has(.bottom-nav)):not(:has(.gate)) {
  background:
    linear-gradient(180deg, var(--night) 35%, rgb(13 15 17 / 0.55) 100%),
    url("mapa-santo-andre.dc1285c70ffe.svg") center bottom / cover no-repeat fixed,
    var(--night);
  color: var(--night-ink);
}

body:not(:has(.bottom-nav)):not(:has(.gate)) main { max-width: 34rem; padding-top: calc(1.5rem + env(safe-area-inset-top)); }

.page-brand { margin-bottom: 12vh; color: var(--night-ink); text-decoration: none; min-height: 44px; }

body:not(:has(.bottom-nav)) .panel {
  background: transparent;
  border: 0;
  padding: 0;
}

body:not(:has(.bottom-nav)):not(:has(.gate)) h1 { font-size: 2.2rem; letter-spacing: -0.04em; }

body:not(:has(.bottom-nav)) :is(.lede, .text-muted, .help, p) { color: var(--night-muted); }

body:not(:has(.bottom-nav)) a { color: var(--night-ink); text-decoration-color: var(--night-line); }

body:not(:has(.bottom-nav)) .site-footer a { color: var(--night-muted); }

body:not(:has(.bottom-nav)) .primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }

body:not(:has(.bottom-nav)) .primary:hover { background: #d3f86a; border-color: #d3f86a; }

body:not(:has(.bottom-nav)) :focus-visible { outline-color: var(--signal); }

body:not(:has(.bottom-nav)) .message { background: var(--night-3); color: var(--night-ink); }

/* Telas sem sessão que não são o login (bloqueio, conta excluída). */
.gate-panel { margin: 10vh auto 0; }

.gate-title { color: var(--ink); }

@media (min-width: 720px) {
  main { padding-top: 2rem; }
  .home-grid { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .home-grid .home-recover { grid-column: 1 / -1; }
  .gate-body { padding-top: 22vh; }
}

/* No desktop, a barra de baixo vira barra de topo com a marca. */
@media (min-width: 960px) {
  .bottom-nav {
    top: 0;
    bottom: auto;
    justify-content: flex-start;
    gap: 0.25rem;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem max(1.5rem, calc((100vw - 72rem) / 2));
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: auto;
    font-weight: 650;
    letter-spacing: -0.01em;
  }

  .nav-brand .gate-mark { width: 2rem; height: 2rem; border-radius: 9px; }

  .bottom-nav a {
    flex: 0 0 auto;
    flex-direction: row;
    gap: 0.35rem;
    max-width: none;
    min-height: 44px;
    padding: 0 0.6rem 0 0.25rem;
    font-size: 0.92rem;
  }

  .bottom-nav .nav-icon { width: 2.4rem; height: 2rem; }

  body:has(.bottom-nav) main { padding: calc(4rem + 2rem) 1.5rem 3rem; }
}

@media (min-width: 960px) {
  .gate-inner { margin: 0 0 0 max(4rem, 8vw); }
  .gate-map::after {
    background: linear-gradient(90deg, var(--night) 0, rgb(13 15 17 / 0.9) 32rem, rgb(13 15 17 / 0.1) 60%);
  }
  .gate-body { padding-top: 0; margin: auto 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .pin-halo.is-live { animation: none; opacity: 0; }
  @view-transition { navigation: none; }
}
