/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: 1;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 220ms var(--ease),
    color 220ms var(--ease),
    border-color 220ms var(--ease),
    transform 160ms var(--ease),
    box-shadow 260ms var(--ease);
  white-space: nowrap;
  max-width: 100%;
}

/* On mobile, allow long CTA text (e.g. "Book a free consult while you wait")
   to wrap rather than overflow the viewport. Also enforce a 44px tap target
   so every button feels firm under a thumb. */
@media (max-width: 480px) {
  .btn {
    white-space: normal;
    text-align: center;
    min-height: var(--tap-min);
    padding-block: var(--space-sm);
  }
}
/* `display: inline-flex` above outranks the UA `[hidden]` rule, so we need an
   explicit override or buttons toggled via JS .hidden = true stay visible. */
.btn[hidden] { display: none; }

.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Primary — flat solid orange. No inset highlights or 3D lip.
   AA on white (#f26618 → #fff contrast 3.8:1 for large text). */
.btn--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  font-weight: var(--fw-bold);
  letter-spacing: 0.005em;
  box-shadow: none;
}
.btn--primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -4px rgba(30, 58, 138, 0.25);
}
.btn--primary:active {
  transform: translateY(0);
  transition-duration: 80ms;
  box-shadow: none;
}
.btn--primary:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px var(--color-accent);
}

/* Secondary — navy outline */
.btn--secondary {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-ink);
}
.btn--secondary:hover {
  background: var(--color-ink);
  color: #fff;
}

/* Ghost — text-only with underline-on-hover */
.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: transparent;
  padding-inline: var(--space-sm);
}
.btn--ghost:hover { color: var(--color-accent-hover); }

/* On dark sections */
.section--dark .btn--secondary {
  color: #fff;
  border-color: #fff;
}
.section--dark .btn--secondary:hover {
  background: #fff;
  color: var(--color-ink);
}

/* Sizes */
.btn--sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--fs-sm);
}
.btn--lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-md);
}

/* Sticky mobile CTA bar */
.sticky-cta {
  display: none;
}

@media (max-width: 767px) {
  /* On the quote form, the sticky "Book Free Consult" competes with the
     form's own submit — hide it there so parents don't split attention. */
  body.page-contact .sticky-cta { display: none; }
  body.page-contact { padding-bottom: 0; }

  /* Sticky bar is now a floating pill that sits inside a transparent tray —
     feels lighter than the old edge-to-edge orange slab. Sliding entrance
     keyframe pulls it up the first time it appears so it doesn't just pop. */
  .sticky-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    position: fixed;
    bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
    left: var(--space-md);
    right: var(--space-md);
    height: var(--sticky-cta-h);
    padding: 0 var(--space-xl);
    background: linear-gradient(180deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    color: #fff;
    font-weight: var(--fw-bold);
    letter-spacing: 0.01em;
    text-decoration: none;
    border-radius: var(--radius-pill);
    box-shadow:
      0 12px 28px -8px rgba(242, 102, 24, 0.55),
      0 4px 10px rgba(30, 58, 138, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);
    z-index: 50;
    transition:
      background 220ms var(--ease),
      transform 220ms var(--ease),
      box-shadow 220ms var(--ease);
    animation: sticky-cta-rise 480ms var(--ease-out) 200ms both;
  }
  .sticky-cta::before {
    content: "✦";
    color: rgba(255, 255, 255, 0.95);
    font-size: var(--fs-md);
  }
  .sticky-cta:hover {
    background: linear-gradient(180deg, var(--color-accent-hover) 0%, var(--color-accent-hover) 100%);
  }
  .sticky-cta:active {
    transform: translateY(1px);
    box-shadow:
      0 6px 14px -6px rgba(242, 102, 24, 0.5),
      0 2px 6px rgba(30, 58, 138, 0.2);
  }
  @keyframes sticky-cta-rise {
    from { opacity: 0; transform: translateY(120%); }
    to   { opacity: 1; transform: translateY(0);    }
  }
  @media (prefers-reduced-motion: reduce) {
    .sticky-cta { animation: none; }
  }
  /* Body padding so the sticky bar doesn't cover footer content on mobile.
     Now a touch larger to account for the bar floating above the edge. */
  body { padding-bottom: calc(var(--sticky-cta-h) + var(--space-xl)); }
}
