/*
 * Camada de movimento da landing da Cubos (carregada pela rota /piloto por cima do export).
 *
 * - html.fx-boot: posto por um script no <head> quando a pessoa não pediu menos movimento.
 *   Sem JS, ou com "reduzir movimento", nada aqui esconde conteúdo.
 * - A entrada usa as propriedades `translate`, `scale` e `opacity`, que não brigam com os
 *   `transform` que o export já escreve inline nos elementos.
 */

:root {
  --fx-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fx-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fx-green: #25d366;
  --fx-pink: #da56df;
  --fx-teal: #1de4cf;
  --fx-navy: #19194d;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  scroll-padding-top: 88px;
}

/* ---------- barra de progresso da leitura ---------- */

.fx-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 70;
  height: 3px;
  background: linear-gradient(90deg, var(--fx-green), var(--fx-teal), var(--fx-pink));
  transform: scaleX(var(--fx-p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* ---------- cabeçalho que encolhe ao rolar ---------- */

header {
  transition:
    box-shadow 0.35s ease,
    background-color 0.35s ease;
}

header nav {
  transition: padding 0.35s var(--fx-ease);
}

header.fx-scrolled {
  background: rgb(255 255 255 / 94%) !important;
  box-shadow: 0 10px 30px -18px rgb(25 25 77 / 45%);
}

header.fx-scrolled nav {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

header .cubos-pilot-logo {
  transition: width 0.35s var(--fx-ease);
}

header.fx-scrolled .cubos-pilot-logo {
  width: 108px;
}

/* links do menu: sublinhado que cresce do centro e marca a seção atual */
.fx-navlink {
  position: relative;
  transition: color 0.25s ease;
}

.fx-navlink::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--fx-green);
  transition:
    left 0.35s var(--fx-ease),
    right 0.35s var(--fx-ease);
}

.fx-navlink:hover,
.fx-navlink.fx-active {
  color: #3532d0 !important;
}

.fx-navlink:hover::after,
.fx-navlink.fx-active::after {
  left: 0;
  right: 0;
}

/* ---------- botões ---------- */

.fx-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    translate 0.35s var(--fx-pop),
    box-shadow 0.35s var(--fx-ease),
    background-color 0.3s ease,
    color 0.3s ease !important;
}

/* brilho que atravessa o botão */
.fx-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 38%) 50%, transparent 70%);
  translate: -120% 0;
  transition: translate 0.8s var(--fx-ease);
  pointer-events: none;
}

.fx-btn:hover,
.fx-btn:focus-visible {
  translate: 0 -3px;
  box-shadow: 0 14px 28px -14px var(--fx-shadow, rgb(25 25 77 / 55%));
}

.fx-btn:hover::after,
.fx-btn:focus-visible::after {
  translate: 120% 0;
}

.fx-btn:active {
  translate: 0 0;
  box-shadow: none;
}

.fx-btn i {
  transition:
    translate 0.35s var(--fx-pop),
    rotate 0.35s var(--fx-pop);
}

.fx-btn:hover i.fa-arrow-right,
.fx-btn:hover i.fa-arrow-right-long {
  translate: 4px 0;
}

.fx-btn:hover i.fa-whatsapp,
.fx-btn:hover i.fa-paper-plane {
  rotate: -12deg;
}

/* ---------- topo ---------- */

/* destaque "poucos dias": sublinhado que se desenha */
.fx-mark {
  background-image: linear-gradient(90deg, rgb(218 86 223 / 22%), rgb(37 211 102 / 22%));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 100% 0.28em;
  border-radius: 4px;
}

.fx-float {
  animation: fx-float 6s ease-in-out infinite;
  animation-delay: var(--fx-float-delay, 0s);
}

.fx-spin {
  animation: fx-spin 14s linear infinite;
}

.fx-blink {
  animation: fx-blink 2.4s ease-in-out infinite;
}

.fx-hero-photo {
  animation: fx-breathe 7s ease-in-out infinite;
}

/* ---------- cards ---------- */

.fx-lift {
  transition:
    translate 0.45s var(--fx-pop),
    box-shadow 0.45s var(--fx-ease) !important;
}

.fx-lift:hover {
  translate: 0 -8px;
  box-shadow: 0 28px 50px -30px rgb(25 25 77 / 55%) !important;
}

.fx-slide {
  transition:
    translate 0.35s var(--fx-pop),
    box-shadow 0.35s var(--fx-ease) !important;
}

.fx-slide:hover {
  translate: 6px 0;
  box-shadow: 0 16px 30px -22px rgb(25 25 77 / 45%) !important;
}

.fx-slide .fx-icon {
  transition:
    rotate 0.45s var(--fx-pop),
    scale 0.45s var(--fx-pop);
}

.fx-slide:hover .fx-icon {
  rotate: -10deg;
  scale: 1.12;
}

/* passos do "como funciona": a pessoa sobe e o cartão colorido inclina */
.fx-step img {
  transition:
    translate 0.5s var(--fx-pop),
    scale 0.5s var(--fx-pop);
}

.fx-step:hover img {
  translate: 0 -10px;
  scale: 1.04;
}

.fx-step h3 {
  transition: color 0.3s ease;
}

.fx-step:hover h3 {
  color: #3532d0 !important;
}

/* temas: a foto aproxima */
.fx-theme img {
  transition: scale 0.8s var(--fx-ease) !important;
}

.fx-theme:hover img {
  scale: 1.08;
}

/* plano em destaque: o selo pulsa */
.fx-badge-pulse {
  animation: fx-pulse 2.6s ease-in-out infinite;
}

/* perguntas frequentes */
.fx-faq {
  transition: background-color 0.3s ease;
}

.fx-faq button {
  transition: padding-left 0.35s var(--fx-ease);
}

.fx-faq:hover button {
  padding-left: 10px !important;
}

.fx-faq button i {
  transition: rotate 0.4s var(--fx-pop);
}

.fx-faq:hover button i {
  rotate: 90deg;
}

/* formulário: campo em foco ganha anel verde */
#contato input,
#contato textarea {
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

#contato input:focus,
#contato textarea:focus {
  outline: none;
  border-color: var(--fx-green) !important;
  box-shadow: 0 0 0 4px rgb(37 211 102 / 18%);
}

/* WhatsApp flutuante: onda que pulsa */
.fx-whats {
  transition: scale 0.35s var(--fx-pop) !important;
}

.fx-whats::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--fx-green);
  z-index: -1;
  animation: fx-ring 2.4s ease-out infinite;
}

.fx-whats:hover {
  scale: 1.1;
}

/* rodapé */
footer a {
  transition:
    color 0.25s ease,
    translate 0.25s var(--fx-ease);
}

footer a:hover {
  color: #fff !important;
  translate: 3px 0;
}

/* ---------- entrada ---------- */

/* topo: anima direto no primeiro desenho, sem esperar o JavaScript */
html.fx-boot #top > div > div:first-child > * {
  animation: fx-rise 0.9s var(--fx-ease) backwards;
}

html.fx-boot #top > div > div:first-child > :nth-child(2) {
  animation-delay: 0.08s;
}

html.fx-boot #top > div > div:first-child > :nth-child(3) {
  animation-delay: 0.18s;
}

html.fx-boot #top > div > div:first-child > :nth-child(4) {
  animation-delay: 0.28s;
}

html.fx-boot #top > div > div:last-child {
  animation: fx-pop 1s var(--fx-pop) 0.15s backwards;
}

html.fx-boot header {
  animation: fx-drop 0.7s var(--fx-ease) backwards;
}

/* o resto: marcado pelo fx.js e revelado ao entrar na tela */
html.fx-boot [data-fx]:not([data-fx-in]) {
  opacity: 0;
}

html.fx-boot [data-fx][data-fx-in] {
  animation: fx-rise 0.85s var(--fx-ease) backwards;
  animation-delay: calc(var(--fx-i, 0) * 90ms);
}

html.fx-boot [data-fx="left"][data-fx-in] {
  animation-name: fx-from-left;
}

html.fx-boot [data-fx="right"][data-fx-in] {
  animation-name: fx-from-right;
}

html.fx-boot [data-fx="pop"][data-fx-in] {
  animation: fx-pop 0.9s var(--fx-pop) backwards;
  animation-delay: calc(var(--fx-i, 0) * 110ms);
}

html.fx-boot [data-fx="clip"][data-fx-in] {
  animation: fx-clip 1.2s var(--fx-ease) backwards;
}

@keyframes fx-rise {
  from {
    opacity: 0;
    translate: 0 36px;
  }
}

@keyframes fx-from-left {
  from {
    opacity: 0;
    translate: -48px 0;
  }
}

@keyframes fx-from-right {
  from {
    opacity: 0;
    translate: 48px 0;
  }
}

@keyframes fx-pop {
  from {
    opacity: 0;
    scale: 0.88;
  }
}

@keyframes fx-clip {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes fx-drop {
  from {
    opacity: 0;
    translate: 0 -100%;
  }
}

@keyframes fx-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -10px;
  }
}

@keyframes fx-breathe {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.015;
  }
}

@keyframes fx-spin {
  to {
    rotate: 360deg;
  }
}

@keyframes fx-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes fx-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(37 211 102 / 55%);
  }
  60% {
    box-shadow: 0 0 0 10px rgb(37 211 102 / 0%);
  }
}

@keyframes fx-ring {
  from {
    opacity: 0.55;
    scale: 1;
  }
  to {
    opacity: 0;
    scale: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-float,
  .fx-spin,
  .fx-blink,
  .fx-hero-photo,
  .fx-badge-pulse,
  .fx-whats::before {
    animation: none !important;
  }

  .fx-btn,
  .fx-btn::after,
  .fx-lift,
  .fx-slide,
  .fx-step img,
  .fx-theme img {
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================================
 * Layout responsivo. O export só tinha layout de computador (grades e larguras fixas inline),
 * então aqui as grades são reorganizadas pela assinatura do estilo inline de cada uma.
 * ===================================================================== */

.fx-menu-btn {
  display: none;
}

@media (max-width: 1100px) {
  #como-funciona [style*="repeat(4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    row-gap: 48px !important;
  }

  #temas [style*="repeat(3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  /* menu vira um botão com painel */
  .fx-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgb(25 25 77 / 14%);
    border-radius: 4px;
    background: #fff;
    color: var(--fx-navy);
    font-size: 18px;
    cursor: pointer;
  }

  header nav > div {
    gap: 10px !important;
  }

  header ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0 !important;
    background: #fff;
    border-bottom: 1px solid rgb(25 25 77 / 8%);
    box-shadow: 0 24px 40px -24px rgb(25 25 77 / 40%);
    padding: 8px 20px 16px !important;
    opacity: 0;
    visibility: hidden;
    translate: 0 -8px;
    transition:
      opacity 0.25s ease,
      translate 0.3s var(--fx-ease),
      visibility 0.25s;
  }

  header.fx-menu-open ul {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
  }

  header ul li a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid rgb(25 25 77 / 6%);
  }

  header ul li:last-child a {
    border-bottom: 0;
  }

  .fx-navlink::after {
    display: none;
  }

  /* as grades de duas colunas viram uma */
  section [style*="1.05fr 1fr"],
  section [style*="grid-template-columns:1fr 1fr"],
  section [style*="grid-template-columns: 1fr 1fr"],
  section [style*="0.8fr 1.6fr"],
  section [style*="1fr 1.05fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 40px !important;
  }

  /* o formulário mantém nome e e-mail lado a lado até o celular */
  #contato form [style*="grid-template-columns:1fr 1fr"],
  #contato form [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  #top > div {
    min-height: 0 !important;
    padding-top: 32px !important;
  }

  #top > div > div:last-child {
    width: min(100%, 380px);
    justify-self: center;
    /* a foto sobe 78px por cima do próprio bloco: abre espaço para não cobrir os botões */
    margin-top: 84px;
  }

  #quem-somos > div > div {
    justify-self: stretch !important;
  }

  #quem-somos div:has(> .about-person) {
    width: min(430px, 100%) !important;
  }

  /* foto do contato numa coluna só: altura fixa, a foto preenche cortando */
  #contato > div > div:first-child {
    min-height: 0 !important;
    height: clamp(320px, 62vw, 460px);
  }

  #contato .form-photo {
    position: absolute;
    inset: 0;
    object-position: center 22%;
  }

  #planos [style*="repeat(3"] {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 460px;
    margin-left: auto !important;
    margin-right: auto !important;
    row-gap: 32px !important;
  }

  footer > div:first-child {
    flex-direction: column;
    gap: 36px !important;
  }
}

@media (max-width: 640px) {
  section > div,
  footer {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  #como-funciona [style*="repeat(4"],
  #temas [style*="repeat(3"],
  #contato form [style*="grid-template-columns:1fr 1fr"],
  #contato form [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #faq h2 {
    font-size: clamp(40px, 12vw, 64px) !important;
  }

  header nav {
    padding-left: 20px !important;
    padding-right: 20px !important;
    gap: 12px !important;
  }

  header nav > div > a {
    padding: 10px 14px !important;
    font-size: 13.5px !important;
  }

  header .cubos-pilot-logo {
    width: 104px;
  }

  #top h1 {
    font-size: clamp(32px, 9vw, 40px) !important;
  }

  #top > div > div:first-child > div:last-child {
    flex-wrap: wrap;
  }

  #top > div > div:first-child > div:last-child > a {
    flex: 1 1 auto;
    justify-content: center;
  }

  footer > div:first-child > div:last-child {
    gap: 32px !important;
  }
}
