/* =========================================================
   movimento.css - movimento e acabamento (2026-11-25, historico 47).
   Vem DEPOIS de app.css e portal.css. Regras (dos reels que o Daniel mandou):
   - todo movimento entre 100 e 500 ms; nada comeca nem para de repente;
   - o que se usa toda hora (barra de baixo) continua instantaneo;
   - quem pediu "menos movimento" no aparelho nao ve animacao (fim do arquivo).
   As classes mov-entra / mov-lista sao postas por js/app.js so quando a pessoa troca de tela ou de aba.
   ========================================================= */

body {
  --mov-sai: cubic-bezier(.2, .8, .2, 1);        /* chega rapido e pousa devagar */
  --mov-mola: cubic-bezier(.34, 1.45, .64, 1);   /* passa um pouquinho e volta */
}

/* ---------- 1. TOQUE: todo botao afunda um pouco e volta como mola ---------- */
body :is(.btn, .b1, .b2, .b3, .aba, .chip, .nota-b, .faixa, .uso, .soltar, .ecard, .linklike, .tit, .cor) {
  transition: transform .26s var(--mov-mola), filter .2s, border-color .15s, background-color .15s, box-shadow .2s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
body :is(.btn, .b1, .b2, .b3, .aba, .chip, .nota-b, .linklike, .cor):active { transform: scale(.955); filter: brightness(.9); transition-duration: .07s; }
body :is(.faixa, .uso, .soltar, .ecard, .tit):active { transform: scale(.985); filter: brightness(.94); transition-duration: .07s; }

/* ---------- 2. CASCATA: ao trocar de tela, os blocos chegam um depois do outro ---------- */
@keyframes mov-sobe { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body .mov-entra > * { animation: mov-sobe .32s var(--mov-sai) backwards; }
body .mov-entra > :nth-child(2) { animation-delay: .04s; }
body .mov-entra > :nth-child(3) { animation-delay: .08s; }
body .mov-entra > :nth-child(4) { animation-delay: .12s; }
body .mov-entra > :nth-child(5) { animation-delay: .16s; }
body .mov-entra > :nth-child(n+6) { animation-delay: .2s; }
/* os cartoes de dentro das listas tambem, em escadinha */
body :is(.mov-entra, .mov-lista) :is(.pgrid, .egrid, .lista) > * { animation: mov-sobe .34s var(--mov-sai) backwards; animation-delay: .12s; }
body :is(.mov-entra, .mov-lista) :is(.pgrid, .egrid, .lista) > :nth-child(2) { animation-delay: .17s; }
body :is(.mov-entra, .mov-lista) :is(.pgrid, .egrid, .lista) > :nth-child(3) { animation-delay: .22s; }
body :is(.mov-entra, .mov-lista) :is(.pgrid, .egrid, .lista) > :nth-child(4) { animation-delay: .27s; }
body :is(.mov-entra, .mov-lista) :is(.pgrid, .egrid, .lista) > :nth-child(n+5) { animation-delay: .32s; }
/* troca de aba em "Meus videos": so a lista se mexe, mais curto */
body .mov-lista :is(.pgrid, .lista) > * { animation-duration: .26s; animation-delay: 0s; }
body .mov-lista :is(.pgrid, .lista) > :nth-child(2) { animation-delay: .04s; }
body .mov-lista :is(.pgrid, .lista) > :nth-child(3) { animation-delay: .08s; }
body .mov-lista :is(.pgrid, .lista) > :nth-child(n+4) { animation-delay: .12s; }

/* a barra do plano enche depois que o cartao pousa (o detalhe chega um instante depois) */
@keyframes mov-enche { from { max-width: 6px; } to { max-width: 100%; } }
body .mov-entra .bar i { animation: mov-enche .75s .3s var(--mov-sai) backwards; }

/* ---------- 3. JANELA: cresce a partir de onde a pessoa tocou ---------- */
@keyframes mov-fundo { from { background-color: rgba(0, 0, 0, 0); } }
@keyframes mov-janela { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
body .modal-wrap.on { animation: mov-fundo .2s ease-out backwards; }
body .modal-wrap.on > * { animation: mov-janela .28s var(--mov-sai) backwards; }
/* a gaveta do pedido: mesma curva, um nada mais longa */
body .ficha { transition: transform .3s var(--mov-sai); }

/* ---------- 4. AVISO de baixo: sobe com molinha ---------- */
body .toast { transition: transform .36s var(--mov-mola), opacity .2s; }

/* ---------- 5. ESTRELAS: acendem em sequencia, com um pulinho ---------- */
@keyframes mov-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
body .nota-b.on svg { animation: mov-pop .34s var(--mov-sai) backwards; }
body .nota-b.on:nth-child(2) svg { animation-delay: .04s; }
body .nota-b.on:nth-child(3) svg { animation-delay: .08s; }
body .nota-b.on:nth-child(4) svg { animation-delay: .12s; }
body .nota-b.on:nth-child(5) svg { animation-delay: .16s; }
/* escolha feita (estilo, opcao): um pulso curto de luz */
@keyframes mov-acende { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac) 70%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }

/* ---------- 6. ESPERA: formas cinzas com brilho no lugar do texto "Carregando" ---------- */
@keyframes mov-brilho { to { background-position: -200% 0; } }
.mov-esq { position: relative; z-index: 1; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 110px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.mov-esq i { display: block; border-radius: 10px; background: linear-gradient(90deg, rgba(var(--tint), .07) 25%, rgba(var(--tint), .16) 45%, rgba(var(--tint), .07) 65%); background-size: 200% 100%; animation: mov-brilho 1.3s linear infinite; }
.mov-esq .l1 { width: 38%; height: 10px; }
.mov-esq .l2 { width: 62%; height: 30px; }
.mov-esq .l3 { width: 24%; height: 12px; }
.mov-esq .bt { height: 46px; border-radius: 12px; margin-top: 6px; }
.mov-esq .ab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 8px; }
.mov-esq .ab i { height: 42px; border-radius: 999px; }
.mov-esq .cx { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 11px; }
.mov-esq .cx .a { width: 70%; height: 16px; }
.mov-esq .cx .b { width: 40%; height: 10px; }
.mov-esq .cx .c { width: 100%; height: 34px; }
.mov-esq .cx .d { width: 55%; height: 38px; }

/* ---------- 7. APROVOU: a tela inteira comemora (pedido do Daniel, 25/11) ----------
   O verde abre a partir do botao tocado, o sinal de conferido se desenha e cresce, "Aprovado!" pousa com mola,
   fagulhas saem do centro. Dura 2 s e some sozinha (um toque fecha antes). */
@keyframes mov-abre { from { clip-path: circle(0 at var(--x, 50%) var(--y, 50%)); } to { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); } }
@keyframes mov-some { to { opacity: 0; } }
@keyframes mov-selo { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes mov-anel { from { opacity: .8; transform: scale(.7); } to { opacity: 0; transform: scale(3.4); } }
@keyframes mov-risco { to { stroke-dashoffset: 0; } }
@keyframes mov-titulo { 0% { opacity: 0; transform: translateY(26px) scale(.9); } 60% { opacity: 1; transform: translateY(-4px) scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes mov-fagulha { 0% { opacity: 0; transform: rotate(var(--g)) translateY(-70px) scaleY(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--g)) translateY(calc(-1 * var(--d))) scaleY(1); } }
@keyframes mov-respira { 50% { transform: scale(1.06); } }
.mov-festa { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; padding: 24px; overflow: hidden; cursor: pointer;
  background: radial-gradient(520px 520px at 50% 44%, color-mix(in srgb, var(--won) 38%, transparent), transparent 72%), radial-gradient(900px 700px at 50% 110%, color-mix(in srgb, var(--ac) 22%, transparent), transparent 70%), #03110a;
  animation: mov-abre .5s cubic-bezier(.3, .7, .2, 1) both, mov-some .35s 1.75s ease-in forwards; }
.mov-festa .selo { position: relative; width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center; background: var(--won); color: #03170a; box-shadow: 0 0 90px -4px var(--won), inset 0 -10px 24px rgba(0, 0, 0, .12); animation: mov-selo .55s .18s cubic-bezier(.2, .8, .2, 1) both, mov-respira 1.2s .8s ease-in-out infinite; }
.mov-festa .selo::before, .mov-festa .selo::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--won); animation: mov-anel 1s .3s ease-out both; }
.mov-festa .selo::after { animation-delay: .55s; }
.mov-festa .selo svg { width: 78px; height: 78px; stroke-width: 2.8; stroke-dasharray: 30; stroke-dashoffset: 30; animation: mov-risco .38s .45s ease-out forwards; }
.mov-festa b { font-family: var(--display); font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: #fff; text-shadow: 0 0 40px color-mix(in srgb, var(--won) 70%, transparent); animation: mov-titulo .5s .5s cubic-bezier(.2, .8, .2, 1) both; }
.mov-festa span { color: color-mix(in srgb, var(--won) 55%, #fff); font-size: 15px; animation: mov-titulo .45s .64s cubic-bezier(.2, .8, .2, 1) both; }
.mov-festa .fag { position: absolute; left: 50%; top: 44%; width: 0; height: 0; }
.mov-festa .fag i { position: absolute; left: -3px; top: -9px; width: 6px; height: 18px; border-radius: 3px; background: var(--k, var(--won)); box-shadow: 0 0 12px var(--k, var(--won)); animation: mov-fagulha .95s .42s cubic-bezier(.15, .7, .3, 1) both; }

/* ---------- 9. PUXAR PARA ATUALIZAR em "Meus videos": sem desenho (Daniel, 25/11). A mola e a do proprio aparelho;
   o site so percebe o gesto e atualiza (ver _previa-movimento.js). ---------- */
/* ---------- 10. "ENTENDENDO O SEU ESTILO": sai do topo de todas as telas e fica no fim de Estilos (Daniel, 25/11) ---------- */
@keyframes mov-surge { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.mov-seu { display: flex; align-items: center; gap: 13px; padding: 16px; margin-top: 6px; opacity: 0; }
.mov-seu.visto { opacity: 1; animation: mov-surge .45s var(--mov-sai) backwards; }
.mov-seu.visto.ja { animation: none; }
.mov-seu > svg { width: 22px; height: 22px; color: var(--ac); filter: drop-shadow(0 0 6px var(--ac)); }
.mov-seu span { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.mov-seu b { display: block; color: var(--text); font-family: var(--display); font-size: 15.5px; font-weight: 600; margin-bottom: 2px; }
.mov-seu em { flex: none; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ac) 55%, transparent); color: var(--ac); font-weight: 650; font-size: 12.5px; display: inline-flex; align-items: center; background: color-mix(in srgb, var(--ac) 9%, transparent); }
body .mov-seu { transition: transform .26s var(--mov-mola), filter .2s, border-color .15s; }
body .mov-seu:active { transform: scale(.985); filter: brightness(.94); transition-duration: .07s; }

/* no computador nao existe "puxar": fica um botao pequeno de atualizar ao lado do "Enviar novo video" */
.mov-atualizar { display: none; }
@media (min-width: 861px) { body .mov-atualizar { display: inline-flex; height: 38px; } }

/* ---------- 8. TELA DE ENTRADA no celular: marca grande em cima, campos embaixo (perto do dedao) ---------- */
@media (max-width: 860px) {
  body .entrar { align-items: stretch; }
  body .entrar-cx:not(.ver) { background: none; border: 0; min-height: calc(100dvh - 48px); padding: 8px 6px 4px; }
  body .entrar-cx:not(.ver)::before, body .entrar-cx:not(.ver)::after { display: none; }
  body .entrar-cx:not(.ver) .brand { flex-direction: column; text-align: center; gap: 16px; margin: auto 0; padding: 30px 0; }
  body .entrar-cx:not(.ver) .brand .logo { width: 68px; height: 68px; border-radius: 20px; box-shadow: 0 0 60px -4px color-mix(in srgb, var(--ac) 70%, transparent); }
  body .entrar-cx:not(.ver) .brand .logo svg { width: 30px; height: 30px; }
  body .entrar-cx:not(.ver) .brand b { font-size: 30px; letter-spacing: -.02em; }
  body .entrar-cx:not(.ver) .brand span { font-size: 14px; margin-top: 6px; display: block; }
  body .entrar-cx:not(.ver) > h1 { display: none; }   /* o botao ja diz "Entrar" */
  body .entrar-cx:not(.ver) .campo input { height: 50px; font-size: 16px; }
  body .entrar-cx:not(.ver) .btn { height: 52px; font-size: 15.5px; border-radius: 14px; }
  body .entrar-cx:not(.ver) form > .linklike { align-self: center; }
  body .entrar-cx:not(.ver) > .linklike { align-self: center; color: var(--muted); font-weight: 500; }
  /* so na demonstracao: os dois botoes de exemplo ficam pequenos, lado a lado */
  body .entrar-cx:not(.ver) > .sep ~ p { display: none; }
  body .entrar-cx:not(.ver) > .sep { margin-top: 4px; }
  body .entrar-cx:not(.ver) { flex-flow: row wrap; align-content: flex-start; }
  body .entrar-cx:not(.ver) > * { flex: 1 0 100%; }
  body .entrar-cx:not(.ver) > .b2 { flex: 1 1 40%; height: 38px; font-size: 12.5px; }
  body .entrar-cx:not(.ver) > .linklike { text-align: center; }
}

/* quem pediu menos movimento no aparelho: nada de animacao, so as trocas de cor */
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after, .mov-esq i { animation: none !important; }
  .mov-festa { animation: mov-some .3s 1.4s forwards !important; }
  .mov-festa * { opacity: 1 !important; stroke-dashoffset: 0 !important; }
}
