/* ===== CTA Button Component ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border-style: solid;
  background: transparent;
  cursor: pointer;
  text-decoration: none !important;
  font-family: inherit;
  line-height: var(--type-primary-button-line-height);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}


/* --- Primary Large (cyan, 240 × 56) --- */

.btn--primary-large {
  position: relative;
  height: 56px;
  padding: 16px 24px;
  border: 3px solid transparent;
  background: transparent;
  color: var(--color-neutral-200);
  font-size: var(--type-primary-button-font-size);
  font-weight: var(--type-primary-button-font-weight);
  letter-spacing: var(--type-primary-button-letter-spacing);
  z-index: 1;
}

@media (min-width: 1024px) {
  .btn--primary-large {
    min-width: 240px;
  }
}

.btn--primary-large::before {
  content: "";
  position: absolute;
  inset: -3px; /* Match border width */
  padding: 3px; /* Match border width */
  border-radius: 999px;
  background: var(--gradient-brand);
  background-size: 100%;
  background-position: left center;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
  transition: background-position 0.4s ease-in-out;
  will-change: background-position;
}

.btn--primary-large::after {
  content: "";
  position: absolute;
  inset: -1px; /* Slightly negative to fill 1px gap with border */
  border-radius: 999px;
  background: var(--gradient-brand);
  background-size: 100%;
  background-position: left center;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease, background-position 0.4s ease-in-out;
  will-change: opacity, background-position;
}

.btn--primary-large:hover,
.btn--primary-large:active {
  background: transparent;
  color: var(--color-white);
}

.btn--primary-large:hover::before,
.btn--primary-large:active::before {
  background-position: right center;
}

.btn--primary-large:hover::after,
.btn--primary-large:active::after {
  opacity: 1;
  background-position: right center;
}

.btn--primary-large:focus-visible {
  background: var(--color-surface-2);
  border-color: var(--color-neon-blue);
  box-shadow: 0 4px 10px var(--color-focus-shadow-blue);
  outline: 1.5px solid var(--color-focus-outline-blue);
  outline-offset: 8px;
  color: var(--color-white);
}

.btn--primary-large.btn--disabled {
  border-color: var(--color-disabled);
  color: var(--color-disabled);
  cursor: not-allowed;
  pointer-events: none;
}


/* --- Primary Small (cyan, 160 × 48) --- */

.btn--primary-small {
  position: relative;
  height: 48px;
  padding: 16px 24px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--color-neutral-200);
  font-size: var(--type-button-text-font-size);
  font-weight: var(--type-button-text-font-weight);
  letter-spacing: var(--type-button-text-letter-spacing);
  z-index: 1;
}

.btn--primary-small::before {
  content: "";
  position: absolute;
  inset: -1.5px; /* Match border width */
  padding: 1.5px; /* Match border width */
  border-radius: 999px;
  background: var(--gradient-brand);
  background-size: 200% 100%;
  background-position: left center;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
  transition: background-position 0.4s ease-in-out;
  will-change: background-position;
}

.btn--primary-small::after {
  content: "";
  position: absolute;
  inset: -1px; /* Slightly negative to fill 1px gap with border */
  border-radius: 999px;
  background: var(--gradient-brand);
  background-size: 200% 100%;
  background-position: left center;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease, background-position 0.4s ease-in-out;
  will-change: opacity, background-position;
}

.btn--primary-small:hover,
.btn--primary-small:active {
  background: transparent;
  color: var(--color-white);
}

.btn--primary-small:hover::before,
.btn--primary-small:active::before {
  background-position: right center;
}

.btn--primary-small:hover::after,
.btn--primary-small:active::after {
  opacity: 1;
  background-position: right center;
}

.btn--primary-small:focus-visible {
  background: var(--color-surface-2);
  border-color: var(--color-neon-blue);
  box-shadow: 0 4px 10px var(--color-focus-shadow-blue);
  outline: 1.5px solid var(--color-focus-outline-blue);
  outline-offset: 8px;
  color: var(--color-white);
}

.btn--primary-small.btn--disabled {
  border-color: var(--color-disabled);
  color: var(--color-disabled);
  cursor: not-allowed;
  pointer-events: none;
}


/* --- Primary Medium (purple, 180 × 52, with arrow) --- */

.btn--primary-medium {
  position: relative;
  height: 52px;
  padding: 16px 24px;
  border: 1px solid var(--color-purple);
  color: var(--color-neutral-200);
  font-size: var(--type-button-text-font-size);
  font-weight: var(--type-button-text-font-weight);
  letter-spacing: var(--type-button-text-letter-spacing);
  z-index: 1;
}

.btn--primary-medium::before {
  content: "";
  position: absolute;
  inset: -1px; /* Match border width */
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-neon-pink) 0%, var(--color-base-bg) 100%);
  background-size: 200% 100%;
  background-position: left center;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease, background-position 0.4s ease-in-out;
  will-change: opacity, background-position;
}

.btn--primary-medium:hover,
.btn--primary-medium:active {
  background: transparent;
  border-color: transparent;
  color: var(--color-white);
}

.btn--primary-medium:hover::before,
.btn--primary-medium:active::before {
  opacity: 1;
  background-position: right center;
}

.btn--primary-medium:focus-visible {
  background: var(--color-surface-3);
  border-color: var(--color-focus-border-medium);
  outline: 1.5px solid var(--color-focus-outline-medium);
  outline-offset: 8px;
  color: var(--color-white);
}

.btn--primary-medium.btn--disabled {
  border-color: var(--color-neutral-200);
  color: var(--color-neutral-200);
  cursor: not-allowed;
  pointer-events: none;
}


/* --- Secondary (blue, auto-width × 48) --- */

.btn--secondary {
  position: relative;
  height: 48px;
  padding: 16px 24px;
  border: 1.5px solid var(--color-button-blue);
  color: var(--color-neutral-200);
  font-size: var(--type-button-text-font-size);
  font-weight: var(--type-button-text-font-weight);
  letter-spacing: var(--type-button-text-letter-spacing);
  z-index: 1;
}

.btn--secondary::before {
  content: "";
  position: absolute;
  inset: -1.5px; /* Match border width */
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-button-blue) 0%, var(--color-base-bg) 100%);
  background-size: 200% 100%;
  background-position: left center;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease, background-position 0.4s ease-in-out;
  will-change: opacity, background-position;
}

.btn--secondary:hover,
.btn--secondary:active {
  background: transparent;
  border-color: transparent;
  color: var(--color-white);
}

.btn--secondary:hover::before,
.btn--secondary:active::before {
  opacity: 1;
  background-position: right center;
}

.btn--secondary:focus-visible {
  background: var(--color-surface-2);
  border-color: var(--color-button-blue);
  box-shadow: 0 4px 10px var(--color-focus-shadow-blue);
  outline: 1.5px solid var(--color-focus-outline-blue);
  outline-offset: 8px;
  color: var(--color-white);
}

.btn--secondary.btn--disabled {
  border-color: var(--color-disabled);
  color: var(--color-disabled);
  cursor: not-allowed;
  pointer-events: none;
}
