/*
 * Back to Top — drop-in scroll-to-top button.
 *
 * Bottom-LEFT (clears the contact-fab on the right). Theme-aware.
 * See /back-to-top/README.md.
 */

.aed-btt {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 7600; /* above social-proof, below contact-fab panel + consent */
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card, #18181b);
  color: var(--text-secondary, #a1a1aa);
  border: 1px solid var(--border, #27272a);
  border-radius: 50%;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.95);
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.aed-btt.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.aed-btt:hover {
  color: var(--accent, #6B00FF);
  border-color: var(--accent, #6B00FF);
  background: color-mix(in srgb, var(--accent, #6B00FF) 8%, var(--bg-card, #18181b));
}
.aed-btt svg { width: 18px; height: 18px; }

/* Slide up out of the way of the consent banner */
body:has(.consent-banner.is-open) .aed-btt {
  transform: translateY(-86px);
}
body:has(.consent-banner.is-open) .aed-btt.is-visible {
  transform: translateY(-86px);
}

/* Hide on mobile if the lead-bar is active (full-width strip would overlap) */
@media (max-width: 640px) {
  body.aed-leadbar-active .aed-btt { display: none !important; }
  .aed-btt { left: 1rem; bottom: 1rem; width: 40px; height: 40px; }
}

/* Hide on mobile if social-proof toast is at the same edge */
@media (max-width: 640px) {
  body:has(.aed-sp-toast.is-open) .aed-btt {
    transform: translateY(-72px);
  }
  body:has(.aed-sp-toast.is-open) .aed-btt.is-visible {
    transform: translateY(-72px);
  }
}

@media print {
  .aed-btt { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .aed-btt { transition: opacity 0.18s ease; transform: none !important; }
  body:has(.consent-banner.is-open) .aed-btt,
  body:has(.consent-banner.is-open) .aed-btt.is-visible { transform: none !important; }
}
