/**
 * JC — Back to top
 * Componente global, isolado e sem dependências.
 */
.jc-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9997;

  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;

  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 8px, 0);
  pointer-events: none;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background-color 180ms ease,
    visibility 0s linear 180ms;
}

.jc-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  transition-delay: 0s;
}

.jc-back-to-top svg {
  display: block;
  inline-size: 18px;
  block-size: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .jc-back-to-top:hover {
    background: #000;
    transform: translate3d(0, -2px, 0);
  }
}

.jc-back-to-top:active {
  transform: translate3d(0, 0, 0) scale(0.96);
}

.jc-back-to-top:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .jc-back-to-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    inline-size: 42px;
    block-size: 42px;
  }

  .jc-back-to-top svg {
    inline-size: 17px;
    block-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jc-back-to-top,
  .jc-back-to-top.is-visible,
  .jc-back-to-top:hover,
  .jc-back-to-top:active {
    transition: none;
  }
}

@media print {
  .jc-back-to-top {
    display: none !important;
  }
}
