:root {
  --btn-radius: 12px;
  --btn-pad-y: 10px;
  --btn-pad-x: 14px;
  --btn-font-size: 14px;
  --btn-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
  --btn-shadow-hover: 0 14px 30px rgba(0, 0, 0, 0.18);
  --btn-shadow-press: 0 6px 14px rgba(0, 0, 0, 0.14);
  --btn-ring: 0 0 0 4px rgba(var(--app-accent-rgb, 249 115 22), 0.26);
}

/* Base button style (inspired by modern SaaS UI patterns: Stripe/Linear-like) */
.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--btn-radius);
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.90);
  color: #111827;
  font-size: var(--btn-font-size);
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    filter 140ms ease,
    opacity 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--btn-shadow-press);
}

.btn:focus-visible {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: var(--btn-shadow), var(--btn-ring);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  /* Keep primary actions highly readable without painting the whole UI in the accent color. */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.00) 60%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(3, 7, 18, 0.98) 100%);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    0 14px 32px rgba(var(--app-accent-rgb, 249 115 22), 0.14);
}

.btn-primary:hover {
  filter: contrast(1.02);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.34),
    0 18px 42px rgba(var(--app-accent-rgb, 249 115 22), 0.16);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.94) 0%, rgba(241, 245, 249, 0.94) 100%);
  color: #111827;
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.14);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 24px rgba(185, 28, 28, 0.22);
}

.btn-danger:hover {
  filter: saturate(1.05);
  box-shadow: 0 16px 34px rgba(185, 28, 28, 0.26);
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.65);
  box-shadow: none;
}

.btn-sm {
  --btn-pad-y: 8px;
  --btn-pad-x: 12px;
  --btn-font-size: 13px;
}

.btn-lg {
  --btn-pad-y: 14px;
  --btn-pad-x: 18px;
  --btn-font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* If a container expects equal-width actions (modals), opt-in only there. */
.modal-buttons .btn {
  flex: 1;
}
