/* ═══════════════════════════════════════════════════════
   NETZSCH Customer Portal — Button Design System
   8 tokens, 3 sizes, complete state coverage
   ═══════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ─── */
:root {
  /* Primary (green) */
  --btn-primary-bg: #007167;
  --btn-primary-bg-hover: #005f57;
  --btn-primary-text: #fff;
  --btn-primary-shadow: 0 2px 8px rgba(0, 113, 103, 0.2);

  /* Secondary (outline) */
  --btn-secondary-bg: #fff;
  --btn-secondary-bg-hover: #f0faf9;
  --btn-secondary-border: #007167;
  --btn-secondary-text: #007167;

  /* Ghost */
  --btn-ghost-text: #007167;
  --btn-ghost-text-hover: #005f57;
  --btn-ghost-bg-hover: rgba(0, 113, 103, 0.06);

  /* Danger */
  --btn-danger-bg: #c73e20;
  --btn-danger-bg-hover: #b53519;
  --btn-danger-text: #fff;

  /* Quick action */
  --btn-quick-bg: #fff;
  --btn-quick-border: rgba(0, 0, 0, 0.08);
  --btn-quick-border-hover: rgba(0, 113, 103, 0.3);
  --btn-quick-text: #6b7280;
  --btn-quick-text-hover: #007167;

  /* Pill (filter/toggle) */
  --btn-pill-bg: #fff;
  --btn-pill-bg-active: rgba(0, 113, 103, 0.08);
  --btn-pill-border: rgba(0, 0, 0, 0.08);
  --btn-pill-text: #6b7280;
  --btn-pill-text-active: #007167;

  /* Disabled */
  --btn-disabled-bg: #b1b4b7;
  --btn-disabled-text: #fff;

  /* Focus ring */
  --btn-focus-ring: 0 0 0 3px rgba(0, 113, 103, 0.3);
}


/* ═══════════════════════════════════════════
   BASE — shared reset for all buttons
   ═══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--btn-focus-ring);
}

.btn:disabled,
.btn.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 1;
}

.btn img,
.btn svg {
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none !important;
  }
  .btn:active {
    transform: none !important;
  }
}


/* ═══════════════════════════════════════════
   SIZES — sm / md (default) / lg
   ═══════════════════════════════════════════ */

/* Small — 32px, compact */
.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 999px;
}
.btn-sm img,
.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* Medium — 40px, standard (default) */
.btn,
.btn-md {
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
  border-radius: 999px;
}
.btn img,
.btn svg,
.btn-md img,
.btn-md svg {
  width: 16px;
  height: 16px;
}

/* Large — 48px, prominent */
.btn-lg {
  height: 48px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
}
.btn-lg img,
.btn-lg svg {
  width: 18px;
  height: 18px;
}


/* ═══════════════════════════════════════════
   TOKEN 1 — PRIMARY
   Solid green, white text. Main CTAs.
   Use: Add to Cart, Submit, Sign In, Continue
   ═══════════════════════════════════════════ */

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

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

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: none;
}

.btn-primary:disabled,
.btn-primary.is-disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
}


/* ═══════════════════════════════════════════
   TOKEN 2 — SECONDARY
   White bg, green outline, green text.
   Use: Cancel, Back, SSO login, Contact
   ═══════════════════════════════════════════ */

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1.5px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-bg-hover);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-secondary:disabled,
.btn-secondary.is-disabled {
  border-color: #d1d5db;
  color: #9ca3af;
  background: #fafbfc;
}

/* Secondary on dark — white outline for hero/CTA over dark surfaces */
.btn-outline-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-outline-light:active {
  transform: scale(0.97);
}


/* ═══════════════════════════════════════════
   TOKEN 3 — GHOST
   No background, no border, text only.
   Use: View All, Back (no border), text links
   ═══════════════════════════════════════════ */

.btn-ghost {
  background: none;
  color: var(--btn-ghost-text);
  padding-left: 8px;
  padding-right: 8px;
}

.btn-ghost:hover {
  background: var(--btn-ghost-bg-hover);
  color: var(--btn-ghost-text-hover);
}

.btn-ghost:active {
  transform: scale(0.97);
}

.btn-ghost:disabled,
.btn-ghost.is-disabled {
  color: #9ca3af;
}


/* ═══════════════════════════════════════════
   TOKEN 4 — DANGER
   Red bg for destructive actions.
   Use: Delete, Decline, Remove
   ═══════════════════════════════════════════ */

.btn-danger {
  background: var(--btn-danger-bg);
  color: var(--btn-danger-text);
}

.btn-danger:hover {
  background: var(--btn-danger-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(199, 62, 32, 0.2);
}

.btn-danger:active {
  transform: scale(0.97);
  box-shadow: none;
}

.btn-danger:disabled,
.btn-danger.is-disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
}

/* Danger outline variant */
.btn-danger-outline {
  background: #fff;
  color: var(--btn-danger-bg);
  border: 1.5px solid var(--btn-danger-bg);
}

.btn-danger-outline:hover {
  background: #fdf2f0;
}

.btn-danger-outline:active {
  transform: scale(0.97);
}


/* ═══════════════════════════════════════════
   TOKEN 5 — ICON
   Square or circle, icon only.
   Use: Header icons, table actions, close buttons
   ═══════════════════════════════════════════ */

.btn-icon {
  padding: 0;
  background: none;
  border: none;
  color: #6b7280;
  border-radius: 8px;
}

/* Icon sizes override */
.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
}
.btn-icon.btn-sm img,
.btn-icon.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-icon,
.btn-icon.btn-md {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
}
.btn-icon img,
.btn-icon svg,
.btn-icon.btn-md img,
.btn-icon.btn-md svg {
  width: 16px;
  height: 16px;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
}
.btn-icon.btn-lg img,
.btn-icon.btn-lg svg {
  width: 18px;
  height: 18px;
}

/* Circle variant */
.btn-icon.btn-circle {
  border-radius: 50%;
}

/* Icon hover — green tint */
.btn-icon:hover {
  background: rgba(0, 113, 103, 0.08);
  color: #007167;
}

.btn-icon:active {
  transform: scale(0.93);
}

/* Icon with green color */
.btn-icon.btn-icon-green {
  color: #007167;
}
.btn-icon.btn-icon-green:hover {
  background: rgba(0, 113, 103, 0.08);
  color: #005f57;
}


/* ═══════════════════════════════════════════
   TOKEN 6 — PILL
   Toggle/filter chips.
   Use: Status filters, view toggles, tabs
   ═══════════════════════════════════════════ */

.btn-pill {
  background: var(--btn-pill-bg);
  color: var(--btn-pill-text);
  border: 1px solid var(--btn-pill-border);
}

.btn-pill:hover {
  border-color: var(--btn-quick-border-hover);
  color: var(--btn-pill-text-active);
  background: rgba(0, 113, 103, 0.03);
}

.btn-pill:active {
  transform: scale(0.97);
}

.btn-pill.active,
.btn-pill.is-active {
  background: var(--btn-pill-bg-active);
  color: var(--btn-pill-text-active);
  border-color: rgba(0, 113, 103, 0.3);
  font-weight: 600;
}


/* ═══════════════════════════════════════════
   TOKEN 7 — QUICK
   Dashboard quick actions. White, subtle border.
   Use: Quick Order, View Wishlist, New Quote
   ═══════════════════════════════════════════ */

.btn-quick {
  background: var(--btn-quick-bg);
  color: var(--btn-quick-text);
  border: 1px solid var(--btn-quick-border);
}

.btn-quick:hover {
  border-color: var(--btn-quick-border-hover);
  color: var(--btn-quick-text-hover);
  background: rgba(0, 113, 103, 0.03);
}

.btn-quick:active {
  transform: scale(0.97);
}

.btn-quick img,
.btn-quick svg {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.btn-quick:hover img,
.btn-quick:hover svg {
  opacity: 1;
}


/* ═══════════════════════════════════════════
   TOKEN 8 — CTA
   Hero buttons, maximum prominence.
   Use: Checkout, hero sections, upsell
   ═══════════════════════════════════════════ */

.btn-cta {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 113, 103, 0.25);
  border-radius: 999px;
}

.btn-cta:hover {
  background: var(--btn-primary-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 113, 103, 0.3);
}

.btn-cta:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0, 113, 103, 0.2);
}

.btn-cta:disabled,
.btn-cta.is-disabled {
  background: #d7d9db;
  color: #8b8e91;
  box-shadow: none;
}


/* ═══════════════════════════════════════════
   MODIFIERS
   ═══════════════════════════════════════════ */

/* Full width */
.btn-full {
  width: 100%;
}

/* No gap (icon-only with text hidden) */
.btn-compact {
  gap: 4px;
}

/* Strong weight */
.btn-bold {
  font-weight: 600;
}


/* ═══════════════════════════════════════════
   BUTTON GROUPS
   ═══════════════════════════════════════════ */

.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-group-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .btn-lg {
    height: 44px;
    padding: 0 24px;
    font-size: 14px;
  }

  .btn-cta {
    height: 44px;
    font-size: 14px;
  }

  /* Stack button groups on mobile */
  .btn-group-stack-mobile {
    flex-direction: column;
  }
  .btn-group-stack-mobile .btn {
    width: 100%;
  }
}
