/*
  Button system — exactly two variants: primary (filled) and secondary
  (outline). Every hover/focus/disabled state is defined once, here,
  and inherited by every button on the site.

  Why only two variants: the source project's audit found buttons
  invented ad hoc per page/component — different radii, different
  hover behavior, some with no focus state at all. Capping the system
  at two named variants forces every new "I need a button" moment to
  reuse one of these instead of inventing a third, fourth, fifth look.
  If a real third variant need emerges (e.g. a destructive/danger
  action), add it deliberately here with its own states — don't let
  one-off inline styles reintroduce the drift this file exists to stop.
*/

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* WCAG 2.5.5 minimum tap-target size; go to 48px if the layout has room */
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-family-body);
  font-size: var(--font-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

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

/* Primary — filled, highest-emphasis action. One per view/section,
   generally; if everything is primary, nothing is. */
.btn--primary {
  border-color: var(--color-brand-primary);
  background: var(--color-brand-primary);
  color: var(--color-text-on-brand);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--color-brand-primary-onDark);
  border-color: var(--color-brand-primary-onDark);
}

/* Secondary — outline, lower-emphasis action (e.g. "Learn more"
   alongside a primary "Get a quote"). */
.btn--secondary {
  border-color: var(--color-brand-primary);
  background: transparent;
  color: var(--color-brand-primary);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  background: var(--color-brand-primary);
  color: var(--color-text-on-brand);
}

/* On a dark surface (header/footer/hero/CTA band), a secondary button
   outlined in the brand color may not have enough contrast against a
   dark background — verify it, and fall back to an inverse-colored
   outline if not. Pair with the .dark-surface helper in base.css. */
.dark-surface .btn--secondary {
  border-color: var(--color-text-inverse);
  color: var(--color-text-inverse);
}

.dark-surface .btn--secondary:hover,
.dark-surface .btn--secondary:focus-visible {
  background: var(--color-text-inverse);
  color: var(--color-brand-dark);
}

/* Full-width variant for narrow contexts (mobile stacked CTAs, form
   submit buttons in a single-column layout). */
.btn--block {
  width: 100%;
}
