/* =====================================================================
   Transições do Controle LVPR (03/12/2026) — inspiradas no catálogo grátis do transitions.dev.
   Só mexem em posição/tamanho/transparência (rodam na placa de vídeo do aparelho).
   Tudo desliga sozinho para quem ativou "reduzir movimento" no celular/computador.
   Números = prévias aprovadas: https://claude.ai/artifact/Y1dJJXnq4DNiS2v9cqy7Jy
   ===================================================================== */
:root { --lv-out: cubic-bezier(.22, 1, .36, 1); --lv-spring: cubic-bezier(.2, .9, .25, 1.15); }

/* 1 — Avisos flutuantes que sobem e somem */
.lv-toasts { position: fixed; z-index: 1090; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
body.is-dashboard .lv-toasts, body.is-quicksale .lv-toasts, body.is-catalog .lv-toasts { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 992px) { .lv-toasts { left: auto; right: 24px; transform: none; top: 18px; bottom: auto; width: 400px; } }
.lv-toasts .alert { pointer-events: auto; margin: 0; border-radius: 14px; box-shadow: 0 12px 30px rgba(15, 23, 42, .18); font-weight: 600; padding-right: 3rem; animation: lv-toast-in .45s var(--lv-out) both; }
.lv-toasts .alert.lv-out { animation: lv-toast-out .3s ease-in both; }
@keyframes lv-toast-in { from { opacity: 0; transform: translateY(22px) scale(.94); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes lv-toast-out { to { opacity: 0; transform: translateY(12px) scale(.96); filter: blur(4px); } }

/* 2 — Check de sucesso (venda lançada / aprovada) */
.lv-ok { position: fixed; inset: 0; z-index: 1095; display: grid; place-items: center; pointer-events: none; }
.lv-ok > div { width: 112px; height: 112px; border-radius: 50%; background: #e8f7ee; display: grid; place-items: center; box-shadow: 0 18px 40px rgba(22, 163, 74, .25); animation: lv-ok-pop .5s var(--lv-spring) both; }
[data-bs-theme="dark"] .lv-ok > div { background: #123222; }
.lv-ok svg { width: 62px; height: 62px; }
.lv-ok path { fill: none; stroke: #16a34a; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: lv-draw .45s .2s ease-out forwards; }
.lv-ok.lv-out > div { animation: lv-ok-out .3s ease-in both; }
@keyframes lv-ok-pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; filter: blur(4px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes lv-ok-out { to { transform: scale(.85); opacity: 0; } }
@keyframes lv-draw { to { stroke-dashoffset: 0; } }

/* 3 — Tremida de erro */
.lv-shake { animation: lv-shake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes lv-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

/* 4 — Números rolando (só na 1ª abertura do Início no dia) */
/* 03/12: "span.lv-drum" + reset — os rótulos do Início usam a regra ".m-kpis span" (pequeno, em bloco) e ela pegava os roletes */
span.lv-drum, span.lv-ch { font: inherit; letter-spacing: inherit; text-transform: none; color: inherit; margin: 0; padding: 0; }
/* 03/12 v2: o algarismo final fica invisível no lugar (define largura e linha de base exatas) e o rolo corre por cima.
   clip-path em vez de overflow:hidden — overflow muda a linha de base e o número "pulava" no fim. */
span.lv-drum { display: inline-block; position: relative; vertical-align: baseline; clip-path: inset(0 -.3em); }
span.lv-drum > i.lv-gh { font-style: normal; visibility: hidden; }
span.lv-drum > span.lv-col { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; align-items: center; font: inherit; letter-spacing: inherit; text-transform: none; color: inherit; margin: 0; transition: transform .9s var(--lv-out); }
span.lv-drum > span.lv-col > i { display: block; font-style: normal; line-height: inherit; }

/* 5 — Dígito do total que troca suave */
span.lv-ch { display: inline-block; white-space: pre; }
.lv-ch.lv-sw { animation: lv-sw .35s var(--lv-out); }
@keyframes lv-sw { from { opacity: 0; transform: translateY(-.45em); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* 6 — Contador de Aprovações que pula */
.lv-pop { animation: lv-pop .6s var(--lv-spring) both; }
@keyframes lv-pop { 0% { transform: translate(-6px, 6px) scale(0); opacity: 0; } 60% { transform: translate(1px, -1px) scale(1.2); opacity: 1; } 100% { transform: none; } }

/* 7 — Pix / Cartão / Dinheiro com fundo que desliza */
.qs-pay.lv-seg { position: relative; }
.lv-pill { position: absolute; top: 0; left: 0; border-radius: 10px; background: var(--e-fg); z-index: 0; transition: transform .38s var(--lv-spring), width .38s var(--lv-spring); pointer-events: none; }
.qs-pay.lv-seg label { position: relative; z-index: 1; }
.qs-pay.lv-seg > .lv-pill { display: block; padding: 0; border: 0; background: var(--e-fg); box-sizing: border-box; }
.qs-pay.lv-seg label > span { background: transparent; transition: color .25s, border-color .25s; }
.qs-pay.lv-seg input:checked + span { background: transparent; border-color: transparent; }

/* 8 — Janelas que crescem do centro (Bootstrap) + confirmação própria */
.modal.fade .modal-dialog { transform: scale(.92); transition: transform .32s var(--lv-spring); }
.modal.show .modal-dialog { transform: none; }
.lv-dlg-scr { position: fixed; inset: 0; z-index: 1100; background: rgba(10, 16, 24, .45); display: grid; place-items: center; padding: 16px; animation: lv-fade .2s both; }
.lv-dlg { width: min(380px, 100%); background: var(--e-card, #fff); color: var(--e-fg, #14202b); border-radius: 20px; padding: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: lv-dlg-in .32s var(--lv-spring) both; }
.lv-dlg p { margin: 0 0 16px; font-weight: 600; line-height: 1.45; }
.lv-dlg .lv-dlg-b { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.lv-dlg .btn { min-height: 44px; padding-inline: 18px; border-radius: 12px; font-weight: 700; }
.lv-dlg-scr.lv-out { animation: lv-fade .18s reverse both; }
.lv-dlg-scr.lv-out .lv-dlg { animation: lv-dlg-out .18s ease-in both; }
@keyframes lv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lv-dlg-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes lv-dlg-out { to { opacity: 0; transform: scale(.95); } }

/* 9 — Menu do celular desliza, itens entram em cascata */
@media (max-width: 991.98px) {
  .sidebar { transition: transform .38s var(--lv-out); }
  .sidebar-backdrop.show { animation: lv-fade .25s both; }
  .sidebar.show .sidebar-nav > a, .sidebar.show .sidebar-nav > .sidebar-heading { animation: lv-slide-in .35s var(--lv-out) both; animation-delay: calc(var(--lv-i, 0) * 22ms + 80ms); }
}
@keyframes lv-slide-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

/* 10 — Abrir e fechar suave (details / painel de filtros) — feito no JS */
details.lv-anim { overflow: hidden; }

/* 11 — Esqueleto da busca */
.lv-skel { height: 44px; margin: 6px 10px; border-radius: 10px; background: linear-gradient(90deg, var(--e-line, #e3e8f0) 25%, var(--e-card, #fff) 50%, var(--e-line, #e3e8f0) 75%); background-size: 200% 100%; animation: lv-shim 1.1s linear infinite; }
@keyframes lv-shim { to { background-position: -200% 0; } }
.e-res, .e-res-head, .e-res-empty { animation: lv-rin .3s var(--lv-out) both; }
@keyframes lv-rin { from { opacity: 0; transform: translateY(5px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* 12 — Botão "Salvando…" */
.lv-busy { pointer-events: none; opacity: .92; }
.lv-busy .lv-lbl { display: inline-flex; align-items: center; gap: 8px; animation: lv-sw .3s var(--lv-out); }
.lv-spin { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: lv-rot .7s linear infinite; }
@keyframes lv-rot { to { transform: rotate(360deg); } }

/* 13 — Troca de tela (Chrome/Edge, Android, iPhone iOS 18+; nos outros troca normal) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(root) { animation-duration: .2s; }
  .sidebar { view-transition-name: lv-side; }
}
@media (max-width: 991.98px) and (prefers-reduced-motion: no-preference) {
  .sidebar { view-transition-name: none; }
  .tabbar { view-transition-name: lv-tabbar; }
  ::view-transition-old(root) { animation: lv-vt-out-l .32s var(--lv-out) both; }
  ::view-transition-new(root) { animation: lv-vt-in-r .32s var(--lv-out) both; }
  html:active-view-transition-type(back)::view-transition-old(root) { animation-name: lv-vt-out-r; z-index: 2; }
  html:active-view-transition-type(back)::view-transition-new(root) { animation-name: lv-vt-in-l; }
}
@keyframes lv-vt-in-r { from { transform: translateX(100%); } to { transform: none; } }
@keyframes lv-vt-out-l { to { transform: translateX(-25%); opacity: .6; } }
@keyframes lv-vt-out-r { to { transform: translateX(100%); } }
@keyframes lv-vt-in-l { from { transform: translateX(-25%); opacity: .6; } to { transform: none; opacity: 1; } }

/* 14 — Item que sai da lista (feito no JS) */

/* Reduzir movimento: corta tudo */
@media (prefers-reduced-motion: reduce) {
  .lv-toasts .alert, .lv-ok > div, .lv-ok path, .lv-shake, .lv-ch.lv-sw, .lv-pop, .lv-dlg-scr, .lv-dlg, .sidebar-nav > *, .e-res, .e-res-head, .e-res-empty, .lv-busy .lv-lbl { animation: none !important; }
  .lv-ok path { stroke-dashoffset: 0; }
  span.lv-drum > span.lv-col, .lv-pill, .sidebar, .modal.fade .modal-dialog { transition: none !important; }
}
