/* =========================================================
   Movimento e microinterações (ver motion.js)
   ========================================================= */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }

/* ---------- abas deslizantes ---------- */
.m-seg { position: relative; isolation: isolate; }
.m-seg > button { position: relative; z-index: 1; transition: color .25s; }
.m-seg > button.on, .m-seg > button.on:hover { background: transparent !important; box-shadow: none !important; }
.m-pill { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 999px; background: var(--ink); pointer-events: none;
  transition: transform .44s cubic-bezier(.3, 1.28, .4, 1), width .44s cubic-bezier(.3, 1.28, .4, 1), height .3s, background-color .3s; }
.m-pill.m-sem { transition: none; }
.fin-tabs .m-pill { box-shadow: 0 2px 6px rgba(20, 26, 30, .18); }
.fin-tabs .m-pill[data-t="in"] { background: var(--ok); }
.fin-tabs .m-pill[data-t="out"] { background: var(--bad); }

/* ---------- chaves com duplo quique ---------- */
.sw.m-flip.on i { animation: mSwOn .62s cubic-bezier(.25, .8, .3, 1); }
.sw.m-flip:not(.on) i { animation: mSwOff .62s cubic-bezier(.25, .8, .3, 1); }
@keyframes mSwOn { 0% { transform: translateX(0); } 30% { transform: translateX(17px) scaleX(1.22); } 50% { transform: translateX(13.6px) scaleX(.92); } 68% { transform: translateX(15.9px); } 84% { transform: translateX(14.6px); } 100% { transform: translateX(15px); } }
@keyframes mSwOff { 0% { transform: translateX(15px); } 30% { transform: translateX(-2px) scaleX(1.22); } 50% { transform: translateX(1.4px) scaleX(.92); } 68% { transform: translateX(-.9px); } 84% { transform: translateX(.4px); } 100% { transform: translateX(0); } }
.chave i { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); transition: transform .62s linear(0, .62 18%, 1.1 31%, .95 45%, 1.03 59%, .99 74%, 1); }
.sw { transition: background .25s; }

/* ---------- contadores de aviso ---------- */
.m-badge { animation: mBadge .62s cubic-bezier(.3, 1.5, .45, 1) var(--d, 0s) backwards; }
.m-bump { animation: mBump .5s cubic-bezier(.3, 1.6, .45, 1); }
@keyframes mBadge { 0% { opacity: 0; transform: translate(9px, -9px) scale(.3); } 60% { opacity: 1; transform: translate(-1px, 1px) scale(1.16); } 100% { transform: none; } }
@keyframes mBump { 0% { transform: scale(1); } 35% { transform: scale(1.32); } 65% { transform: scale(.94); } 100% { transform: scale(1); } }

/* ---------- conteúdo que entra ---------- */
/* Como o "Animated Content" do React Bits: sobe de uma distância curta, aparecendo, com ease-out forte (power3.out) */
.m-in { animation: mIn .8s cubic-bezier(.215, .61, .355, 1) calc(var(--i, 0) * 70ms) backwards; }
.m-in-c { animation: mIn .75s cubic-bezier(.215, .61, .355, 1) calc(var(--i, 0) * 70ms + var(--j, 0) * 50ms + 60ms) backwards; }
@keyframes mIn { from { opacity: 0; transform: translateY(56px); } }

/* ---------- sucesso: o check entra girando e é desenhado ---------- */
.fb-ico.ok { animation: mOk .62s cubic-bezier(.2, 1.45, .4, 1) .04s backwards; }
.fb-ico.ok path { stroke-dasharray: 19; stroke-dashoffset: 19; animation: mDraw .38s .26s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes mOk { 0% { opacity: 0; transform: scale(.45) rotate(-55deg); filter: blur(6px); } 60% { opacity: 1; transform: scale(1.08) rotate(6deg); filter: blur(0); } 100% { transform: none; } }
@keyframes mDraw { to { stroke-dashoffset: 0; } }

/* ---------- opções em "geleia" ---------- */
.m-jelly.m-jelly.m-jelly { animation: mJelly .55s cubic-bezier(.3, 1.4, .45, 1); }
.m-push-l { animation: mPushL .45s cubic-bezier(.3, 1.4, .45, 1); }
.m-push-r { animation: mPushR .45s cubic-bezier(.3, 1.4, .45, 1); }
/* a pílula das abas também balança ao chegar (usa a propriedade scale para não brigar com o translate do deslize) */
.m-pill.m-pill-j { animation: mPillJ .6s cubic-bezier(.3, 1.4, .45, 1); }
@keyframes mPillJ { 0% { scale: 1; } 35% { scale: 1.1 .88; } 60% { scale: .97 1.05; } 82% { scale: 1.02 .99; } 100% { scale: 1; } }
@keyframes mJelly { 0% { transform: scale(.93, 1.03); } 30% { transform: scale(1.13, .93); } 55% { transform: scale(.97, 1.04); } 78% { transform: scale(1.03, .99); } 100% { transform: none; } }
@keyframes mPushL { 30% { transform: translateX(-6px) scale(.97); } }
@keyframes mPushR { 30% { transform: translateX(6px) scale(.97); } }
.m-radio { display: flex; gap: 6px; flex-wrap: wrap; }
.m-radio > button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.m-radio > button:hover { border-color: var(--faint); }
.m-radio > button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ---------- indicador de espera (lattice) ---------- */
.m-lat { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.m-lat-g { display: grid; grid-template-columns: repeat(3, 4px); gap: 2px; flex: none; }
.m-lat-g i { width: 4px; height: 4px; border-radius: 1.2px; background: currentColor; opacity: .18; animation: mLat 1.3s var(--d) infinite ease-in-out; }
.m-lat time { font-variant-numeric: tabular-nums; opacity: .62; font-weight: 600; font-size: .92em; }
@keyframes mLat { 0%, 100% { opacity: .16; transform: scale(.75); } 38% { opacity: 1; transform: scale(1.12); } }
.m-status { position: fixed; top: 14px; left: 50%; z-index: 92; transform: translate(-50%, -12px); opacity: 0; transition: opacity .3s, transform .4s cubic-bezier(.3, 1.4, .5, 1);
  background: var(--surface); color: var(--gold-ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(20, 26, 30, .12); pointer-events: none; }
.m-status.show { opacity: 1; transform: translate(-50%, 0); }
.m-status .m-lat-t { color: var(--ink); }

/* ---------- salvando na planilha (call chip) ---------- */
.m-call { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; align-items: center; gap: 8px; padding: 7px 13px 7px 9px; border-radius: 999px; overflow: hidden;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 22px rgba(20, 26, 30, .12); font-size: 12.5px; font-weight: 700;
  opacity: 0; transform: translateY(12px) scale(.94); transition: opacity .25s, transform .38s cubic-bezier(.3, 1.4, .5, 1); pointer-events: none; }
.m-call.al { right: auto; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px) scale(.94); }
.m-call.show { opacity: 1; transform: none; }
.m-call.al.show { transform: translate(-50%, 0); }
.m-call > * { position: relative; z-index: 1; }
.m-call-f { position: absolute !important; inset: 0; z-index: 0 !important; background: var(--gold-soft); transform-origin: left; transform: scaleX(0); }
.m-call.run .m-call-f { animation: mWipe 7s cubic-bezier(.08, .7, .2, 1) forwards; }
.m-call.done .m-call-f { transform: scaleX(1); background: var(--ok-soft); transition: transform .3s, background .3s; }
.m-call.fail .m-call-f { transform: scaleX(1); background: var(--bad-soft); }
.m-call.fail { animation: mShake .42s cubic-bezier(.36, .07, .19, .97); }
.m-call.al.fail { animation: none; }
.m-call-i { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
.m-call-i i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin .8s linear infinite; }
.m-call-i svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.m-call.done { color: var(--ok); } .m-call.fail { color: var(--bad); }
.m-call.done .m-call-i path { stroke-dasharray: 19; stroke-dashoffset: 19; animation: mDraw .3s .05s forwards; }
.m-call time { font-variant-numeric: tabular-nums; opacity: .6; font-weight: 600; }
@keyframes mWipe { to { transform: scaleX(.94); } }
@keyframes mShake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px); } 45%, 55% { transform: translateX(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- coração (pulse heart) ---------- */
.m-heart { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 12px 6px 9px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.m-heart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; overflow: visible; }
.m-heart.on { color: #E0245E; border-color: rgba(224, 36, 94, .35); background: rgba(224, 36, 94, .07); }
.m-heart.on svg { fill: currentColor; }
.m-heart .m-hz { position: relative; display: grid; place-items: center; }
.m-heart .m-hz::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #E0245E; opacity: 0; }
.m-heart.m-beat svg { animation: mBeat .62s cubic-bezier(.3, 1.4, .45, 1); }
.m-heart.m-beat .m-hz::after { animation: mRing .6s .14s ease-out; }
.m-heart.m-unbeat svg { animation: mUnbeat .4s cubic-bezier(.3, 1.4, .45, 1); }
@keyframes mBeat { 0% { transform: scale(1); } 18% { transform: scale(.22); } 42% { transform: scale(1.36); } 62% { transform: scale(.9); } 80% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes mUnbeat { 30% { transform: scale(.7); } 100% { transform: scale(1); } }
@keyframes mRing { 0% { opacity: .7; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.9); } }
.m-cnt { display: inline-grid; overflow: hidden; height: 1.25em; line-height: 1.25em; font-variant-numeric: tabular-nums; }
.m-roll { display: grid; }
.m-roll s, .m-roll b { grid-area: 1 / 1; text-decoration: none; font-weight: inherit; }
.m-roll.up s { animation: mOutUp .42s cubic-bezier(.3, 1.2, .5, 1) forwards; } .m-roll.up b { animation: mInUp .42s cubic-bezier(.3, 1.2, .5, 1) backwards; }
.m-roll.down s { animation: mOutDn .42s cubic-bezier(.3, 1.2, .5, 1) forwards; } .m-roll.down b { animation: mInDn .42s cubic-bezier(.3, 1.2, .5, 1) backwards; }
@keyframes mOutUp { to { transform: translateY(-110%); opacity: 0; } } @keyframes mInUp { from { transform: translateY(110%); opacity: 0; } }
@keyframes mOutDn { to { transform: translateY(110%); opacity: 0; } } @keyframes mInDn { from { transform: translateY(-110%); opacity: 0; } }

/* ---------- picotar ao apagar (shredder) ---------- */
.m-shred { position: absolute; z-index: 5; pointer-events: none; }
.m-strip { position: absolute; inset: 0; transform-origin: var(--o, 50%) 0; animation: mShred .62s cubic-bezier(.55, 0, .8, .4) calc(var(--i) * 13ms) forwards; }
@keyframes mShred { 0% { transform: none; opacity: 1; } 20% { transform: translateY(4px) scaleY(.98); } 100% { transform: translate(var(--x), 74px) rotate(var(--r)) skewY(var(--k)); opacity: 0; } }

/* ---------- arrastar para apagar (swipe row) ---------- */
[data-swipe] { touch-action: pan-y; }
.m-sw { position: relative; overflow: hidden; border-radius: 12px; }
.m-sw > [data-swipe] { position: relative; z-index: 1; background: var(--surface); transition: transform .34s cubic-bezier(.3, 1.2, .4, 1); }
.m-sw.drag > [data-swipe] { transition: none; }
.m-sw-bg { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 22px; border: 0; background: var(--bad); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; width: 100%; }
.m-sw-bg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.m-sw-bg span { transition: opacity .2s; }
.m-sw.armed .m-sw-bg svg { transform: scale(1.3) rotate(-8deg); }
.m-sw.armed .m-sw-bg { background: #C2322B; }

/* ---------- botões de confirmação: clique simples (afunda, onda a partir do toque, pulinho) ---------- */
[data-confirma] { position: relative; overflow: hidden; isolation: isolate; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
[data-confirma].m-press { transform: scale(.95); transition: transform .1s ease-out; }
[data-confirma].m-tap { animation: mTap .42s cubic-bezier(.3, 1.6, .45, 1); }
@keyframes mTap { 0% { transform: scale(.94); } 45% { transform: scale(1.05); } 100% { transform: none; } }
[data-confirma] .m-onda { position: absolute; z-index: -1; width: var(--d); height: var(--d); border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .38); transform: translate(-50%, -50%) scale(0); animation: mOnda .55s cubic-bezier(.2, .7, .3, 1) forwards; }
.btn:not(.danger):not(.primary):not(.ok)[data-confirma] .m-onda { background: rgba(20, 26, 30, .14); }
@keyframes mOnda { 60% { opacity: 1; } to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.m-tip { position: fixed; z-index: 96; transform: translate(-50%, -6px); opacity: 0; background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 8px; pointer-events: none; transition: opacity .2s, transform .3s cubic-bezier(.3, 1.5, .5, 1); white-space: nowrap; }
.m-tip.show { opacity: 1; transform: translate(-50%, -12px); }

/* ---------- ditar por voz (voice pill) ---------- */
.m-voz-w { position: relative; display: block; }
.m-voz-w > textarea { width: 100%; padding-bottom: 44px; }
.m-voz { position: absolute; right: 8px; bottom: 8px; height: 32px; display: flex; align-items: center; gap: 0; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700;
  transition: background .25s, color .25s, border-color .25s, gap .35s cubic-bezier(.3, 1.3, .5, 1), padding .35s cubic-bezier(.3, 1.3, .5, 1); }
.m-voz:hover { color: var(--ink); border-color: var(--faint); }
.m-voz-ic svg { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.m-voz-eq, .m-voz time, .m-voz-stop { max-width: 0; opacity: 0; overflow: hidden; transition: max-width .38s cubic-bezier(.3, 1.3, .5, 1), opacity .2s; }
.m-voz-eq { display: flex; align-items: center; gap: 2px; height: 16px; }
.m-voz-eq i { width: 3px; height: 6px; border-radius: 2px; background: currentColor; animation: mEq .9s ease-in-out infinite; }
.m-voz-eq i:nth-child(2) { animation-delay: -.2s; } .m-voz-eq i:nth-child(3) { animation-delay: -.45s; } .m-voz-eq i:nth-child(4) { animation-delay: -.1s; } .m-voz-eq i:nth-child(5) { animation-delay: -.35s; }
.m-voz.fala .m-voz-eq i { animation-duration: .42s; }
.m-voz time { font-variant-numeric: tabular-nums; }
.m-voz-stop { width: 10px; height: 10px; border-radius: 2px; background: currentColor; flex: none; }
.m-voz.rec { background: var(--bad); border-color: var(--bad); color: #fff; gap: 8px; padding: 0 12px; }
.m-voz.rec .m-voz-ic { display: none; }
.m-voz.rec .m-voz-eq { max-width: 30px; opacity: 1; } .m-voz.rec time { max-width: 44px; opacity: 1; } .m-voz.rec .m-voz-stop { max-width: 10px; opacity: 1; }
@keyframes mEq { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(2.3); } }

/* ---------- partículas no Início ---------- */
.m-part { position: fixed; top: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .9s; }
.m-part.show { opacity: 1; }
.app { position: relative; z-index: 1; }

/* ---------- acordeão (app do aluno) ---------- */
.acc-w { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.3, .9, .25, 1); }
.acc-w > div { min-height: 0; overflow: hidden; }
.acc.open > .acc-w, .prox-btn.open + .acc-w { grid-template-rows: 1fr; }
.acc-w > div > * { opacity: 0; transform: translateY(-6px); transition: opacity .22s, transform .38s cubic-bezier(.3, 1.3, .5, 1); }
.acc.open > .acc-w > div > *, .prox-btn.open + .acc-w > div > * { opacity: 1; transform: none; transition-delay: .07s; }
.acc .chev, .prox-btn .chev { transition: transform .5s cubic-bezier(.3, 1.6, .45, 1) !important; }

@media (prefers-reduced-motion: reduce) { .m-part { display: none; } }

/* ---------- menu lateral: seleção que desliza e itens que entram com mola ---------- */
.side nav.m-nav { position: relative; }
.side nav.m-nav > .nav-item, .side nav.m-nav > .nav-label { position: relative; z-index: 1; }
.side nav.m-nav .nav-item:hover:not(.on) { background: transparent; }
.m-nav-hl { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 22%, var(--side-2)), var(--side-2) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 28%, transparent);
  transition: transform .42s cubic-bezier(.3, 1.35, .4, 1), height .3s cubic-bezier(.3, 1.35, .4, 1), width .3s, opacity .22s; }
.m-nav-hl.on { opacity: 1; }
.m-nav-hl.m-sem { transition: opacity .22s; }
.side nav.m-nav .nav-item > * { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.side nav.m-nav .nav-item.m-hov:not(.on) > .ico, .side nav.m-nav .nav-item.m-hov:not(.on) > span:not(.badge) { transform: translateX(4px); }
.side nav.m-nav .nav-item.m-hov > .ico { color: var(--gold); }
.app.side-off .side nav.m-nav .nav-item.m-hov > * { transform: none; }
.nav-item.m-nav-in { animation: mNavIn .55s calc(var(--ni, 0) * 45ms + 80ms) cubic-bezier(.3, 1.45, .45, 1) both; }
@keyframes mNavIn { from { opacity: 0; transform: translateX(-14px) scale(.94); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .m-nav-hl { transition: opacity .15s; } .side nav.m-nav .nav-item > * { transition: none; } .nav-item.m-nav-in { animation: none; } }
