/* ==========================================================================
   VetWeb — seção "Como funciona no dia" (fluxo do app animado)
   --------------------------------------------------------------------------
   Arquivo PRÓPRIO da seção, carregado só pela landing que usa o bloco: o
   `vetweb-lp.css` é compartilhado por várias páginas e não muda por causa dele.

   Como funciona:
   - Cada passo tem a sua tela (`[data-vwf-screen="N"]`): o PRINT REAL do app e,
     por cima, uma camada (`.vwf-ov`) com o mesmo formato da imagem
     (1080 × 2424). Tudo dentro da camada é posicionado em % da imagem e
     dimensionado em `cqw` (largura do contêiner), então o toque e o destaque
     ficam no lugar certo em qualquer tamanho de celular.
   - A mudança de estado é real: o passo mostra o print de antes e, depois do
     toque, o print de depois (`.vwf-next`) aparece por cima.
   - A linha do tempo (`.vwf-timer`) enche em `--vwf-dur`; o fim dela
     (`animationend`) é o que avança o passo no JS. Pausar a seção é só
     `animation-play-state: paused` — linha, toques e telas param juntos.
   - Só `transform` e `opacity` são animados (nada de layout).
   ========================================================================== */

.vwf {
  --vwf-dur: 5.5s;
}

.vwf-grid {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

/* Mobile: celular, linha do tempo, passos e texto juntos, nessa ordem, para
   caberem numa tela só (o título da seção vem antes). As colunas do desktop
   se desfazem com `display: contents` e a ordem vem do `order`. */
@media (max-width: 899px) {
  .vwf-grid {
    gap: 0;
  }

  .vwf-copy,
  .vwf-stage {
    display: contents;
  }

  .vwf-copy .vw-section-head {
    order: 0;
    margin-bottom: 1.25rem;
  }

  .vwf-device {
    order: 1;
  }

  .vwf-timer {
    order: 2;
  }

  .vwf-steps {
    order: 3;
    margin-top: 0.75rem;
  }

  .vwf-caption {
    order: 4;
  }
}

/* --------------------------------------------------------------------------
   Lista de passos (abas)
   No mobile: 5 rótulos curtos lado a lado e o texto do passo ativo abaixo.
   No desktop: lista vertical, com o texto do passo ativo abrindo no item.
   -------------------------------------------------------------------------- */
.vwf-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.vwf-step {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  cursor: pointer;
  padding: 0.375rem 0.125rem;
  border-radius: var(--vw-r-sm);
  -webkit-tap-highlight-color: transparent;
}

.vwf-step:focus-visible {
  outline: 2px solid var(--vw-sky);
  outline-offset: 2px;
}

/* Barras dos passos: só no desktop (no mobile quem mostra o tempo é a
   linha embaixo do celular — duas barras empilhadas confundem). */
.vwf-track {
  display: none;
}

.vwf-step-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vwf-num {
  display: none;
}

.vwf-label {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: #526077;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.vwf-label::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  margin: 0.3rem auto 0;
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.2s ease;
}

.vwf-step.is-active .vwf-label {
  color: var(--vw-ink);
}

.vwf-step.is-active .vwf-label::after {
  background: var(--vw-solar);
}

.vwf-title,
.vwf-desc {
  display: none;
}

/* Texto do passo ativo, abaixo do celular (só mobile) */
.vwf-caption {
  min-height: 7.5rem;
  margin-top: 0.75rem;
  text-align: center;
}

.vwf-caption-title {
  font-family: var(--vw-font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 26px;
  color: var(--vw-ink);
}

.vwf-caption-desc {
  margin-top: 0.375rem;
  font-size: 15px;
  line-height: 23px;
  color: var(--vw-ink-2);
}

.vwf-caption.is-swap {
  animation: vwf-rise 0.35s ease-out both;
}

/* --------------------------------------------------------------------------
   Celular
   -------------------------------------------------------------------------- */
.vwf-device {
  position: relative;
  width: 100%;
  max-width: 215px;
  margin-inline: auto;
}

.vwf-device .vw-phone {
  max-width: none;
}

.vwf-screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.vwf-screen.is-active {
  opacity: 1;
  transform: none;
}

/* `.vw-phone-screen img` (CSS compartilhado) estica a imagem a 100% da
   altura; aqui o print fica na proporção dele e o excesso é cortado embaixo. */
.vwf-screen img {
  display: block;
  width: 100%;
  height: auto;
}

/* Camada por cima do print: mesmo formato da imagem */
.vwf-ov {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1080 / 2424;
  container-type: inline-size;
  pointer-events: none;
}

/* A camada de cada passo só existe enquanto ele está ativo: ao reaparecer,
   as animações dela recomeçam do zero. Camada sem `data-ov` (ex.: a do hero)
   fica sempre ligada. */
.vwf-ov[data-ov] {
  display: none;
}

.vwf[data-step="1"] .vwf-ov[data-ov="1"],
.vwf[data-step="2"] .vwf-ov[data-ov="2"],
.vwf[data-step="3"] .vwf-ov[data-ov="3"],
.vwf[data-step="4"] .vwf-ov[data-ov="4"],
.vwf[data-step="5"] .vwf-ov[data-ov="5"] {
  display: block;
}

.vwf-ov>* {
  position: absolute;
}

/* O print "depois do toque" */
.vwf-next {
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  animation: vwf-fade-in 0.45s ease both;
  animation-delay: var(--d, 1.2s);
}

@keyframes vwf-fade-in {
  to {
    opacity: 1;
  }
}

/* Toque do dedo */
.vwf-tap {
  width: 11cqw;
  height: 11cqw;
  margin: -5.5cqw 0 0 -5.5cqw;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.28);
  box-shadow: 0 0 0 1.2cqw rgba(15, 23, 42, 0.12);
  opacity: 0;
  animation: vwf-tap 0.9s ease-out both;
  animation-delay: var(--d, 0.5s);
}

@keyframes vwf-tap {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }

  25% {
    opacity: 1;
    transform: scale(0.8);
  }

  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

/* Aparecer (bloco novo na agenda do hero) */
.vwf-in {
  opacity: 0;
  animation: vwf-pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
  animation-delay: var(--d, 1s);
}

@keyframes vwf-pop {
  from {
    opacity: 0;
    transform: translateY(1.5cqw) scale(0.94);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Moldura de destaque em volta de um trecho do print */
.vwf-ring {
  border-radius: 2.6cqw;
  box-shadow: 0 0 0 0.9cqw var(--vw-solar), 0 0 0 2.6cqw rgba(254, 204, 0, 0.25);
  opacity: 0;
  animation: vwf-ring 1.6s ease-out both;
  animation-delay: var(--d, 0.8s);
}

@keyframes vwf-ring {
  0% {
    opacity: 0;
    transform: scale(1.06);
  }

  25% {
    opacity: 1;
    transform: scale(1);
  }

  75% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.vwf-ring--stay {
  animation-name: vwf-ring-stay;
  animation-duration: 0.5s;
}

@keyframes vwf-ring-stay {
  from {
    opacity: 0;
    transform: scale(1.06);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Horário novo entrando na agenda (hero) */
.vwf-slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 0.6cqw;
  background: #fff3b0;
  border: 0.25cqw solid #f2c200;
  border-radius: 0.6cqw;
  font-family: Roboto, var(--vw-font-body);
  color: #1f2937;
  transform-origin: left center;
}

.vwf-slot small {
  font-size: 2cqw;
  line-height: 1.1;
  color: #4b5563;
}

.vwf-slot strong {
  font-size: 2.6cqw;
  line-height: 1.25;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Linha do tempo embaixo do celular: mostra que tem mais vindo e deixa
   pausar (conteúdo que se move sozinho por mais de 5 s precisa de pausa).
   -------------------------------------------------------------------------- */
.vwf-timer {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  max-width: 260px;
  margin: 1.125rem auto 0;
}

.vwf-timer-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--vw-r-full);
  background: var(--vw-subtle);
  color: var(--vw-ink);
  cursor: pointer;
}

.vwf-timer-btn:hover {
  background: var(--vw-border);
}

.vwf-timer-btn:focus-visible {
  outline: 2px solid var(--vw-sky);
  outline-offset: 2px;
}

.vwf-timer-btn svg {
  width: 14px;
  height: 14px;
}

.vwf-timer-btn .vwf-ico-play,
.vwf-timer-btn[aria-pressed="true"] .vwf-ico-pause {
  display: none;
}

.vwf-timer-btn[aria-pressed="true"] .vwf-ico-play {
  display: block;
}

.vwf-timer-track {
  position: relative;
  flex: 1 1 auto;
  height: 4px;
  border-radius: var(--vw-r-full);
  background: var(--vw-border);
  overflow: hidden;
}

.vwf-timer-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--vw-solar);
  transform: scaleX(0);
  transform-origin: left center;
}

.vwf-timer.is-tick .vwf-timer-fill {
  animation: vwf-progress var(--vwf-dur) linear both;
}

.vwf-timer-count {
  flex: none;
  min-width: 2.25rem;
  font-size: 12px;
  font-weight: 600;
  color: #526077;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Sem JS ou com movimento reduzido: não há troca automática nem linha */
.vwf:not(.is-ready) .vwf-timer,
.vwf.is-static .vwf-timer {
  display: none;
}

@keyframes vwf-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* --------------------------------------------------------------------------
   Cartão flutuante (o resultado de cada passo, por fora do aparelho)
   -------------------------------------------------------------------------- */
.vwf-toast {
  position: absolute;
  z-index: 6;
  left: -18%;
  bottom: 14%;
  display: none;
  align-items: center;
  gap: 0.6rem;
  max-width: 13.5rem;
  padding: 0.6rem 0.8rem 0.6rem 0.6rem;
  border-radius: var(--vw-r-md);
  background: var(--vw-surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--vw-shadow-4);
}

.vwf[data-step="1"] .vwf-toast[data-ov="1"],
.vwf[data-step="2"] .vwf-toast[data-ov="2"],
.vwf[data-step="3"] .vwf-toast[data-ov="3"],
.vwf[data-step="4"] .vwf-toast[data-ov="4"],
.vwf[data-step="5"] .vwf-toast[data-ov="5"] {
  display: flex;
  animation: vwf-toast 0.5s cubic-bezier(0.2, 0.8, 0.2, 1.15) both;
  animation-delay: 1.9s;
}

@keyframes vwf-toast {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.vwf-toast .vw-icon-tile {
  flex: none;
}

.vwf-toast-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vw-ink-muted);
}

.vwf-toast-value {
  display: block;
  font-family: var(--vw-font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: var(--vw-ink);
}

@keyframes vwf-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Pausada (fora da tela, aba escondida ou pausa pelo botão): tudo congela */
.vwf.is-paused *,
.vwf.is-paused *::before,
.vwf.is-paused *::after {
  animation-play-state: paused !important;
}

/* …menos o texto do passo: pausado no meio da entrada, ele ficaria invisível */
.vwf.is-paused .vwf-caption {
  animation-play-state: running !important;
}

/* --------------------------------------------------------------------------
   Desktop: passos à esquerda, celular à direita
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .vwf-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 3rem;
  }

  .vwf-device {
    max-width: 290px;
  }

  .vwf-steps {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .vwf-step {
    display: grid;
    grid-template-columns: 4px 1fr;
    column-gap: 1.125rem;
    padding: 0.875rem 1rem 0.875rem 0;
    border-radius: var(--vw-r-md);
  }

  .vwf-track {
    position: relative;
    display: block;
    grid-row: 1 / span 2;
    width: 4px;
    border-radius: var(--vw-r-full);
    background: var(--vw-border);
    overflow: hidden;
  }

  .vwf-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--vw-solar);
    transform: scaleY(0);
    transform-origin: center top;
  }

  .vwf-step.is-done .vwf-fill,
  .vwf:not(.is-ready) .vwf-step.is-active .vwf-fill,
  .vwf.is-static .vwf-step.is-active .vwf-fill {
    transform: scaleY(1);
  }

  .vwf-step.is-done:not(.is-active) .vwf-fill {
    background: var(--vw-solar-border);
  }

  .vwf.is-ready:not(.is-static) .vwf-step.is-active .vwf-fill {
    animation: vwf-progress-y var(--vwf-dur) linear both;
  }

  .vwf-num {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: var(--vw-r-full);
    background: var(--vw-subtle);
    font-size: 12px;
    font-weight: 700;
    color: var(--vw-ink-muted);
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .vwf-step.is-active .vwf-num {
    background: var(--vw-solar);
    color: var(--vw-ink);
  }

  .vwf-label {
    display: none;
  }

  .vwf-title {
    display: block;
    font-family: var(--vw-font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
    color: var(--vw-ink-muted);
    transition: color 0.2s ease;
  }

  .vwf-step:hover .vwf-title,
  .vwf-step.is-active .vwf-title {
    color: var(--vw-ink);
  }

  /* O texto abre e fecha sem medir altura (grid 0fr → 1fr) */
  .vwf-desc {
    display: grid;
    grid-template-rows: 0fr;
    grid-column: 2;
    transition: grid-template-rows 0.35s ease;
  }

  .vwf-desc>span {
    overflow: hidden;
    font-size: 15px;
    line-height: 24px;
    color: var(--vw-ink-2);
  }

  .vwf-step.is-active .vwf-desc {
    grid-template-rows: 1fr;
  }

  .vwf-step.is-active .vwf-desc>span {
    padding-top: 0.375rem;
  }

  .vwf-caption {
    display: none;
  }

  /* No alto do aparelho: os destaques dos passos ficam do meio para baixo */
  .vwf-toast {
    left: -30%;
    top: 16%;
    bottom: auto;
  }
}

@keyframes vwf-progress-y {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}
