/* =====================================================================
   FinPal — login → dashboard handoff
   Loaded by login.php and index.php ONLY. Cross-document view
   transitions need both the departing and the arriving document to
   opt in, so this file is the opt-in switch: a page that does not load
   it keeps plain instant navigation (dashboard → budget, report, etc).
   ===================================================================== */

/* The auth sheet lifts away and the dashboard is simply revealed under it.
   The new root gets no animation on purpose: the widgets already assemble
   themselves with .db-reveal, and a page-level rise on top of that would
   play the same motion twice. */
@keyframes hf-leave {
  to {
    transform: translateY(-7%) scale(1.03);
    opacity: 0;
  }
}

::view-transition-old(root) {
  animation: hf-leave 220ms cubic-bezier(.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  /* Both roots are neutralised together, otherwise the surviving UA
     crossfade keeps a motion that was just asked to go away. */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
    opacity: 1;
  }
}
