/* Mișcare comună pentru toate paginile aplicației: tranziții între pagini, fără clipire albă.
   Mod: html[data-gls-motion="full|reduced|off"], pus de src/client/motion-pref.js din localStorage "gls_motion".
   Doar opacity/transform, doar pe ecran (nu afectează print/PDF). */
@media screen {
  html { background-color: #081322; }

  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
  }
  ::view-transition-old(root) { animation: gls-vt-out .17s ease-in both; }
  ::view-transition-new(root) { animation: gls-vt-in .26s ease-out both; }
  html[data-gls-motion="off"]::view-transition-old(root),
  html[data-gls-motion="off"]::view-transition-new(root),
  html[data-gls-motion="reduced"]::view-transition-old(root),
  html[data-gls-motion="reduced"]::view-transition-new(root) { animation: none; }

  /* Paginile cu sesiune sunt ascunse până la confirmare: conținutul intră lin când apare. */
  html[data-gls-motion="full"].gls-reveal body { animation: gls-page-in .28s ease-out; }

  @keyframes gls-vt-out { to { opacity: 0; transform: translateY(-6px); } }
  @keyframes gls-vt-in { from { opacity: 0; transform: translateY(8px); } }
  @keyframes gls-page-in { from { opacity: 0; } to { opacity: 1; } }

  /* Comutatorul din meniul de cont */
  .gls-motion-setting { padding: 8px 4px 6px; border-top: 1px solid #293d53; margin-top: 6px; }
  .gls-motion-setting > span { display: block; margin-bottom: 6px; color: #9fb4cc; font-size: 12px; }
  .gls-motion-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .gls-account-menu .gls-motion-options button { display: block; margin: 0; padding: 6px 4px; border: 1px solid #293d53; border-radius: 7px; background: #0c1b2d; color: #b4c4d7; font: 600 12px/1.2 Inter, Arial, sans-serif; text-align: center; cursor: pointer; }
  .gls-account-menu .gls-motion-options button[aria-pressed="true"] { background: #7dbdff; border-color: #7dbdff; color: #081322; }

  /* ── Efecte comune (toate paginile) ─────────────────────────────────────── */
  /* 9) Schelet de încărcare: formă gri cu o undă de lumină */
  .gls-skeleton { position: relative; overflow: hidden; border-radius: 6px; background: #1b2f46; }
  html:not([data-gls-motion="off"]) .gls-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(125,189,255,.16), transparent); animation: gls-skeleton 1.3s ease-in-out infinite; }
  @keyframes gls-skeleton { to { transform: translateX(100%); } }

  /* 10) Undă la click pe butoane (src/client/motion-pref.js) */
  .gls-ripple-host { position: relative; overflow: hidden; }
  .gls-ripple-clip { overflow: hidden; }
  .gls-ripple { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,.28); transform: scale(0); animation: gls-ripple .55s ease-out forwards; }
  @keyframes gls-ripple { to { transform: scale(1); opacity: 0; } }

  /* 11) Notificările alunecă din margine și au o bară de timp */
  html[data-gls-motion="full"] :is(.toast-region, .toast-container) .toast { position: relative; overflow: hidden; animation: gls-toast-in .32s cubic-bezier(.2,.75,.25,1) both; }
  html[data-gls-motion="full"] .toast-region .toast::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; opacity: .45;
    transform-origin: 0 50%; animation: gls-toast-time 4.2s linear both; }
  @keyframes gls-toast-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
  @keyframes gls-toast-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }

  /* 12) Câmpurile se aprind în albastru când scrii în ele */
  html:not([data-gls-motion="off"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) { transition: border-color .18s ease, box-shadow .18s ease; }
  html:not([data-gls-motion="off"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea):focus-visible { border-color: #7dbdff; box-shadow: 0 0 0 3px rgba(125,189,255,.2); outline: none; }
}
