/*
 * Animações progressivas para Aligner Class.
 * O conteúdo permanece visível sem JavaScript, sem IntersectionObserver e para
 * quem prefere movimento reduzido. Não depende de bibliotecas externas.
 */
.bfac-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 999;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #9c6c0c 0%, #f4d891 58%, #e0b04f 100%);
  box-shadow: 0 1px 14px rgba(224,176,79,.42);
}

/* Evita rolagem lateral momentânea durante a entrada dos elementos. */
body { overflow-x: clip; }

/* Botões: brilho dourado suave e resposta precisa ao hover. */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: transform .24s ease, filter .24s ease, box-shadow .28s ease;
}
.btn::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 22%, rgba(255,255,255,.38) 48%, transparent 72%);
  transform: translateX(-135%);
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
.btn.ghost::after { background: linear-gradient(115deg, transparent 24%, rgba(224,176,79,.12) 49%, transparent 76%); }
.btn:focus-visible { box-shadow: 0 0 0 4px rgba(224,176,79,.18),0 10px 30px rgba(224,176,79,.26); }

/* Efeitos atmosféricos limitados à primeira dobra, sem camada sobre o conteúdo. */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(75vw,750px);
  aspect-ratio: 1;
  right: -15%;
  top: -25%;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle,rgba(224,176,79,.13),rgba(193,134,4,.055) 38%,transparent 70%);
  filter: blur(22px);
}
.hero-visual .ph, .hero-visual .boxes { transition: transform .35s cubic-bezier(.22,1,.36,1); }

/* Mecanismo de entrada: classes adicionadas exclusivamente após inicialização do JS. */
.bfac-motion [data-bfac-reveal] {
  opacity: 0;
  transform: translate3d(0,28px,0);
  transition: opacity .78s cubic-bezier(.22,1,.36,1),transform .78s cubic-bezier(.22,1,.36,1);
  transition-delay: var(--bfac-reveal-delay, 0ms);
}
.bfac-motion [data-bfac-reveal="left"] { transform: translate3d(-22px,12px,0); }
.bfac-motion [data-bfac-reveal="right"] { transform: translate3d(22px,12px,0); }
.bfac-motion [data-bfac-reveal].is-visible { opacity: 1; transform: translate3d(0,0,0); }
.bfac-motion .kick[data-bfac-reveal]::before {
  transform: scaleX(.1);
  transform-origin: left;
  transition: transform .7s .12s cubic-bezier(.22,1,.36,1);
}
.bfac-motion .kick[data-bfac-reveal].is-visible::before { transform: scaleX(1); }

/* Composição inicial: sequência curta para texto, formulário e caixas de cursos. */
@media (prefers-reduced-motion: no-preference) {
  .bfac-motion .topbar { animation: bfac-hero-in .65s ease both; }
  .bfac-motion .hero-copy .eyebrow { animation: bfac-hero-in .62s .10s both; }
  .bfac-motion .hero-copy .rule { animation: bfac-rule-in .8s .20s both; transform-origin: left center; }
  .bfac-motion .hero-copy h1 { animation: bfac-hero-in .82s .25s both; }
  .bfac-motion .hero-copy .lead { animation: bfac-hero-in .78s .37s both; }
  .bfac-motion .hero-copy .facts { animation: bfac-hero-in .78s .46s both; }
  .bfac-motion .hero-copy .hero-form { animation: bfac-hero-in .82s .53s both; }
  .bfac-motion .hero-copy > .under { animation: bfac-hero-in .78s .62s both; }
  .bfac-motion .hero-visual { animation: bfac-visual-in 1.1s .28s both; }
  .bfac-motion .hero-visual .box:nth-child(1) { animation: bfac-box-in .85s .77s both; }
  .bfac-motion .hero-visual .box:nth-child(2) { animation: bfac-box-in .85s .88s both; }
  .bfac-motion .hero-visual .box:nth-child(3) { animation: bfac-box-in .85s .99s both; }
  .hero::before { animation: bfac-glow-breathe 8s ease-in-out infinite alternate; }
  .seal::before { animation: bfac-status-pulse 2.4s ease-in-out infinite; }
}
@keyframes bfac-hero-in {
  from { opacity: 0; transform: translate3d(0,19px,0); }
  to { opacity: 1; transform: translate3d(0,0,0); }
}
@keyframes bfac-visual-in {
  from { opacity: 0; transform: translate3d(30px,17px,0) scale(.97); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}
@keyframes bfac-box-in {
  from { opacity: 0; transform: translate3d(0,35px,0) scale(.92); }
  to { opacity: 1; transform: translate3d(0,0,0) scale(1); }
}
@keyframes bfac-rule-in {
  from { opacity: .3; transform: scaleX(.1); }
  to { opacity: 1; transform: scaleX(1); }
}
@keyframes bfac-glow-breathe {
  from { opacity: .45; transform: translate3d(-15px,-10px,0) scale(.92); }
  to { opacity: 1; transform: translate3d(14px,9px,0) scale(1.06); }
}
@keyframes bfac-status-pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(229,72,77,.2); }
  50% { box-shadow: 0 0 0 6px rgba(229,72,77,.045); }
}

/* Detalhes funcionais: campos, cards, marcadores e perguntas frequentes. */
.hero-form input,.form input {
  transition: border-color .24s ease,box-shadow .24s ease,background-color .24s ease;
}
.hero-form input:focus,.form input:focus {
  outline: none;
  border-color: var(--gold-2);
  background-color: #15151a;
  box-shadow: 0 0 0 3px rgba(224,176,79,.12);
}
.faq details { transition: background-color .3s ease,padding .3s ease; border-radius: 8px; }
.faq details[open] { background: rgba(224,176,79,.035); }
.faq details[open] summary { color: var(--gold-3); }
.faq details[open] > p { animation: bfac-faq-answer .28s ease both; }
@keyframes bfac-faq-answer {
  from { opacity: .15; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .btn:hover::after,.btn:focus-visible::after { transform: translateX(135%); }
  .btn:not(.ghost):hover { box-shadow: 0 14px 40px rgba(224,176,79,.34),inset 0 1px 0 rgba(255,255,255,.5); }
  .card,.course,.num,.pains li,.photo { transition: translate .38s cubic-bezier(.22,1,.36,1), border-color .3s,box-shadow .38s,background-color .3s; }
  .card:hover,.course:hover,.num:hover,.pains li:hover { translate: 0 -5px; border-color: rgba(224,176,79,.4); box-shadow: 0 18px 38px rgba(0,0,0,.28),0 0 22px rgba(224,176,79,.045); }
  .photo:hover { translate: 0 -4px; border-color: rgba(224,176,79,.48); }
  .photo img { transition: transform .7s cubic-bezier(.22,1,.36,1); }
  .photo:hover img { transform: scale(1.035); }
  .hero-visual .ph { transform: translate3d(var(--bfac-depth-x,0px),var(--bfac-depth-y,0px),0); }
  .hero-visual .boxes { transform: translate3d(var(--bfac-box-x,0px),var(--bfac-box-y,0px),0); }
}

/* Em telas estreitas, entradas sempre verticais para não criar rolagem lateral. */
@media (max-width: 640px) {
  .bfac-motion [data-bfac-reveal="left"],
  .bfac-motion [data-bfac-reveal="right"] { transform: translate3d(0,28px,0); }
  .bfac-motion [data-bfac-reveal].is-visible { transform: translate3d(0,0,0); }
}

@media (prefers-reduced-motion: reduce) {
  .bfac-motion [data-bfac-reveal],.bfac-motion [data-bfac-reveal].is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .bfac-motion .hero-copy > *, .bfac-motion .hero-visual, .bfac-motion .topbar,
  .bfac-motion .hero-visual .box,.hero::before,.seal::before,.faq details[open] > p {
    animation: none !important;
  }
  .hero-visual .ph,.hero-visual .boxes,.btn::after,.photo img { transform: none !important;transition: none !important; }
  .bfac-motion .kick[data-bfac-reveal]::before { transform: none !important;transition: none !important; }
}
