/* ==========================================================================
   ANCEST PRO — Pedido de proposta
   Folha de estilo unica. Tokens derivados da identidade do site principal.
   ========================================================================== */

/* --- Fontes auto-hospedadas (sem dependencia do CDN da Google, RGPD) ----- */
@font-face {
  font-family: 'Julius Sans One';
  src: url('../fonts/julius-sans-one.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Raleway';
  src: url('../fonts/raleway-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------------- */
:root {
  --ink: #0C0C0C;
  --ink-2: #3F2828;
  --ink-3: #6E6259;
  --paper: #FFFDF9;
  --paper-2: #F5F0E6;
  --line: #E4DCCD;
  --line-2: #D3C6AF;
  --gold: #A8792A;
  --gold-2: #E3C271;
  --gold-wash: #F7ECD4;
  --navy: #1C2B45;
  --err: #8A2B2B;
  --ok: #2F6B4F;

  --display: 'Julius Sans One', 'Optima', sans-serif;
  --body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --shadow-1: 0 1px 2px rgba(12, 12, 12, .04), 0 8px 24px rgba(12, 12, 12, .05);
  --shadow-2: 0 2px 6px rgba(12, 12, 12, .06), 0 18px 48px rgba(12, 12, 12, .10);

  --rail-w: 400px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

[hidden] { display: none !important; }
.u-hidden { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
.u-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
}
.skip:focus { left: 12px; top: 12px; }

/* --- Cabecalho ---------------------------------------------------------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hdr__brand { display: inline-flex; align-items: center; }
.hdr__brand img { width: 158px; height: auto; }
.hdr__aside { display: flex; align-items: center; gap: 20px; }
.hdr__note {
  font-size: 12.5px; letter-spacing: .04em; color: var(--ink-3);
  text-transform: uppercase; font-weight: 500;
}
.hdr__phone {
  font-family: var(--display); letter-spacing: .09em; font-size: 14px;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 9px 18px; transition: background .2s var(--ease), color .2s var(--ease);
}
.hdr__phone:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --- Estrutura ---------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: calc(100vh - 68px);
  align-items: stretch;
}

/* --- Coluna de autoridade ----------------------------------------------- */
.rail {
  position: relative;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.rail__inner {
  position: sticky; top: 0;
  display: flex; flex-direction: column; gap: clamp(14px, 2.2vh, 26px);
  padding: clamp(92px, 11vh, 116px) 38px clamp(28px, 4vh, 42px);
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
}
.rail__photo { position: absolute; inset: 0; z-index: -2; }
.rail__photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 16%;
  opacity: .52;
}
.rail__inner::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 12, 12, .50) 0%, rgba(12, 12, 12, .78) 44%, rgba(12, 12, 12, .96) 100%),
    radial-gradient(120% 60% at 0% 0%, rgba(227, 194, 113, .20) 0%, transparent 60%);
}
.rail__eyebrow {
  font-family: var(--display); font-size: 12px; letter-spacing: .30em;
  text-transform: uppercase; color: var(--gold-2);
}
.rail__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(22px, 2.6vh, 31px); line-height: 1.24; letter-spacing: .02em;
  margin: 0; color: #fff;
}
.rail__lede { margin: 0; font-weight: 300; font-size: clamp(14px, 1.7vh, 15.5px); color: rgba(255, 253, 249, .78); }

.rail__score {
  display: flex; align-items: center; gap: 14px;
  padding: clamp(10px, 1.6vh, 16px) 0; border-top: 1px solid rgba(255, 253, 249, .16);
  border-bottom: 1px solid rgba(255, 253, 249, .16);
}
.rail__scoreNum {
  font-family: var(--display); font-size: clamp(27px, 3.4vh, 34px); line-height: 1; color: #fff;
}
.rail__stars { color: var(--gold-2); font-size: 14px; letter-spacing: .16em; }
.rail__scoreMeta { font-size: 12.5px; font-weight: 300; color: rgba(255, 253, 249, .68); }

.rail__quote { margin: 0; }
.rail__quote p {
  margin: 0 0 10px; font-weight: 300; font-style: italic;
  font-size: clamp(13.5px, 1.7vh, 15.5px); line-height: 1.6; color: rgba(255, 253, 249, .90);
}
.rail__quote footer {
  font-family: var(--display); font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-2);
}

.rail__inner > *:not(.rail__spacer):not(.rail__photo) { flex: 0 0 auto; }
.rail__spacer { flex: 1 1 auto; min-height: 0; }
.rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(7px, 1.1vh, 11px); }
.rail__list li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: clamp(13px, 1.6vh, 14px); font-weight: 300; color: rgba(255, 253, 249, .84);
}
.rail__list svg { flex: 0 0 auto; margin-top: 3px; color: var(--gold-2); }

/* --- Coluna do fluxo ---------------------------------------------------- */
.flow {
  display: flex; flex-direction: column;
  padding: clamp(26px, 3.4vw, 54px) clamp(18px, 4.4vw, 68px) 40px;
  max-width: 820px; width: 100%;
}

/* Assinatura: o simbolo da marca funciona como mostrador de progresso */
.flow__head { display: flex; align-items: center; gap: 18px; margin-bottom: clamp(22px, 3vw, 38px); }
.dial { flex: 0 0 auto; width: 58px; height: 58px; }
.dial__track { fill: none; stroke: var(--line); stroke-width: 3; }
.dial__arc {
  fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset .55s var(--ease);
}
.dial__ring { fill: none; stroke: var(--ink); stroke-width: 2.4; opacity: .18; transition: opacity .4s var(--ease); }
.dial__ring.is-on { opacity: 1; stroke: var(--ink); }
.dial__core { fill: var(--ink); opacity: .18; transition: opacity .4s var(--ease); }
.dial__core.is-on { opacity: 1; }

.flow__count {
  font-family: var(--display); font-size: 12.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px;
}
.flow__count b { color: var(--ink); font-weight: 400; }
.flow__bar { height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; max-width: 320px; }
.flow__bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-2) 100%);
  transition: width .55s var(--ease);
}
.flow__headText { flex: 1 1 auto; min-width: 0; }

/* --- Passos ------------------------------------------------------------- */
.step { animation: stepIn .42s var(--ease) both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.step__kicker {
  font-family: var(--display); font-size: 11.5px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 12px;
}
.step__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(25px, 3.1vw, 38px); line-height: 1.22; letter-spacing: .015em;
  color: var(--ink); margin: 0 0 10px;
}
.step__hint {
  margin: 0 0 clamp(20px, 2.6vw, 30px);
  font-weight: 300; font-size: 16px; color: var(--ink-3); max-width: 56ch;
}

/* Cartoes de escolha */
.opts { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts--single { grid-template-columns: minmax(0, 1fr); }

.opt {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 18px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.opt:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.opt.is-on { border-color: var(--ink); background: var(--paper-2); box-shadow: var(--shadow-1); }
.opt__mark {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-2); position: relative;
  transition: border-color .2s var(--ease);
}
.opt.is-on .opt__mark { border-color: var(--ink); }
.opt.is-on .opt__mark::after {
  content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--gold);
}
.opt__body { min-width: 0; }
.opt__label { display: block; font-weight: 500; font-size: 15.5px; color: var(--ink); line-height: 1.35; }
.opt__sub { display: block; margin-top: 3px; font-weight: 300; font-size: 13px; color: var(--ink-3); }

/* Campos de texto */
.fields { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields--single { grid-template-columns: minmax(0, 1fr); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-family: var(--display); font-size: 11.5px; letter-spacing: .17em;
  text-transform: uppercase; color: var(--ink-3);
}
.field__label span { color: var(--gold); }
.field__input, .field__area {
  width: 100%; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-weight: 400; font-size: 16px; color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field__area { resize: vertical; min-height: 104px; line-height: 1.55; }
.field__input:focus, .field__area:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold-wash);
}
.field__input::placeholder, .field__area::placeholder { color: #B3A99C; }
.field__help { font-size: 12.5px; font-weight: 300; color: var(--ink-3); }
.field.has-error .field__input, .field.has-error .field__area { border-color: var(--err); }
.field__err { font-size: 12.5px; color: var(--err); font-weight: 500; }

/* Fotografias */
.photos {
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
  background: #fff; padding: 30px 24px; text-align: center;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.photos.is-over { border-color: var(--gold); background: var(--gold-wash); }
.photos__icon { color: var(--line-2); margin: 0 auto 12px; }
.photos__title { font-family: var(--display); font-size: 16px; letter-spacing: .06em; color: var(--ink); margin: 0 0 6px; }
.photos__hint { margin: 0 0 18px; font-size: 13.5px; font-weight: 300; color: var(--ink-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 18px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--paper-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__x {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  border-radius: 50%; background: rgba(12, 12, 12, .78); color: #fff;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
}
.thumb__x:hover { background: var(--err); }

/* Resumo */
.recap {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2); padding: 20px 22px; margin: 0 0 24px;
}
.recap dl { margin: 0; display: grid; gap: 9px; }
.recap div { display: flex; gap: 14px; justify-content: space-between; align-items: baseline; }
.recap dt {
  font-family: var(--display); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3); flex: 0 0 auto;
}
.recap dd { margin: 0; font-size: 14.5px; font-weight: 500; color: var(--ink); text-align: right; }

/* --- Botoes ------------------------------------------------------------- */
.flow__nav {
  display: flex; align-items: center; gap: 14px;
  margin-top: clamp(24px, 3vw, 36px); padding-top: 22px;
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px; border-radius: 999px;
  font-family: var(--display); font-size: 14px; letter-spacing: .13em; text-transform: uppercase;
  text-decoration: none;
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease), transform .18s var(--ease), opacity .2s var(--ease);
}
.btn--primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn--primary:hover { background: var(--gold); border-color: var(--gold); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn--wa { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.btn--wa:hover { background: #24375A; transform: translateY(-1px); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn__spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.flow__nav .btn--primary { margin-left: auto; }

.flow__legal {
  margin: 20px 0 0; font-size: 12.5px; font-weight: 300; color: var(--ink-3); max-width: 62ch;
}
.flow__legal a { color: var(--ink-2); }

/* --- Alerta ------------------------------------------------------------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: #FBEFEF; border: 1px solid #E7CACA; color: var(--err);
  font-size: 14px; margin-bottom: 20px;
}

/* --- Ecra final --------------------------------------------------------- */
.done { text-align: left; animation: stepIn .5s var(--ease) both; }
.done__seal {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 24px;
  background: var(--gold-wash); color: var(--gold);
}
.done__ref {
  display: inline-block; margin-bottom: 22px; padding: 7px 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-family: var(--display); font-size: 12.5px; letter-spacing: .16em; color: var(--ink);
}
.done__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* --- Botao fixo de ligacao ---------------------------------------------- */
.callfab {
  position: fixed;
  right: clamp(14px, 3vw, 30px);
  bottom: calc(var(--callfab-gap, 24px) + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex; align-items: center; gap: 11px;
  padding: 9px 22px 9px 10px;
  border-radius: 999px;
  background: var(--gold); color: #fff; text-decoration: none;
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-2);
  transition: background .22s var(--ease), border-color .22s var(--ease),
              transform .18s var(--ease);
}
.callfab:hover { background: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.callfab:active { transform: translateY(0); }

.callfab__icon {
  position: relative; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .17);
}
.callfab__icon svg { width: 19px; height: 19px; }
.callfab__icon::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  animation: callfab-pulso 2.6s var(--ease) infinite;
}
@keyframes callfab-pulso {
  0%   { transform: scale(.8);  opacity: .85; }
  70%  { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

.callfab__text { display: flex; flex-direction: column; line-height: 1.2; }
.callfab__text b {
  font-family: var(--display); font-weight: 400; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase;
}
.callfab__text small { font-size: 11.5px; font-weight: 300; letter-spacing: .04em; opacity: .88; }

/* --- Faixa de confianca (mobile) ---------------------------------------- */
.trust { display: none; }

/* --- Responsivo --------------------------------------------------------- */
@media (max-height: 860px) {
  .rail__lede { display: none; }
}
@media (max-height: 740px) {
  .rail__quote { display: none; }
}
@media (max-height: 600px) {
  .rail__score { display: none; }
}

@media (max-width: 1080px) {
  :root { --rail-w: 330px; }
  .rail__inner { padding: 100px 26px 34px; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .flow { max-width: none; padding: 26px 20px 96px; }
  .hdr__note { display: none; }
  .trust {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    gap: 9px; padding: 12px 20px; margin: 0;
    background: var(--ink); color: rgba(255, 253, 249, .78);
    font-size: 12.5px; font-weight: 300; line-height: 1.45;
  }
  .trust b { font-family: var(--display); color: #fff; font-size: 16px; font-weight: 400; }
  .trust .trust__stars { color: var(--gold-2); letter-spacing: .1em; font-size: 11px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .opts--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .flow__nav { position: sticky; bottom: 0; background: var(--paper); padding-bottom: 14px; }
  .btn { padding: 14px 22px; font-size: 13px; }
}

@media (max-width: 420px) {
  .hdr__brand img { width: 128px; }
  .hdr__phone { padding: 8px 14px; font-size: 12.5px; }
  .callfab { padding: 7px 18px 7px 8px; gap: 9px; }
  .callfab__icon { width: 32px; height: 32px; }
  .callfab__icon svg { width: 17px; height: 17px; }
  .callfab__text small { display: none; }
  .opts--wide { grid-template-columns: minmax(0, 1fr); }
  .recap div { flex-direction: column; gap: 2px; }
  .recap dd { text-align: left; }
}

@media print {
  .callfab { display: none !important; }
}

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