/* =====================================================================
   Kolodi Imóveis · Formulário Barra Sul
   Identidade: manual da marca 2026 (paleta escura, prata, champagne só como acento)
   Fonte: Instrument Sans (sem serifa, conforme pedido)
   ===================================================================== */

@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/InstrumentSans.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --preto: #0A0A0A;          /* Preto Kolodi · fundo */
  --superficie: #111316;
  --superficie-2: #16191D;
  --prata-clara: #C9CDD4;    /* ícones e detalhes */
  --branco-off: #F5F5F3;     /* títulos */
  --prata-media: #8A8F98;    /* textos de apoio */
  --champagne: #B08D57;      /* acento: filetes e progresso, nunca fundo */
  --linha: rgba(201, 205, 212, .12);
  --linha-forte: rgba(201, 205, 212, .34);
  --erro: #E58B7D;

  --raio: 14px;
  --gutter: 24px;
  --app-max: 480px;
  --bar-h: 96px;
  --t: 280ms cubic-bezier(.2, .7, .2, 1);
  --fonte: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--preto);
  color: var(--branco-off);
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estrutura de app ---------- */
.backdrop { display: none; }

.app {
  position: relative;
  max-width: var(--app-max);
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--preto);
}

.screens { position: absolute; inset: 0; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  transition: opacity var(--t), transform var(--t), visibility 0s linear 280ms;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 240ms ease 90ms, transform 280ms cubic-bezier(.2, .7, .2, 1) 90ms, visibility 0s;
}
/* a tela que sai some rápido, para não sobrepor textos durante a troca */
.screen.is-leaving, .screen.is-leaving-back {
  transition: opacity 120ms ease, transform 200ms ease, visibility 0s linear 200ms;
}
.screen.is-leaving-back { transform: translateX(24px); }
.screen.is-leaving { transform: translateX(-24px); }

/* ---------- Topbar ---------- */
.topbar {
  position: absolute;
  z-index: 5;
  top: 0; left: 0; right: 0;
  height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  background: var(--preto);
}
.topbar-logo { justify-self: center; height: 28px; width: auto; }
.topbar-count {
  justify-self: end;
  padding-right: 6px;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--prata-media);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--linha);
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--champagne);
  transition: width var(--t);
}

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--prata-clara);
}
.icon-btn:active { background: rgba(255, 255, 255, .06); }
.icon-btn:disabled { visibility: hidden; }

/* ---------- Tipografia ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--prata-media);
}
.filete { display: inline-block; width: 28px; height: 1px; background: var(--champagne); flex: none; }
.filete-centro { display: block; margin: 28px auto; }

.titulo {
  margin: 0;
  font-size: clamp(26px, 7.4vw, 31px);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.subtitulo {
  margin: 12px 0 0;
  color: var(--prata-media);
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- Capa ---------- */
.screen-capa { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }

.capa-hero {
  position: relative;
  flex: none;
  height: 52vh;
  height: 52dvh;
  min-height: 320px;
  overflow: hidden;
}
.capa-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 40% 30%;
  /* fotografia Kolodi: tons frios, contraste, sem saturação exagerada */
  filter: saturate(.78) contrast(1.06) brightness(.92);
  animation: zoom 14s ease-out both;
}
@keyframes zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.capa-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,10,.88) 0%, rgba(10,10,10,.45) 18%, rgba(10,10,10,0) 34%),
    linear-gradient(0deg, var(--preto) 0%, rgba(10,10,10,.5) 32%, rgba(10,10,10,0) 62%);
}
.capa-logo {
  position: absolute;
  z-index: 1;
  top: calc(20px + env(safe-area-inset-top));
  left: var(--gutter);
  height: 38px;
  width: auto;
}

.capa-body {
  position: relative;
  margin-top: -64px;
  padding: 0 var(--gutter) calc(var(--bar-h) + 40px + env(safe-area-inset-bottom));
}
.capa-titulo {
  margin: 0;
  font-size: clamp(31px, 8.8vw, 38px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.capa-texto {
  margin: 16px 0 0;
  color: var(--prata-clara);
  opacity: .82;
  font-size: 15.5px;
  line-height: 1.6;
  text-wrap: pretty;
}

.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0 0;
  border-top: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
}
.specs div { padding: 16px 0; }
.specs div + div { padding-left: 16px; border-left: 1px solid var(--linha); }
.specs dt { font-size: 17px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.specs dd { margin: 2px 0 0; font-size: 12.5px; color: var(--prata-media); }

.galeria {
  display: flex;
  gap: 10px;
  margin: 24px calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.galeria::-webkit-scrollbar { display: none; }
.galeria button {
  flex: none;
  width: 132px;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 1px solid var(--linha);
  border-radius: 10px;
  overflow: hidden;
  background: var(--superficie);
  scroll-snap-align: start;
}
.galeria img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.8) contrast(1.04);
  transition: transform var(--t);
}
.galeria button:active img { transform: scale(.97); }

/* ---------- Barra de ação (fixa no rodapé, sobe junto com o teclado) ---------- */
.actionbar {
  position: absolute;
  z-index: 4;
  left: 0; right: 0; bottom: var(--kb, 0px); /* --kb = altura do teclado (visualViewport) */
  padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--preto) 72%, rgba(10,10,10,0));
}
.actionbar-capa { position: fixed; bottom: 0; max-width: var(--app-max); margin: 0 auto; }
.screen-capa:not(.is-active) .actionbar-capa { visibility: hidden; }
.micro {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--prata-media);
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--raio);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  transition: transform 120ms, opacity var(--t), background var(--t);
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn-primary { background: var(--branco-off); color: var(--preto); }
.btn-primary:disabled { background: var(--superficie-2); color: #5d626a; cursor: default; }
.btn-ghost {
  margin-top: 32px;
  background: transparent;
  color: var(--branco-off);
  border: 1px solid var(--linha-forte);
}

.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(10,10,10,.2);
  border-top-color: var(--preto);
  border-radius: 50%;
  animation: gira .7s linear infinite;
}
.btn.is-loading .spinner { display: block; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Perguntas ---------- */
.screen-pergunta { padding-top: calc(64px + env(safe-area-inset-top)); }
.pergunta {
  flex: 1;
  overflow-y: auto;
  padding: 36px var(--gutter) calc(var(--bar-h) + 32px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.screen-opcoes .pergunta { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

.opcoes { display: grid; gap: 10px; margin-top: 28px; }
.opcao {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 14px 16px 14px 18px;
  text-align: left;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--superficie);
  transition: border-color var(--t), background var(--t);
}
.opcao-texto { flex: 1; }
.opcao-rotulo { display: block; font-size: 16px; font-weight: 500; line-height: 1.3; }
.opcao-dica { display: block; margin-top: 3px; font-size: 13px; color: var(--prata-media); }
.opcao-check {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1px solid var(--linha-forte);
  border-radius: 50%;
  transition: background var(--t), border-color var(--t);
}
.opcao-check svg { opacity: 0; transition: opacity var(--t); }
@media (hover: hover) { .opcao:hover { border-color: var(--linha-forte); } }
.opcao[aria-checked="true"] { border-color: var(--prata-clara); background: var(--superficie-2); }
.opcao[aria-checked="true"] .opcao-check { background: var(--branco-off); border-color: var(--branco-off); }
.opcao[aria-checked="true"] .opcao-check svg { opacity: 1; }

/* ---------- Campos ---------- */
.campo {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 28px;
  border: 1px solid var(--linha-forte);
  border-radius: var(--raio);
  background: var(--superficie);
  transition: border-color var(--t);
}
.campo:focus-within { border-color: var(--prata-clara); }
.campo input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 18px; /* ≥16px: o iPhone não dá zoom */
  letter-spacing: .005em;
}
.campo input::placeholder { color: #5d626a; }
.campo-busca input { padding-left: 48px; }
.campo-icone { position: absolute; left: 16px; color: var(--prata-media); pointer-events: none; }
.campo.is-invalido { border-color: var(--erro); }

.sugestoes {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--superficie);
}
.sugestoes li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 12px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}
.sugestoes li span { font-size: 13px; letter-spacing: .1em; color: var(--prata-media); }
.sugestoes li[aria-selected="true"], .sugestoes li:active { background: var(--superficie-2); }
.sugestoes .vazio { color: var(--prata-media); cursor: default; }

.telefone { display: flex; gap: 8px; margin-top: 28px; }
.telefone .campo { margin-top: 0; }
.ddi {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  background: var(--superficie);
  font-size: 17px;
  color: var(--prata-clara);
}
.ddi svg { border-radius: 3px; }
.campo-ddd { flex: 0 0 76px; }
.campo-ddd input { text-align: center; padding: 0 8px; }
.campo-numero { flex: 1; min-width: 0; }

.erro { min-height: 20px; margin: 10px 2px 0; font-size: 14px; color: var(--erro); }
.erro:empty { min-height: 0; margin: 0; }
.nota {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 2px 0;
  font-size: 13px;
  color: var(--prata-media);
}

/* ---------- Encerramentos ---------- */
.screen-fim { justify-content: center; }
.fim { padding: 40px calc(var(--gutter) + 8px); text-align: center; }
.fim-logo { width: 132px; height: auto; margin: 0 auto; }
.fim .subtitulo { margin-top: 16px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(5, 5, 5, .97);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lightbox-fechar { position: absolute; z-index: 1; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lightbox-trilho {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.lightbox-trilho::-webkit-scrollbar { display: none; }
.lightbox figure {
  flex: 0 0 100%;
  margin: 0;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  height: 78vh;
  height: 78dvh;
}
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; filter: saturate(.85) contrast(1.04); }
.lightbox-contador {
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--prata-media);
}

/* ---------- Desktop: o app fica no centro sobre a foto escurecida ---------- */
@media (min-width: 641px) {
  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: url('/img/fachada.webp') center / cover no-repeat;
    filter: saturate(.5) brightness(.32) blur(2px);
    transform: scale(1.04);
  }
  .app {
    height: min(860px, calc(100dvh - 48px));
    margin-top: max(24px, calc((100dvh - 860px) / 2));
    border: 1px solid var(--linha);
    border-radius: 24px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  }
  .actionbar-capa { position: absolute; }
  .capa-hero { height: 440px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
}

/* =====================================================================
   Intuitividade: ícones, dicas, atalhos de cidade, fotos
   ===================================================================== */

/* Ícone à esquerda de cada opção */
.opcao-icone {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(201, 205, 212, .06);
  color: var(--prata-clara);
  transition: background var(--t), color var(--t);
}
.opcao[aria-checked="true"] .opcao-icone { background: rgba(176, 141, 87, .14); color: var(--champagne); }
.opcao { padding-left: 12px; }

/* "Toque em uma opção para avançar" (só na 1ª pergunta) */
.dica-toque {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--prata-media);
}

/* Cidade: estado selecionado e botão de trocar */
.campo-busca .icone-ok { display: none; color: var(--champagne); }
.campo-busca.is-selecionada .icone-ok { display: block; }
.campo-busca.is-selecionada .icone-busca { display: none; }
.campo-busca.is-selecionada { border-color: var(--prata-clara); }
.campo-limpar {
  flex: none;
  width: 44px; height: 44px;
  margin-right: 6px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--prata-media);
}
.campo-limpar:active { background: rgba(255, 255, 255, .06); }

/* Atalhos das cidades mais comuns */
.atalhos-bloco { margin-top: 24px; }
.atalhos-titulo {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--prata-media);
}
.atalhos { display: flex; flex-wrap: wrap; gap: 8px; }
.atalho {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--linha-forte);
  border-radius: 999px;
  background: var(--superficie);
  font-size: 15px;
  transition: border-color var(--t), background var(--t);
}
.atalho:active { background: var(--superficie-2); }
.atalho[aria-pressed="true"] { border-color: var(--branco-off); background: var(--branco-off); color: var(--preto); }

/* Capa: botão "Ver 6 fotos" sobre a foto */
.chip-fotos {
  position: absolute;
  z-index: 1;
  top: calc(22px + env(safe-area-inset-top));
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(245, 245, 243, .28);
  border-radius: 999px;
  background: rgba(10, 10, 10, .45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 500;
  color: var(--branco-off);
}

/* Botão do WhatsApp: ícone some enquanto verifica */
.btn-icone { flex: none; }
.btn.is-loading .btn-icone { display: none; }
.actionbar .micro { margin-top: 10px; }

/* Lightbox: setas no computador, dica de deslizar no celular */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(255, 255, 255, .06);
}
.lightbox-ant { left: 16px; }
.lightbox-prox { right: 16px; }
.lightbox-dica { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--prata-media); }
@media (hover: none) { .lightbox-nav { display: none; } }
@media (hover: hover) { .lightbox-dica { display: none; } }
