/* ============================================================
   CADASTRO DA FEIRA — Raízes Mantiqueira + Origen Residence
   Uma fonte de cada marca (Newsreader do Origen, Archivo do Raízes),
   um verde entre os dois e as duas torres em imagem real.
   ============================================================ */

:root {
  --verde: #2f4333;          /* entre o verde do Raízes e o do Origen */
  --noite: #18211b;
  --nevoa: #eceee6;
  --nevoa-suave: rgba(236, 238, 230, .74);
  --papel: #fbfbf8;
  --traco: rgba(240, 213, 158, .3);
  --sombra: rgba(18, 25, 20, .22);
  --campo: rgba(18, 25, 20, .36);
  --campo-foco: rgba(18, 25, 20, .52);
  --cobre: #c8925f;
  --aurora: #f0d59e;
  --luz: #fbeac2;
  --erro: #ffc4b2;
  --erro-borda: #e8825f;

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Archivo', 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* barra de rolagem: só um fio dourado, sem setas e sem trilho */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner { background: transparent; }
html::-webkit-scrollbar-track { background: var(--verde); }
::-webkit-scrollbar-thumb { border-radius: 6px; background: rgba(240, 213, 158, .3); }
::-webkit-scrollbar-thumb:hover { background: rgba(240, 213, 158, .55); }

@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: rgba(240, 213, 158, .3) var(--verde); }
}

body {
  margin: 0;
  background: var(--verde);
  color: var(--nevoa);
  font: 400 17px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }

[hidden] { display: none !important; }

button, input, textarea { font: inherit; color: inherit; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

legend { padding: 0; }

:focus-visible {
  outline: 2px solid var(--aurora);
  outline-offset: 2px;
}

/* ── página: as torres ficam paradas e o formulário rola ── */
.pagina {
  display: grid;
  grid-template-columns: minmax(340px, 38%) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.painel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(32px, 5vh, 64px) clamp(24px, 4.5vw, 64px) clamp(40px, 6vh, 72px);
}

/* ondas douradas atrás de tudo (assets/js/ondas.js): abaixo das fotos e dos campos */
#ondas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── as duas torres: o empreendimento escolhido ganha espaço e o outro recua ── */
.vitrine {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.foto {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  transition: flex-grow .8s var(--ease);
}

.foto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter .8s ease;
}

.foto-raizes img { object-position: 58% 30%; }
.foto-origen img { object-position: 52% 40%; }

/* a imagem se funde no verde da página, e o logo fica assentado nele */
.foto::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 54%;
  background: linear-gradient(180deg, rgba(47, 67, 51, 0) 0%, rgba(47, 67, 51, .66) 52%, var(--verde) 94%);
}

.foto figcaption {
  position: absolute;
  left: clamp(20px, 2.6vw, 36px);
  bottom: clamp(14px, 2.6vh, 26px);
  z-index: 1;
  color: var(--papel);
}

.foto svg { display: block; width: auto; height: clamp(44px, 7.6vh, 66px); }

[data-foco="raizes"] .foto-raizes,
[data-foco="origen"] .foto-origen { flex-grow: 1.9; }

[data-foco="raizes"] .foto-origen img,
[data-foco="origen"] .foto-raizes img { filter: saturate(.5) brightness(.6); }

/* ── formulário ── */
.painel h1 {
  font: 300 clamp(29px, 4.4vh, 36px)/1.12 var(--serif);
  letter-spacing: -.005em;
  color: var(--papel);
}

.subtitulo { margin: 4px 0 26px; font-size: 15px; color: var(--aurora); }

.aviso {
  margin-bottom: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--erro-borda);
  background: rgba(163, 52, 31, .32);
  color: #ffe3da;
}

.isca { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.grupo { margin-bottom: 24px; }

.grupo legend,
.campo label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
}

.opcional { font-weight: 400; color: var(--nevoa-suave); }

.bloco { margin-top: 8px; }

.bloco h3 {
  margin-bottom: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--traco);
  font: 400 23px/1.2 var(--serif);
  color: var(--papel);
}

/* cliente ou corretor: a escolha que muda o formulário inteiro */
.perfil {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: var(--sombra);
}

.perfil input,
.obra input,
.pilula input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.perfil label { position: relative; display: block; cursor: pointer; }

.perfil span {
  display: block;
  padding: 13px 10px;
  border-radius: 11px;
  text-align: center;
  font-weight: 500;
  color: var(--nevoa-suave);
  transition: background .25s ease, color .25s ease;
}

.perfil input:checked + span { background: var(--aurora); color: var(--noite); }

.perfil input:focus-visible + span,
.obra input:focus-visible + .obra-corpo,
.pilula input:focus-visible + span {
  outline: 2px solid var(--aurora);
  outline-offset: 2px;
}

/* empreendimentos: cobre no Raízes, aurora no Origen, os dois em Ambos */
.obras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.obra { position: relative; display: block; cursor: pointer; }

.obra-corpo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 112px;
  padding: 14px 8px;
  border: 1.5px solid var(--traco);
  border-radius: 12px;
  background: var(--sombra);
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}

.obra-emblemas { display: flex; justify-content: center; }

.obra-emblemas svg { display: block; width: 44px; height: 44px; }

.obra-ambos .obra-emblemas svg + svg { margin-left: -9px; }

.obra-raizes input:checked + .obra-corpo {
  border-color: var(--cobre);
  background: var(--cobre);
  color: var(--noite);
}

.obra-origen input:checked + .obra-corpo {
  border-color: var(--aurora);
  background: var(--aurora);
  color: var(--noite);
}

.obra-ambos input:checked + .obra-corpo {
  border-color: var(--aurora);
  background: linear-gradient(100deg, var(--cobre), var(--aurora));
  color: var(--noite);
}

/* campos: claros sobre o verde, para ler e digitar sem esforço */
.par {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.campo { margin-bottom: 20px; }

.campo input,
.campo textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 13px 14px;
  border: 1.5px solid var(--traco);
  border-radius: 10px;
  background: var(--campo);
  color: var(--papel);
  caret-color: var(--aurora);
  font-size: 17px;
  transition: border-color .2s ease, background .2s ease;
}

.campo textarea { min-height: 96px; resize: vertical; line-height: 1.4; }

.campo input::placeholder,
.campo textarea::placeholder { color: rgba(236, 238, 230, .6); }

.campo input:focus,
.campo textarea:focus {
  border-color: var(--aurora);
  outline: 1px solid var(--aurora);
  outline-offset: 0;
  background: var(--campo-foco);
}

/* o preenchimento automático do navegador pintaria o campo de claro e o texto sumiria */
.campo input:-webkit-autofill,
.campo input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--papel);
  box-shadow: 0 0 0 100px #25352a inset;
  caret-color: var(--aurora);
}

/* objetivo, interesse e atendente */
.pilulas { display: flex; flex-wrap: wrap; gap: 10px; }

.pilula { position: relative; display: block; cursor: pointer; }

.pilula span {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 1.5px solid var(--traco);
  border-radius: 999px;
  background: var(--sombra);
  font-size: 16px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.pilula input:checked + span {
  border-color: var(--aurora);
  background: var(--aurora);
  color: var(--noite);
}

.pilula-marca span::before {
  content: '';
  flex: none;
  width: 16px;
  height: 16px;
  margin-right: 9px;
  border: 1.5px solid var(--nevoa-suave);
  border-radius: 5px;
}

.pilula-marca input:checked + span::before {
  border-color: var(--noite);
  background: var(--noite) no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23f0d59e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.4'/%3E%3C/svg%3E");
}

.responsavel {
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 2px solid var(--cobre);
}

.responsavel h4 { margin-bottom: 12px; font-size: 16px; font-weight: 600; }

.responsavel .campo:last-child { margin-bottom: 0; }

/* erros */
.erro { display: none; margin-top: 6px; font-size: 15px; color: var(--erro); }

.com-erro > .erro { display: block; }

.com-erro input:not([type="radio"]),
.com-erro textarea,
.com-erro .obra-corpo,
.com-erro .pilula span { border-color: var(--erro-borda); }

/* botão */
.botao {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  margin-top: 10px;
  padding: 14px 24px;
  border: 0;
  border-radius: 12px;
  background: var(--aurora);
  color: var(--noite);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}

.botao:active { transform: scale(.985); }

.botao:disabled { background: var(--nevoa-suave); cursor: progress; }

@media (hover: hover) {
  .botao:hover:not(:disabled) { background: var(--luz); }
  .pilula:hover input:not(:checked) + span,
  .obra:hover input:not(:checked) + .obra-corpo { border-color: var(--aurora); }
}

/* ── cadastro enviado ── */
.tela-enviado .painel {
  display: flex;
  align-items: center;
  max-width: 620px;
}

.enviado { width: 100%; }

.enviado-sinal {
  display: block;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  color: var(--aurora);
}

.enviado h1 { margin-bottom: 10px; }

.enviado strong { font-weight: 600; color: var(--papel); }

.enviado-tempo {
  display: block;
  height: 2px;
  margin: 30px 0 10px;
  background: linear-gradient(90deg, var(--cobre), var(--aurora));
  transform-origin: 0 50%;
  animation: enviado-tempo var(--tempo) linear both;
}

@keyframes enviado-tempo {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.enviado-volta { margin-bottom: 18px; font-size: 15px; color: var(--nevoa-suave); }

/* ── tablet em pé e celular: as torres ficam lado a lado numa faixa no topo ── */
@media (max-width: 900px), (orientation: portrait) {
  .pagina { display: block; }

  .vitrine {
    position: relative;
    flex-direction: row;
    gap: 2px;
    height: clamp(190px, 28vh, 320px);
  }

  .foto::after { height: 62%; }

  .foto figcaption { left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; }

  .foto svg { height: clamp(30px, 8.6vw, 52px); max-width: calc(100% - 16px); }

  .painel { padding: 22px 20px 36px; }
}

@media (max-width: 560px) {
  .par { grid-template-columns: minmax(0, 1fr); }

  .perfil span { padding: 13px 4px; font-size: 15px; }

  .obra-corpo { min-height: 100px; padding: 12px 4px; font-size: 14px; }

  .obra-emblemas svg { width: 38px; height: 38px; }
}

/* celular deitado: pouca altura, a faixa fica baixa */
@media (max-height: 520px) and (orientation: landscape) {
  .pagina { display: block; }

  .vitrine { position: relative; flex-direction: row; gap: 2px; height: 120px; }

  .foto figcaption { left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; }

  .foto svg { height: 36px; }

  .painel { padding: 20px 24px 32px; }
}

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

  .enviado-tempo { animation: none; }
}
