/* FAB — dock flutuante de contato */

.fab {
  --fab-size: 3.6rem;
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.fab > * {
  pointer-events: auto;
}

.fab-anchor {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--fab-size);
  height: var(--fab-size);
}

.fab-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fab-panel li {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.fab-action {
  --i: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(10.5rem, calc(100vw - 5.5rem));
  min-height: 3.1rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border-radius: 999px;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--b2) 94%, transparent);
  color: var(--w1);
  border: 1px solid color-mix(in srgb, var(--w2) 14%, transparent);
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--b1) 24%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--w2) 8%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  text-decoration: none;
  font-family: var(--font-sans);
  line-height: 1.15;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0.85rem, 0.65rem, 0) scale(0.92);
  transform-origin: bottom right;
  transition:
    opacity 0.28s var(--reveal-ease),
    transform 0.38s var(--reveal-ease),
    visibility 0.28s,
    background-color 0.25s ease,
    border-color 0.25s ease;
  transition-delay: 0s;
}

.fab-action-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}

.fab-action-copy strong {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.fab-action-copy span {
  font-size: 0.7rem;
  font-weight: 300;
  color: color-mix(in srgb, var(--w1) 62%, transparent);
  line-height: 1.2;
}

.fab-action-icon {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--w2) 12%, transparent);
  line-height: 0;
}

.fab-action-icon img {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}

.fab-action-icon img[src*="link.svg"] {
  width: 100%;
  height: 100%;
}

.fab-action:hover,
.fab-action:focus-visible {
  background: var(--b1);
  border-color: color-mix(in srgb, var(--p1) 50%, transparent);
  outline: none;
}

.fab.is-open .fab-action {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  transition-delay: calc(0.04s + var(--i) * 0.05s);
}

.fab-trigger {
  position: relative;
  width: var(--fab-size);
  height: var(--fab-size);
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 1.35rem;
  background: var(--p1);
  color: var(--p5);
  box-shadow:
    0 10px 28px color-mix(in srgb, var(--b1) 22%, transparent),
    0 0 0 0 color-mix(in srgb, var(--p1) 45%, transparent),
    0 2px 0 color-mix(in srgb, var(--w2) 35%, transparent) inset;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: visible;
  animation: fab-attention 3.4s var(--anim-ease) infinite;
  transition:
    transform 0.35s var(--anim-ease),
    background-color 0.3s ease,
    border-radius 0.35s var(--anim-ease),
    box-shadow 0.3s ease;
}

.fab-trigger::before,
.fab-trigger::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: calc(1.35rem + 5px);
  border: 1.5px solid color-mix(in srgb, var(--p1) 70%, transparent);
  pointer-events: none;
}

.fab-trigger::before {
  animation: fab-ring 2.4s var(--anim-ease) infinite;
}

.fab-trigger::after {
  inset: -14px;
  border-radius: calc(1.35rem + 10px);
  border-color: color-mix(in srgb, var(--p1) 35%, transparent);
  animation: fab-ring 2.4s var(--anim-ease) 0.55s infinite;
}

.fab-trigger-star,
.fab-trigger-close {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition:
    opacity 0.25s ease,
    transform 0.4s var(--reveal-ease);
}

.fab-trigger-star img {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  animation: fab-spin 8s linear infinite;
}

.fab-trigger-close {
  width: auto;
  height: auto;
  opacity: 0;
  transform: rotate(-45deg) scale(0.7);
}

.fab-trigger-close::before,
.fab-trigger-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.1rem;
  height: 2px;
  margin: -1px 0 0 -0.55rem;
  border-radius: 2px;
  background: var(--p5);
}

.fab-trigger-close::before {
  transform: rotate(45deg);
}

.fab-trigger-close::after {
  transform: rotate(-45deg);
}

.fab-trigger:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--b1) 26%, transparent),
    0 2px 0 color-mix(in srgb, var(--w2) 40%, transparent) inset;
}

.fab-trigger:focus-visible {
  outline: 2px solid var(--b2);
  outline-offset: 4px;
}

.fab.is-open .fab-trigger {
  background: var(--b2);
  border-radius: 1.1rem;
  transform: rotate(90deg);
  animation: none;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--b1) 30%, transparent);
}

.fab.is-open .fab-trigger::before,
.fab.is-open .fab-trigger::after {
  animation: none;
  opacity: 0;
}

.fab.is-open .fab-trigger-star {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.fab.is-open .fab-trigger-star img {
  animation: none;
}

.fab.is-open .fab-trigger-close {
  opacity: 1;
  transform: rotate(-90deg) scale(1);
}

.fab.is-open .fab-trigger-close::before,
.fab.is-open .fab-trigger-close::after {
  background: var(--p1);
}

.fab-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  z-index: 2;
  box-sizing: border-box;
  width: 1.2rem;
  height: 1.2rem;
  min-width: 1.2rem;
  padding: 0;
  border-radius: 999px;
  background: var(--b2);
  color: var(--p1);
  border: 2px solid var(--w1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--b1) 25%, transparent);
  pointer-events: none;
  transform-origin: center;
  animation: fab-badge-pop 2.8s var(--anim-ease) infinite;
}

.fab.is-open .fab-badge {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

.fab-hint {
  position: absolute;
  right: calc(100% + 0.7rem);
  top: 50%;
  transform: translateY(-50%) translateX(0.35rem);
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--b2);
  color: var(--w1);
  font-family: var(--font-condensed);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--b1) 22%, transparent);
  transition:
    opacity 0.25s ease,
    transform 0.3s var(--reveal-ease),
    visibility 0.25s;
}

.fab-hint::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--b2);
  transform: translateY(-50%) rotate(45deg);
}

@media (hover: hover) and (pointer: fine) {
  .fab:not(.is-open) .fab-anchor:hover .fab-hint,
  .fab:not(.is-open) .fab-trigger:focus-visible ~ .fab-hint {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes fab-ring {
  0% {
    transform: scale(0.92);
    opacity: 0.75;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

@keyframes fab-attention {
  0%,
  70%,
  100% {
    transform: translateY(0) scale(1);
  }
  78% {
    transform: translateY(-3px) scale(1.04);
  }
  86% {
    transform: translateY(0) scale(1);
  }
  92% {
    transform: translateY(-2px) scale(1.02);
  }
}

@keyframes fab-badge-pop {
  0%,
  70%,
  100% {
    transform: scale(1);
  }
  78% {
    transform: scale(1.12);
  }
  86% {
    transform: scale(1);
  }
}

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

@keyframes fab-mobile-label {
  0%,
  18%,
  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(0.4rem);
  }
  25%,
  55% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  65% {
    opacity: 0;
    transform: translateY(-50%) translateX(0.2rem);
  }
}

@media (max-width: 600px) {
  .fab {
    --fab-size: 3.35rem;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .fab-action {
    min-height: 2.9rem;
    padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  }

  .fab-action-icon {
    width: 2rem;
    height: 2rem;
  }

  .fab:not(.is-open) .fab-hint {
    display: block;
    opacity: 0;
    visibility: visible;
    animation: fab-mobile-label 7s var(--anim-ease) 1.2s infinite;
  }

  .fab.is-open .fab-hint {
    display: none;
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fab-trigger,
  .fab-trigger::before,
  .fab-trigger::after,
  .fab-trigger-star img,
  .fab-badge,
  .fab-action,
  .fab-hint {
    animation: none !important;
    transition: none !important;
  }

  .fab.is-open .fab-action {
    transform: none;
  }

  .fab:not(.is-open) .fab-hint {
    animation: none !important;
    opacity: 0 !important;
  }
}

html.a11y-reduce-motion .fab-trigger,
html.a11y-reduce-motion .fab-trigger::before,
html.a11y-reduce-motion .fab-trigger::after,
html.a11y-reduce-motion .fab-trigger-star img,
html.a11y-reduce-motion .fab-badge {
  animation: none !important;
}

html.a11y-contrast .fab-trigger {
  background: #ffff00;
  color: #000;
  border: 2px solid #000;
}

html.a11y-contrast .fab-action {
  background: #000;
  color: #fff;
  border: 2px solid #fff;
}

html.a11y-contrast .fab-badge {
  background: #000;
  color: #ffff00;
  border-color: #000;
}
