.scroll-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0;
  background: rgba(12, 74, 110, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
  animation: scroll-to-top-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.scroll-to-top:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 8px 24px rgba(12, 74, 110, 0.4);
}

.scroll-to-top:active {
  transform: translateY(-2px) scale(1.02);
  transition-duration: 0.1s;
}

.scroll-to-top.idle {
  animation: scroll-to-top-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    scroll-to-top-float 3s ease-in-out 0.5s infinite;
}

@keyframes scroll-to-top-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scroll-to-top-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1);
  }
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}
