/* === MOTION-ALL shared motion core: web/motion.css ===
   One motion family for every page of nawtt.qa: the public pages (P1), the sign-in family (P2) and the app
   shell (P3). Link this file from every page's <head> after the page's own stylesheets and before any script.
   What it gives every page: "move into place" on load (translate 36-48 px + opacity, ease-out 500-650 ms,
   staggered), a scroll-reveal variant, and a hover/press feel (cards lift 5-6 px, buttons 1.03 hover / 0.96
   press, pointer-fine only). Only transform and opacity are animated, space is reserved, no layout shift.
   Gates: the hidden start states exist only under `html.js` (public.js / the page's JS adds it), so with
   JavaScript off every word is visible at once. Load-entrance needs no JS at all besides that class.
   Scroll reveals need the page's IntersectionObserver to add `.is-in` (the public pages' public.js already
   does this); no rAF loop, no setInterval, no scroll listener, no canvas, no external resource.
   Reduced motion: the last section turns every animation/transition off and keeps the content visible.
   Public pages: motion.css is the 5th and last request (html, public.css, public.js, motion.css, favicon).
   Keyframes: mo-rise (move into place), mo-pop (soft spring scale). Hooks and timing table: README.md.
   Page-family blocks (P2/P3) are appended by the merger after the marker at the very end of this file. */
:root {
  --mo-travel: 44px;        
  --mo-travel-sm: 24px;     
  --mo-dur: 600ms;          
  --mo-dur-fast: 200ms;     
  --mo-stagger: 150ms;
  --mo-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mo-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mo-rise {
  from { opacity: 0; transform: translate3d(0, var(--mo-travel, 44px), 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes mo-pop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.js .mo-rise { animation: mo-rise var(--mo-dur) var(--mo-ease) var(--mo-delay, 0ms) both; }
.js .mo-pop { animation: mo-pop var(--mo-dur) var(--mo-spring) var(--mo-delay, 0ms) both; }

.js .mo-stagger > :nth-child(1) { --mo-delay: 0ms; }
.js .mo-stagger > :nth-child(2) { --mo-delay: calc(var(--mo-stagger) * 1); }
.js .mo-stagger > :nth-child(3) { --mo-delay: calc(var(--mo-stagger) * 2); }
.js .mo-stagger > :nth-child(4) { --mo-delay: calc(var(--mo-stagger) * 3); }
.js .mo-stagger > :nth-child(5) { --mo-delay: calc(var(--mo-stagger) * 4); }
.js .mo-stagger > :nth-child(6) { --mo-delay: calc(var(--mo-stagger) * 5); }
.js .mo-stagger > :nth-child(7) { --mo-delay: calc(var(--mo-stagger) * 6); }
.js .mo-stagger > :nth-child(8) { --mo-delay: calc(var(--mo-stagger) * 7); }

.mo-view { transition: opacity var(--mo-dur) var(--mo-ease), transform var(--mo-dur) var(--mo-ease); }
.js .mo-view:not(.is-in) {
  opacity: 0; transform: translate3d(0, var(--mo-travel, 44px), 0); transition: none;
}
.js .mo-view.is-in { opacity: 1; transform: translate3d(0, 0, 0); transition-delay: var(--mo-delay, 0ms); }

@media (hover: hover) and (pointer: fine) {
  .mo-hover { transform-origin: center; transition: transform var(--mo-dur-fast) var(--mo-ease); }
  .mo-hover:hover { transform: translate3d(0, -6px, 0); }
  .mo-hover:active { transform: translate3d(0, -1px, 0); }
  .btn, .mo-btn { transform-origin: center; transition: transform 180ms var(--mo-ease); }
  .btn:hover, .mo-btn:hover { transform: scale(1.03); }
  .btn:active, .mo-btn:active { transform: scale(0.96); transition-duration: 150ms; }
  :is(.card, .cards > .card, .for > *, .audience > *) {
    transform-origin: center; transition: transform var(--mo-dur-fast) var(--mo-ease);
  }
  :is(.card, .cards > .card, .for > *, .audience > *):hover {
    transform: translate3d(0, -6px, 0); transition-delay: 0ms;
  }
  :is(.card, .cards > .card, .for > *, .audience > *):active {
    transform: translate3d(0, -1px, 0); transition-delay: 0ms;
  }
}

.js .hero h1, .js .hero .hero__title {
  animation: mo-rise 580ms var(--mo-ease) 0ms both;
}
.js .hero .lede, .js .hero .hero__lede, .js .hero .hero__lead {
  animation: mo-rise 580ms var(--mo-ease) 150ms both;
}
.js .hero .coming-soon, .js .hero .badge {
  animation: mo-pop 560ms var(--mo-spring) 300ms both;
}
.js .hero .hero__actions {
  animation: mo-rise 580ms var(--mo-ease) 450ms both;
}

:is(.steps > .step, .cards > .card, .for > *, .audience > *) {
  transition: opacity 420ms ease-out, transform 580ms var(--mo-ease);
}
.js :is(.steps > .step, .cards > .card, .for > *, .audience > *):not(.is-in) {
  opacity: 0; transform: translate3d(0, var(--mo-travel), 0); transition: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto !important; }
  .js .mo-view:not(.is-in),
  .js :is(.steps > .step, .cards > .card, .for > *, .audience > *):not(.is-in),
  .js .steps > li::before, .js .steps > .step::before, .js .step__num {
    opacity: 1 !important; transform: none !important;
  }
  .hero::before, .hero::after { transform: none !important; }
}

/* ===== page-family blocks appended below (P2 sign-in family, P3 app shell) =====
   Merger: append the P2/P3 blocks AFTER this line. Each block may use the core keyframes (mo-rise, mo-pop),
   the custom properties (--mo-travel, --mo-dur, --mo-stagger, --mo-ease, --mo-spring) and the core classes
   (.mo-rise, .mo-pop, .mo-stagger, .mo-view, .mo-hover, .mo-btn). Each block MUST end with its own
   `@media (prefers-reduced-motion: reduce)` that shows every element it hides (the core's global
   `* { animation: none !important; transition: none !important }` already stops all motion). */

/* === MOTION-ALL piece P2: sign-in family (login, forgot, reset, password, offline) === */

@keyframes p2-card-in { from { transform: translate3d(0, 40px, 0); } to { transform: none; } }
@keyframes p2-rise { from { opacity: 0; transform: translate3d(0, 36px, 0); } to { opacity: 1; transform: none; } }
@keyframes p2-msg-in { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }

body.login .login-card, body.forgot .login-card, body.reset .login-card {
  animation: p2-card-in 560ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
body.login .login-card__head, body.forgot .login-card__head, body.reset .login-card__head {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 180ms backwards;
}
body.login .pg-form > .field:nth-of-type(1), body.forgot .pg-form > .field:nth-of-type(1),
body.reset .pg-form > .field:nth-of-type(1) {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 260ms backwards;
}
body.login .pg-form > .field:nth-of-type(2), body.reset .pg-form > .field:nth-of-type(2) {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 330ms backwards;
}
body.reset .pg-form > .field:nth-of-type(3) {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 400ms backwards;
}
body.login .pg-form > .btn, body.forgot .pg-form > .btn, body.reset .pg-form > .btn {
  animation: p2-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) 400ms backwards;
}
body.login .login-card > .login-card__foot:nth-of-type(1), body.forgot .login-card > .login-card__foot,
body.reset .login-card > .login-card__foot {
  animation: p2-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) 470ms backwards;
}
body.login .login-card > .login-card__foot:nth-of-type(2) {
  animation: p2-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) 540ms backwards;
}

body.password .page-head { animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 80ms backwards; }
body.password .card { animation: p2-card-in 560ms cubic-bezier(0.22, 1, 0.36, 1) 160ms backwards; }
body.password .card .pg-form > .field:nth-of-type(1) {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 260ms backwards;
}
body.password .card .pg-form > .field:nth-of-type(2) {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 330ms backwards;
}
body.password .card .pg-form > .field:nth-of-type(3) {
  animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 400ms backwards;
}
body.password .card .pg-row { animation: p2-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) 470ms backwards; }

body.offline .card { animation: p2-card-in 560ms cubic-bezier(0.22, 1, 0.36, 1) backwards; }
body.offline .card__head { animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 180ms backwards; }
body.offline .card__body > p:nth-of-type(1) { animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 260ms backwards; }
body.offline .card__body > p:nth-of-type(2) { animation: p2-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) 330ms backwards; }
body.offline .card__body > .btn { animation: p2-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) 400ms backwards; }

body.login .alert-slot:not([hidden]), body.forgot .alert-slot:not([hidden]),
body.reset .alert-slot:not([hidden]), body.password .alert-slot:not([hidden]) {
  animation: p2-msg-in 280ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
body.reset #resetInvalid:not([hidden]) .alert {
  animation: p2-msg-in 280ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
body.reset #resetInvalid:not([hidden]) .pg-row { animation: p2-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) 180ms backwards; }

@media (hover: hover) and (pointer: fine) {
  body.login .btn:not([disabled]), body.forgot .btn:not([disabled]), body.reset .btn:not([disabled]),
  body.password .btn:not([disabled]), body.offline .btn:not([disabled]) {
    transform-origin: center; transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.login .btn:not([disabled]):hover, body.forgot .btn:not([disabled]):hover,
  body.reset .btn:not([disabled]):hover, body.password .btn:not([disabled]):hover,
  body.offline .btn:not([disabled]):hover { transform: scale(1.03); }
  body.login .btn:not([disabled]):active, body.forgot .btn:not([disabled]):active,
  body.reset .btn:not([disabled]):active, body.password .btn:not([disabled]):active,
  body.offline .btn:not([disabled]):active { transform: scale(0.96); transition-duration: 150ms; }
}

@media (prefers-reduced-motion: reduce) {
  body.login *, body.forgot *, body.reset *, body.password *, body.offline *,
  body.login *::before, body.forgot *::before, body.reset *::before, body.password *::before,
  body.offline *::before, body.login *::after, body.forgot *::after, body.reset *::after,
  body.password *::after, body.offline *::after {
    animation: none !important;
    transition: none !important;
  }
  body.login .btn[disabled], body.forgot .btn[disabled], body.reset .btn[disabled],
  body.password .btn[disabled], body.offline .btn[disabled],
  body.login .btn:not([disabled]):hover, body.forgot .btn:not([disabled]):hover,
  body.reset .btn:not([disabled]):hover, body.password .btn:not([disabled]):hover,
  body.offline .btn:not([disabled]):hover,
  body.login .btn:not([disabled]):active, body.forgot .btn:not([disabled]):active,
  body.reset .btn:not([disabled]):active, body.password .btn:not([disabled]):active,
  body.offline .btn:not([disabled]):active { transform: none !important; }
}
/* end === */

/* === MOTION-ALL P3: app shell (cards/summary strips, dialogs, toasts, one new row) === */

body.app.app-motion .motion-item {
  transition: opacity 440ms ease-out, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
body.app.app-motion .motion-item:not(.is-in) {
  opacity: 0;
  transform: translate3d(0, 1.875rem, 0);   
  transition: none;                         
}

body.app.app-motion .panel-enter { animation: none; }

@keyframes app-row-in {
  from { opacity: 0; transform: translate3d(0, -0.75rem, 0); }   
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

body.app.app-motion tr.row-in > td {
  animation: app-row-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top center;
}

@keyframes app-dialog-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
body.app.app-motion dialog.confirm[open],
body.app.app-motion dialog.sheet[open] {
  animation: app-dialog-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes app-toast-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
body.app.app-motion .toast { animation: app-toast-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both; }
body.app.app-motion .toast.is-leaving { animation: toast-out 220ms ease both; }

@media (prefers-reduced-motion: reduce) {
  body.app .motion-item,
  body.app tr.row-in > td,
  body.app dialog.confirm[open],
  body.app dialog.sheet[open],
  body.app .toast {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
/* end === */
