/* Uiverse-style CTA — adapted from marcelodolza (namespaced .btn-marc) */

.btn-marc {
  --marc-primary: #ff5569;
  --marc-neutral-1: #f7f8f7;
  --marc-neutral-2: #e7e7e7;
  --marc-radius: 14px;
  --marc-inset-t: 7px;
  --marc-inset-x: 6px;
  --marc-inset-b: 6px;

  cursor: pointer;
  border-radius: var(--marc-radius);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  border: none;
  box-shadow:
    0 0.5px 0.5px 1px rgba(255, 255, 255, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.2),
    0 4px 5px 0 rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 200px;
  padding: 20px;
  height: 68px;
  font-family: 'Poppins', 'Geist', system-ui, sans-serif;
  font-style: normal;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-marc--compact {
  --marc-radius: 12px;
  --marc-inset-t: 5px;
  --marc-inset-x: 5px;
  --marc-inset-b: 4px;
  min-width: min(100%, 220px);
  height: 44px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}

.btn-marc--fill {
  width: 100%;
  min-width: 0;
}

.btn-marc:hover {
  transform: scale(1.02);
  box-shadow:
    0 0 1px 2px rgba(255, 255, 255, 0.28),
    0 15px 30px rgba(0, 0, 0, 0.28),
    0 10px 3px -3px rgba(0, 0, 0, 0.06);
}

.btn-marc:active {
  transform: scale(1);
  box-shadow:
    0 0 1px 2px rgba(255, 255, 255, 0.28),
    0 10px 3px -3px rgba(0, 0, 0, 0.18);
}

.btn-marc:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-marc::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--marc-radius);
  border: 2.5px solid transparent;
  background:
    linear-gradient(var(--marc-neutral-1), var(--marc-neutral-2)) padding-box,
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.42)) border-box;
  z-index: 0;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  pointer-events: none;
}

.btn-marc:hover::after {
  transform: scale(1.05, 1.08);
  box-shadow: inset 0 -1px 3px 0 rgba(255, 255, 255, 1);
}

.btn-marc::before {
  content: '';
  inset: var(--marc-inset-t) var(--marc-inset-x) var(--marc-inset-b) var(--marc-inset-x);
  position: absolute;
  background: linear-gradient(to top, var(--marc-neutral-1), var(--marc-neutral-2));
  border-radius: 30px;
  filter: blur(0.5px);
  z-index: 2;
  pointer-events: none;
}

.btn-marc .state p {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  margin: 0;
  gap: 0;
}

.btn-marc .state .icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  transform: scale(1.25);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.72);
}

.btn-marc .state .icon svg {
  overflow: visible;
}

/* Outline spinner */
.btn-marc .outline {
  position: absolute;
  border-radius: inherit;
  overflow: hidden;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
  inset: -2px -3.5px;
  pointer-events: none;
}

.btn-marc .outline::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: conic-gradient(from 180deg, transparent 60%, white 80%, transparent 100%);
  animation: btn-marc-spin 2s linear infinite;
  animation-play-state: paused;
}

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

.btn-marc:hover .outline {
  opacity: 1;
}

.btn-marc:hover .outline::before {
  animation-play-state: running;
}

/* Letters */
.btn-marc .state p span {
  display: block;
  opacity: 0;
  animation: btn-marc-slide-down 0.8s ease forwards calc(var(--i) * 0.03s);
}

.btn-marc:hover .state p span {
  opacity: 1;
  animation: btn-marc-wave 0.5s ease forwards calc(var(--i) * 0.02s);
}

@keyframes btn-marc-wave {
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
    color: var(--marc-primary);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}

@keyframes btn-marc-slide-down {
  0% {
    opacity: 0;
    transform: translateY(-20px) translateX(5px) rotate(-90deg);
    color: var(--marc-primary);
    filter: blur(5px);
  }
  30% {
    opacity: 1;
    transform: translateY(4px) translateX(0) rotate(0);
    filter: blur(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) translateX(0) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0);
  }
}

/* Plane */
.btn-marc .state--default .icon svg {
  animation: btn-marc-land 0.6s ease forwards;
}

.btn-marc:hover .state--default .icon {
  transform: rotate(45deg) scale(1.25);
}

@keyframes btn-marc-land {
  0% {
    transform: translateX(-60px) translateY(30px) rotate(-50deg) scale(2);
    opacity: 0;
    filter: blur(3px);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0);
    opacity: 1;
    filter: blur(0);
  }
}

/* State layout */
.btn-marc .state {
  padding-left: 29px;
  z-index: 3;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
}

.btn-marc--compact .state {
  padding-left: 26px;
}

.btn-marc .btn-marc-arrow {
  margin-left: 0.12em;
}

.btn-marc-loading {
  position: relative;
  z-index: 4;
  font: inherit;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .btn-marc,
  .btn-marc::after,
  .btn-marc .outline,
  .btn-marc .state p span,
  .btn-marc .state .icon svg {
    animation: none !important;
    transition: none !important;
  }
  .btn-marc .state p span {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .btn-marc:hover {
    transform: none;
  }
}
