:root {
  --navy: #14213d;
  --navy-2: #1f3160;
  --accent: #f28c28;
  --accent-2: #d9731a;
  --green: #1f9d55;
  --red: #d63939;
  --blue: #2563eb;
  --bg: #f4f6fa;
  --card: #fff;
  --text: #1c2233;
  --muted: #6b7385;
  --line: #e2e6ee;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(20, 33, 61, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; border-radius: 8px; padding: .75em 1.4em; font: 600 .95rem inherit; font-family: inherit; cursor: pointer; transition: .15s; }
.btn-sm { padding: .45em 1em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-outline-navy { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); text-decoration: underline; padding-inline: 0; }

/* Cabeçalho */
#header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; }
.logo small { display: block; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-top: -4px; }
.logo b { color: var(--accent); }
.logo-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.links { display: flex; align-items: center; gap: 22px; font-weight: 500; font-size: .92rem; }
.links a:hover { color: var(--accent); }
.badge-count { background: var(--accent); border-radius: 99px; font-size: .7rem; padding: 0 6px; }
.badge-count:empty { display: none; }
.user-box { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* Hero / carrossel */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.slides { display: flex; transition: transform .6s ease; }
.slide { min-width: 100%; min-height: 380px; display: flex; align-items: center; padding: 48px 0; background-size: cover; background-position: center; }
.slide h1 { font-size: clamp(1.6rem, 3.5vw, 2.6rem); font-style: italic; }
.slide p { font-size: 1.15rem; max-width: 560px; opacity: .92; }
.slide em { color: var(--accent); font-style: normal; font-weight: 700; }
.s1 { background: linear-gradient(110deg, #14213d 40%, #274b8a); }
.s2 { background: linear-gradient(110deg, #1b2f24 30%, #2f7a53); }
.s3 { background: linear-gradient(110deg, #3a1f14 30%, #b8652c); }
.s4 { background: linear-gradient(110deg, #2a1d4a 30%, #5a45a8); }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff3; color: #fff; font-size: 1.5rem; cursor: pointer; }
.hero-arrow:hover { background: #fff6; }
.hero-arrow.prev { left: 16px; } .hero-arrow.next { right: 16px; }
.dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #fff6; cursor: pointer; padding: 0; }
.dots button.on { background: var(--accent); width: 26px; border-radius: 6px; }

/* Busca */
.busca { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-top: -40px; position: relative; z-index: 5; }
.busca-grid { display: grid; grid-template-columns: repeat(3, 1fr) 180px; gap: 14px; align-items: end; }
.busca-grid .btn-busca { grid-row: span 2; align-self: stretch; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); padding: .65em .8em; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
input:disabled { background: #f1f3f7; }
.money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.money span { padding: 0 .7em; color: var(--muted); font-size: .9rem; }
.money input { border: 0; border-radius: 0; }
.avancados { display: none; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.avancados.open { display: grid; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: .9rem; cursor: pointer; }
.check input { width: auto; }
.busca-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; gap: 10px; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; max-height: 220px; overflow: auto; }
.ac-list div { padding: 8px 12px; cursor: pointer; color: var(--text); }
.ac-list div:hover { background: var(--bg); }

/* Atalhos */
.reticencias { align-self: center; color: var(--muted); padding: 0 4px; }
.atalhos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 28px 0; }
.atalho { background: #fff; border: 2px solid transparent; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.atalho b { display: block; font-size: 1.15rem; color: var(--navy); }
.atalho:hover, .atalho.on { border-color: var(--accent); }
.atalho.on { background: #fff7ef; }

/* Listagem */
.lista-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lista-topo h2 { margin: 0; }
.lista-topo select { width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.vazio { text-align: center; padding: 60px 20px; color: var(--muted); grid-column: 1 / -1; }
.paginacao { display: flex; justify-content: center; gap: 6px; margin: 30px 0; flex-wrap: wrap; }
.paginacao button { min-width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.paginacao button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.paginacao button:disabled { opacity: .4; cursor: default; }

/* Card */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(20, 33, 61, .14); }
.card-media { position: relative; aspect-ratio: 16/10; background: #ccd; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.tag { display: inline-block; background: var(--navy); color: #fff; font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 5px; }
.tag-red { background: var(--red); } .tag-green { background: var(--green); } .tag-blue { background: var(--blue); }
.tags-top { position: absolute; top: 10px; left: 10px; }
.tags-bottom { position: absolute; bottom: 10px; left: 10px; display: flex; gap: 4px; flex-wrap: wrap; max-width: 70%; }
.desconto { position: absolute; bottom: 10px; right: 10px; background: var(--green); color: #fff; font-weight: 800; padding: 4px 10px; border-radius: 6px; }
.fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: #bbb; font-size: 1.05rem; cursor: pointer; box-shadow: 0 2px 6px #0002; }
.fav.on { color: var(--red); }
.foto-count { position: absolute; top: 12px; right: 50px; background: #0008; color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 10px; }
.nav-foto { position: absolute; top: 50%; transform: translateY(-50%); background: #fffd; border: 0; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; opacity: 0; transition: .15s; }
.card:hover .nav-foto { opacity: 1; }
.nav-foto.prev { left: 8px; } .nav-foto.next { right: 8px; }
.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.tipo { font-size: .8rem; color: var(--muted); }
.cidade { font-weight: 700; color: var(--navy); }
.end { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.areas { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); margin: 4px 0; }
.aval { font-size: .82rem; color: var(--muted); }
.linha-preco { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 8px; }
.linha-preco small { display: block; font-size: .72rem; color: var(--muted); }
.linha-preco strong { font-size: 1.3rem; color: var(--navy); }
.restante { font-size: .75rem; color: var(--accent-2); font-weight: 600; }
.card > .btn { border-radius: 0; text-transform: uppercase; font-size: .82rem; letter-spacing: .03em; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 16, 30, .6); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .2s; }
.modal { background: #fff; border-radius: 14px; padding: 28px; width: min(560px, 100%); max-height: 90vh; overflow: auto; position: relative; }
.modal-sm { width: min(440px, 100%); }
.modal-x { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.modal-gate { background: linear-gradient(135deg, var(--navy), var(--navy-2)); padding: 10px; }
.gate { background: #fff; border-radius: 10px; padding: 34px 24px; text-align: center; }
.gate h3 { font-size: 1.4rem; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; padding: 10px; font: 600 1rem inherit; font-family: inherit; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--navy); border-color: var(--accent); }
.form { display: flex; flex-direction: column; gap: 12px; }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 10px; opacity: 0; transition: .3s; z-index: 200; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Rodapé */
#footer { background: var(--navy); color: #cfd6e6; margin-top: 60px; }
.cta-planilha { background: var(--accent); color: #fff; padding: 30px 0; }
.cta-planilha .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-planilha h3 { margin: 0; }
.cta-planilha p { margin: 4px 0 0; }
.cta-planilha .btn { background: var(--navy); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 44px 0; }
.footer-grid h4 { color: #fff; text-transform: uppercase; font-size: .85rem; letter-spacing: .06em; }
.footer-grid a:not(.logo) { display: block; padding: 3px 0; }
.footer-grid a:hover { color: var(--accent); }
.logo.light { color: #fff; margin-bottom: 12px; }
.copy { text-align: center; padding: 18px; border-top: 1px solid #ffffff18; font-size: .82rem; }
.whats { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 6px 18px #0003; z-index: 60; }
.to-top { position: fixed; right: 28px; bottom: 88px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; font-size: 1.1rem; cursor: pointer; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* Páginas internas */
.page-head { background: var(--navy); color: #fff; padding: 40px 0; }
.page-head p { opacity: .85; margin: 0; }
.box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.mt { margin-top: 24px; }

/* Detalhe do imóvel */
.det-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.galeria-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.galeria-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; }
.thumbs img { width: 90px; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .6; border: 2px solid transparent; }
.thumbs img.on { opacity: 1; border-color: var(--accent); }
.info-tab { width: 100%; border-collapse: collapse; }
.info-tab td { padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.info-tab td:first-child { color: var(--muted); width: 45%; }
.preco-box .de { color: var(--muted); text-decoration: line-through; }
.preco-box .por { font-size: 2rem; font-weight: 800; color: var(--navy); }
.contador { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 14px 0; }
.contador div { background: var(--bg); border-radius: 8px; padding: 8px 0; }
.contador b { display: block; font-size: 1.4rem; color: var(--navy); }
.contador small { font-size: .7rem; color: var(--muted); }
.sticky { position: sticky; top: 84px; }
.acoes { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

/* Simulador */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; align-items: start; }
.sim-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sim-form .full { grid-column: 1 / -1; }
.resumo td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.resumo td:last-child { text-align: right; font-weight: 600; }
.resumo tr.total td { font-size: 1.15rem; color: var(--navy); border-bottom: 0; padding-top: 14px; }
.resumo { width: 100%; border-collapse: collapse; }
.destaque { background: #fff7ef; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 8px; margin-top: 14px; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button { flex: 1; border: 0; background: #fff; padding: .6em; font: inherit; cursor: pointer; }
.segmented button.on { background: var(--navy); color: #fff; }

/* Planilha */
.tabela-wrap { overflow-x: auto; }
table.planilha { width: 100%; border-collapse: collapse; font-size: .85rem; background: #fff; }
.planilha th { background: var(--navy); color: #fff; text-align: left; padding: 10px; white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; }
.planilha td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.planilha tr:hover td { background: #fff7ef; }
.filtros-linha { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filtros-linha label { min-width: 160px; }

.faq details { background: #fff; border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { font-weight: 600; cursor: pointer; }
.passos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.passo { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.passo span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 8px; }

/* Documentos (edital / matrícula) */
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.doc-toolbar .segmented a { padding: .5em 1.2em; background: #fff; }
.doc-toolbar .segmented a.on { background: var(--navy); color: #fff; }
.doc-paper { background: #fff; max-width: 820px; margin: 0 auto; padding: 48px 56px; box-shadow: var(--shadow); border-radius: 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 1rem; line-height: 1.7; }
.doc-paper h2 { font-family: inherit; }
.doc-paper h3 { font-family: inherit; font-size: 1rem; margin: 1.4em 0 .3em; }
.doc-paper p { margin: 0 0 .6em; text-align: justify; }
.doc-aviso { text-align: center; font: 700 .75rem 'Inter', sans-serif; letter-spacing: .06em; color: var(--red); border: 1px dashed var(--red); padding: 6px; margin-bottom: 24px; }
@media print {
  #header, #footer, .no-print { display: none !important; }
  body { background: #fff; }
  .doc-paper { box-shadow: none; padding: 0; }
}

/* Responsivo */
@media (max-width: 960px) {
  .busca-grid { grid-template-columns: 1fr 1fr; }
  .busca-grid .btn-busca { grid-row: auto; grid-column: 1 / -1; }
  .avancados { grid-template-columns: 1fr 1fr; }
  .atalhos { grid-template-columns: repeat(2, 1fr); }
  .det-grid, .sim-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .passos { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: block; }
  .links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: flex-start; padding: 16px; }
  body.menu-open .links { display: flex; }
}
@media (max-width: 560px) {
  .busca-grid, .avancados, .sim-form, .footer-grid, .passos { grid-template-columns: 1fr; }
  .slide { min-height: 320px; }
  .doc-paper { padding: 24px 18px; }
  .hero-arrow { display: none; }
}
