/* RMRP Helper — общие анимации для всех страниц */

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes logoGlow {
  0%, 100% { filter: brightness(1.1) drop-shadow(0 0 0 transparent); }
  50% { filter: brightness(1.25) drop-shadow(0 0 12px rgba(230, 57, 57, 0.35)); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(230, 57, 57, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(230, 57, 57, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 57, 57, 0); }
}

@keyframes bgDrift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 1%) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}

body {
  animation: pageFadeIn 0.45s ease-out both;
}

body::before {
  animation: bgDrift 18s ease-in-out infinite;
}

.reg-container,
.onboard .container,
.onboard-card,
.onboard-shell,
.container,
.locked-card {
  animation: fadeInScale 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.logo img,
.reg-logo img {
  animation: logoFloat 3.2s ease-in-out infinite, logoGlow 4s ease-in-out infinite;
}

.sidebar,
.sidebar .nav-item,
.sidebar-profile-card,
.sidebar .logo,
.sidebar-nav-scroll {
  animation: none !important;
}

.menu-item,
.row-card,
.bind-card,
.timer-card,
.note-card {
  animation: fadeInUp 0.5s ease-out both;
}

.menu-item:nth-child(1) { animation-delay: 0.04s; }
.menu-item:nth-child(2) { animation-delay: 0.08s; }
.menu-item:nth-child(3) { animation-delay: 0.12s; }
.menu-item:nth-child(4) { animation-delay: 0.16s; }
.menu-item:nth-child(5) { animation-delay: 0.20s; }
.menu-item:nth-child(6) { animation-delay: 0.24s; }
.menu-item:nth-child(7) { animation-delay: 0.28s; }
.menu-item:nth-child(8) { animation-delay: 0.32s; }

.btn,
button,
.ghost-btn,
.save-btn,
.key-badge.recordable {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover:not(:disabled),
button:hover:not(:disabled),
.ghost-btn:hover,
.save-btn:hover {
  transform: translateY(-2px);
}

.btn:active:not(:disabled),
button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-primary-pulse {
  animation: pulseRing 2.2s ease-out infinite;
}

.status.waiting .spinner,
.spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.panel-enter {
  animation: fadeInUp 0.45s ease-out both;
}

.shimmer-loading {
  background: linear-gradient(90deg, #222 0%, #333 50%, #222 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.qr-wrap canvas,
#qrCanvas {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.qr-wrap:hover canvas,
.qr-wrap:hover #qrCanvas {
  transform: scale(1.03);
  box-shadow: 0 8px 28px rgba(230, 57, 57, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}