/* ================= FONTES ================= */
@font-face { font-family: 'Gavona Elegant'; src: url("fontes/GavonaElegantDemo-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Editorium Serif'; src: url("fontes/Editoriumserif-Semibolditalic-Exfont2b86.otf") format("opentype"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'Avenir Next'; src: url("fontes/Avenir-Next-Font/Avenir-Next/WOFF2/Avenir Next Light.woff2") format("woff2");   font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next'; src: url("fontes/Avenir-Next-Font/Avenir-Next/WOFF2/Avenir Next Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next'; src: url("fontes/Avenir-Next-Font/Avenir-Next/WOFF2/Avenir Next Medium.woff2") format("woff2");  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next'; src: url("fontes/Avenir-Next-Font/Avenir-Next/WOFF2/Avenir Next Demi.woff2") format("woff2");    font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Avenir Next'; src: url("fontes/Avenir-Next-Font/Avenir-Next/WOFF2/Avenir Next Bold.woff2") format("woff2");    font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --verde: #1d3a31;
  --verde-claro: #2a5245;
  --creme: #f6eedc;
  --dourado: #d9b77a;
  --escuro: rgba(28, 22, 16, .82);
  --branco: #ffffff;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --titulo: 'Gavona Elegant', 'Cormorant Garamond', Georgia, serif;
  --titulo-span: 'Editorium Serif', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Avenir Next', 'Avenir', Arial, sans-serif;
  /* 1px do Figma (frame 1920×1080) proporcional à tela (de 1024 até 4K): usa a menor escala entre largura e altura,
     para o bloco inteiro (até os botões) caber em telas baixas como notebooks */
  --px: max(.5px, min(calc(clamp(1024px, 100vw, 3840px) / 1920), calc((100vh - 44px) / 1000)));
  /* Telas altas (tablets em pé, monitores verticais): sobra altura além do frame; centraliza o frame na vertical */
  --oy: max(0px, calc((100vh - 44px - 1000 * var(--px)) / 2));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--branco);
  background: var(--verde);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================= HERO ================= */
.hero {
  position: relative;
  flex: 1;
  min-height: calc(100vh - 44px);
  background: #6b5a43;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
/* Imagem de fundo em camada própria (mais alta que a tela) para poder subir junto com o formulário */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 115%;
  z-index: -1;
  /* Enquadramento do Figma: na escala do frame, a foto inteira mede 3098×2445 e o frame começa
     em x 723 / y 712 dela. A foto é ancorada à direita e no topo, como o texto, e escala junto
     com ele (--px), então a distância entre a família e o texto é a mesma em qualquer monitor. */
  background-color: #6b5a43;
  background-image: url("../img/fundo-3200.jpg"), url("../img/fundo-3200.jpg");
  background-repeat: no-repeat;
  /* 2ª camada (cover) só aparece se a 1ª não alcançar alguma borda */
  background-size: calc(3098 * var(--px)) auto, cover;
  background-position: right calc(-455 * var(--px)) top calc(-712 * var(--px) + var(--oy)), center;
  transition: transform .6s ease;
  pointer-events: none;
}
body.form-aberto .hero::after { transform: translateY(-13%); }
/* Em pé, a foto já ocupa toda a altura: não sobe ao abrir o formulário (evita faixa vazia embaixo) */
@media (orientation: portrait) {
  body.form-aberto .hero::after { transform: none; }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
}

.logo {
  position: relative;
  margin-top: calc(78 * var(--px) + var(--oy));
  width: calc(339 * var(--px));
  height: calc(199 * var(--px));
  opacity: 1;
  z-index: 1;
}
.logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Medidas do Figma (frame 1920×1080): título começa em left 1017 / top 370; o grupo termina a 380px da borda direita */
.conteudo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  padding: 0 calc(380 * var(--px)) 0 0;
  margin-top: calc((370 - 78 - 199) * var(--px));
  margin-bottom: auto;
  display: flex;
  justify-content: flex-end;
}
/* Com o formulário aberto (sem logo), o bloco desce e fica logo acima do painel */
body.form-aberto .conteudo { margin-top: auto; }

.bloco-texto {
  width: calc(523 * var(--px));
  text-align: center;
}
/* Título e selo compartilham a mesma margem esquerda; o conjunto fica centralizado */
.marca {
  display: inline-block;
  text-align: left;
}
.titulo {
  font-family: var(--titulo);
  font-weight: 400;
  font-style: normal;
  font-size: calc(80 * var(--px));
  line-height: 100%;
  letter-spacing: .2em;
  color: var(--creme);
  text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
/* "por natureza.": top 458 (88px abaixo do título), left 1162.69 (145.69px de recuo) */
.titulo span {
  display: block;
  margin-top: calc(8 * var(--px));
  font-family: var(--titulo-span);
  font-weight: 600;
  font-style: italic;
  font-size: calc(50 * var(--px));
  line-height: 100%;
  letter-spacing: .1em;
  padding-left: calc(145.69 * var(--px));
}
/* top 595 */
.sub-titulo {
  margin-top: calc(87 * var(--px));
  font-family: var(--sans);
  font-weight: 500;
  font-style: normal;
  font-size: calc(20 * var(--px));
  line-height: calc(30 * var(--px));
  letter-spacing: .17em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--branco);
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
/* top 635, 523×48, padding 15 40 13 40 */
.selo {
  display: block;
  width: calc(523 * var(--px));
  margin-top: calc(10 * var(--px));
  background: var(--verde);
  color: var(--creme);
  font-family: var(--sans);
  font-weight: 700;
  font-style: normal;
  font-size: calc(16 * var(--px));
  line-height: calc(20 * var(--px));
  letter-spacing: .32em;
  text-align: center;
  vertical-align: middle;
  text-transform: uppercase;
  white-space: nowrap;
  /* direita menor compensa o espaçamento extra após a última letra, mantendo o texto centralizado */
  padding: calc(15 * var(--px)) calc(40 * var(--px) - .32em) calc(13 * var(--px)) calc(40 * var(--px));
}
/* top 748, left 1017, 449×90 (3 linhas de 30) */
.descricao {
  width: calc(449 * var(--px));
  margin-top: calc(65 * var(--px));
  font-family: var(--sans);
  font-weight: 600;
  font-style: normal;
  font-size: calc(20 * var(--px));
  line-height: calc(30 * var(--px));
  letter-spacing: .15em;
  text-align: left;
  color: var(--branco);
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
/* botões: top 855, left 1017 e 1244 (5px entre eles), altura 50 */
.acoes {
  display: flex;
  gap: calc(5 * var(--px));
  margin-top: calc(17 * var(--px));
}
.acoes .btn {
  height: max(34px, calc(50 * var(--px)));
  /* largura do Figma como mínima; se a tela for pequena, o botão cresce para o texto caber */
  padding: 0 max(12px, calc(30 * var(--px)));
  line-height: calc(15 * var(--px));
  font-size: max(10px, calc(11 * var(--px)));
  white-space: nowrap;
}
.acoes .btn-branco { min-width: calc(222 * var(--px)); }
.acoes .btn-verde  { min-width: calc(128 * var(--px)); }

.btn {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  padding: 12px 20px;
  transition: transform .2s, background .2s, color .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-branco { background: var(--branco); color: var(--verde); }
.btn-branco:hover { background: var(--creme); }
.btn-verde { background: var(--verde); color: var(--creme); }
.btn-verde:hover { background: var(--verde-claro); }

/* ================= PAINEL / FORMULÁRIO ================= */
/* Desktop: faixa larga centralizada abaixo do título, botão "vazando" na borda inferior */
.painel {
  position: relative;
  z-index: 2;
  width: calc(100% - 2 * clamp(32px, 16.5vw, 280px));
  min-width: 640px;
  max-width: 1100px;
  margin: 0 auto calc(6vh + 22px);
  background: var(--escuro);
  backdrop-filter: blur(4px);
  padding: 30px 48px 46px;
  text-align: center;
  display: none;
  animation: subir .45s ease;
}
@keyframes subir {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fechar {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: 0;
  color: var(--branco);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: block;
}

.painel h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--creme);
}
#tituloForm {
  font-family: var(--titulo);
  font-weight: 400;
  font-style: normal;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: .1em;
  text-align: center;
}
.painel p.sub {
  margin-top: 6px;
  font-family: var(--sans);
  font-weight: 500;
  font-style: normal;
  font-size: 14px;
  line-height: 24px;
  letter-spacing: 0;
  text-align: center;
  color: rgba(255,255,255,.8);
}

.campos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}
.campos input {
  width: 100%;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--branco);
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.campos input::placeholder {
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .06em;
}
.campos input:focus { border-color: var(--dourado); background: rgba(255,255,255,.06); }
.campos input.erro { border-color: #e57373; }

.lgpd {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 11px;
  color: rgba(255,255,255,.7);
  text-align: left;
}
.lgpd input { margin-top: 2px; accent-color: var(--dourado); }

.msg-erro {
  margin-top: 8px;
  font-size: 12px;
  color: #ffb4a8;
  min-height: 16px;
}

/* Botão de envio centralizado sobre a borda inferior do painel */
.painel .btn-branco {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  padding: 13px 24px;
  font-size: 10px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.painel .btn-branco:hover { transform: translate(-50%, calc(50% - 1px)); }
.painel .btn-branco:disabled { opacity: .6; cursor: wait; transform: translate(-50%, 50%); }

/* honeypot anti-spam */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.sucesso { display: none; padding: 16px 0 0; }
.sucesso h2 { font-size: 30px; }

/* Estados */
body.form-aberto .logo,
body.form-aberto .bloco-texto .descricao,
body.form-aberto .bloco-texto .acoes { display: none; }
body.form-aberto .conteudo { margin-bottom: 26px; }
body.form-aberto .painel { display: block; }
body.enviado .formulario { display: none; }
body.enviado .sucesso { display: block; }

/* ================= RODAPÉ ================= */
.rodape {
  height: 44px;
  background: var(--verde);
  color: var(--creme);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.quebra-mobile { display: none; }

/* Resolução da foto conforme a tela: notebooks comuns usam a versão leve; 2K/4K e telas retina, a versão grande */
@media (max-width: 1400px) and (max-resolution: 1dppx) {
  .hero::after { background-image: url("../img/fundo-2000.jpg"), url("../img/fundo-2000.jpg"); }
}
@media (min-width: 2000px), (min-width: 1280px) and (min-resolution: 1.5dppx) {
  .hero::after { background-image: url("../img/fundo-4k.jpg"), url("../img/fundo-4k.jpg"); }
}

/* Monitores ultrawide (21:9): a foto ancorada não cobre a lateral esquerda; preenche a tela */
@media (min-aspect-ratio: 5/2) {
  .hero::after { background-size: cover; background-position: 40% 45%; }
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  /* foto recortada na vertical para celular, com a família centralizada */
  .hero::after {
    height: 100%;
    background-image: url("../img/fundo-mobile.jpg");
    background-size: cover;
    background-position: center top;
  }
  body.form-aberto .hero::after { transform: none; }
  .hero {
    min-height: calc(100vh - 84px);
    min-height: calc(100svh - 84px);
  }
  .hero::before {
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,.7) 100%);
  }
  .logo { width: 130px; height: auto; margin-top: 28px; }

  /* Título no topo (abaixo do logo) e o restante do texto na base da imagem */
  .conteudo {
    flex: 1;
    margin-top: 0;
    margin-bottom: 26px;
    padding: 0 20px;
    justify-content: center;
  }
  .bloco-texto {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .marca { display: contents; }
  .titulo {
    margin-top: 26px;
    text-align: left;
    font-size: 44px;
    color: #5b4433;
    text-shadow: none;
  }
  .titulo span { font-size: 28px; padding-left: 64px; }
  .sub-titulo {
    margin-top: auto;
    padding-top: 24px;
    font-size: 11px;
    line-height: 20px;
  }
  .selo {
    margin-top: 8px;
    font-size: 11px;
    display: inline-block;
    width: auto;
    line-height: 20px;
    padding: 8px calc(16px - .32em) 8px 16px;
  }
  .descricao {
    width: auto;
    margin-top: 22px;
    font-size: 13px;
    line-height: 20px;
    letter-spacing: .08em;
    text-align: center;
  }
  .acoes { width: 100%; gap: 10px; margin-top: 16px; }
  .acoes .btn { width: auto; min-width: 0; height: auto; padding: 12px 10px; font-size: 11px; line-height: normal; }
  .acoes .btn-branco { flex: 1.8; }
  .acoes .btn-verde { flex: 1; }

  /* No mobile o formulário vira um modal em tela cheia */
  .painel {
    position: fixed;
    inset: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 70px 24px 32px;
    background: rgba(24, 19, 14, .96);
    display: none;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    z-index: 100;
  }
  body.form-aberto .painel { display: flex; }
  body.form-aberto { overflow: hidden; }
  .fechar { display: block; }

  .painel h2 { font-size: 24px; }
  .campos { grid-template-columns: 1fr; gap: 12px; }
  .painel .btn-branco,
  .painel .btn-branco:hover,
  .painel .btn-branco:disabled { position: static; transform: none; width: 100%; margin-top: 14px; }
  .rodape { height: 84px; font-size: 10px; line-height: 1.8; letter-spacing: .2em; }
  .quebra-mobile { display: inline; }
}