.wh-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wh-space-xs, 8px);
  min-height: var(--wh-touch-min, 44px);
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--wh-radius-btn, 18px);
  box-sizing: border-box;
  appearance: none;
  font-family: var(--wh-ff, Pretendard, -apple-system, sans-serif);
  font-size: var(--wh-text-base, 1rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--wh-tracking-body, -0.02em);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--wh-motion-state, 180ms) var(--wh-ease-spring, cubic-bezier(0.34, 1.28, 0.64, 1)),
    background-color var(--wh-motion-hover, 120ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    border-color var(--wh-motion-hover, 120ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    color var(--wh-motion-hover, 120ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1)),
    opacity var(--wh-motion-state, 180ms) var(--wh-ease-out-smooth, cubic-bezier(0.16, 1, 0.3, 1));
}

.wh-btn--primary {
  border-color: var(--wh-brand, #681dc7);
  background: var(--wh-brand, #681dc7);
  color: #fff;
}

.wh-btn--secondary,
.wh-btn--ghost {
  border-color: var(--wh-bd, rgba(0, 0, 0, 0.06));
  background: var(--wh-card, #fff);
  color: var(--wh-tx, #1A1A1A);
}

.wh-btn--accent {
  border-color: var(--wh-info-bd, #d9ccf0);
  background: var(--wh-brand-tint, #f3eefa);
  color: var(--wh-brand, #681dc7);
}

.wh-btn--link {
  min-height: var(--wh-touch-min, 44px);
  padding-inline: var(--wh-space-xs, 8px);
  border-color: transparent;
  background: transparent;
  color: var(--wh-link, #0066CC);
}

.wh-btn--lg {
  min-height: var(--wh-touch-cta, 48px);
  padding: 14px 24px;
  font-size: var(--wh-text-lg, 1.0625rem);
}

.wh-btn--md {
  min-height: var(--wh-touch-min, 44px);
  padding: 12px 20px;
  font-size: var(--wh-text-base, 1rem);
}

.wh-btn--sm {
  min-height: var(--wh-touch-min, 44px);
  padding: 8px 16px;
  font-size: var(--wh-text-sm, 0.875rem);
}

@media (hover: hover) and (pointer: fine) {
  .wh-btn--primary:hover {
    border-color: var(--wh-brand-hover, #5416a3);
    background: var(--wh-brand-hover, #5416a3);
    color: #fff;
  }

  .wh-btn--secondary:hover,
  .wh-btn--ghost:hover {
    background: var(--wh-bg, #F5F5F5);
    color: var(--wh-tx, #1A1A1A);
  }

  .wh-btn--accent:hover {
    background: #ebe3f8;
    color: var(--wh-brand, #681dc7);
  }

  .wh-btn--link:hover {
    color: var(--wh-link, #0066CC);
    background: var(--wh-surface, #f4f5f7);
  }
}

.wh-btn:hover,
.wh-btn:focus,
.wh-btn:active {
  text-decoration: none;
}

.wh-btn:focus-visible {
  outline: 2px solid var(--wh-focus-ring, #681dc7);
  outline-offset: 2px;
}

.wh-btn:active:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) {
  transform: scale(var(--wh-scale-press, 0.96));
  transition-timing-function: var(--wh-ease-press, cubic-bezier(0.4, 0, 0.2, 1));
}

.wh-btn:disabled,
.wh-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.wh-btn:disabled {
  pointer-events: none;
}

.wh-btn[aria-busy="true"],
.wh-btn--loading {
  opacity: 0.85;
  cursor: progress;
  pointer-events: none;
}

.wh-btn[aria-busy="true"]::after,
.wh-btn--loading::after {
  content: "";
  width: 1em;
  height: 1em;
  flex: 0 0 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.8;
  animation: wh-btn-spin 700ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .wh-btn,
  .wh-btn:active,
  .wh-btn[aria-busy="true"]::after,
  .wh-btn--loading::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

html.wh-reduce-motion .wh-btn,
html.wh-reduce-motion .wh-btn:active,
html.wh-reduce-motion .wh-btn[aria-busy="true"]::after,
html.wh-reduce-motion .wh-btn--loading::after {
  transition: none !important;
  animation: none !important;
  transform: none !important;
}
