/* ==========================================================================
   components/button.css — Button Variants
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: var(--transition-base);
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(.97);
}
.btn:disabled,
.btn.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn i {
  font-size: 1.05em;
  line-height: 1;
}

/* ---------- Primary ---------- */
.btn-primary {
  background: var(--color-green-main);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-green-deep);
  box-shadow: var(--shadow-green);
}

/* ---------- Secondary ---------- */
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-dark);
}
.btn-secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
}

/* ---------- Danger ---------- */
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220,38,38,.25);
}

/* ---------- Ghost ---------- */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* ---------- Gold ---------- */
.btn-gold {
  background: var(--color-gold-main);
  color: #fff;
}
.btn-gold:hover {
  background: var(--color-gold-dark);
  box-shadow: var(--shadow-gold);
}
.btn-gold:focus-visible {
  animation: pulse-gold 1s ease;
  outline: none;
}

/* ---------- Sizes ---------- */
.btn-sm {
  padding: 6px 11px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  gap: var(--space-1);
}
.btn-lg {
  padding: 12px 22px;
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

/* ---------- Icon Only ---------- */
.btn-icon {
  padding: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
}
.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}
.btn-icon.btn-lg {
  width: 42px;
  height: 42px;
}

/* ---------- Block ---------- */
.btn-block {
  width: 100%;
}

/* ---------- Loading State ---------- */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  animation: spin .6s linear infinite;
}
.btn-secondary.btn-loading::after,
.btn-ghost.btn-loading::after {
  border-color: rgba(45,106,79,.3);
  border-top-color: var(--color-green-main);
}
