/* ══════════════════════════════════════════════════════════════════════════
   Circle Health — Components
   Shared, reusable pieces built out of tokens.css. A component owns its own
   interaction states so no page has to reinvent them.

   Requires tokens.css. Imported by every page stylesheet.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── The action button ────────────────────────────────────────────────────
   One solid orange button with a black label. The label colour NEVER changes
   between states — only the fill moves along the orange ramp — because a label
   that changes colour on hover reads as a different control, and white-on-
   orange is the contrast failure this component exists to prevent.

   States, and why each is what it is:
     rest      orange-400  #FF884C   6.34:1 against the label — the resting action
     hover     orange-500  #EE6D21   4.89:1 — a clear step down the ramp, still AA
     active    orange-600  #CA4E00   pressed: deepest fill, plus a 1px push and a
                                     collapsed shadow, so the press reads by depth
                                     and motion, not by colour alone
     focus     2px orange-700 ring, offset 2px — never colour-only, and it clears
                                     both the cream ground (6.14:1) and white (6.88:1)
     disabled  orange-200 fill, black-700 label (4.74:1) — visibly inert but still
                                     readable; pointer events stay off

   NOTE: the active fill is 3.29:1 against the label, under AA for body text. It
   is momentary and never a resting state; if that trade is unwanted, move
   --circle-btn-active to var(--orange-500) and the press reads by depth alone. */

.circle-btn,
.membership-btn,            /* aliases — see the app-wide sweep note below */
.thanks-btn,
.dash-preview-ok,
.loginbutton_, .loginbutton {
  --circle-btn-rest:   var(--orange-400);
  --circle-btn-hover:  var(--orange-500);
  --circle-btn-active: var(--orange-600);

  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;                  /* the smallest comfortable touch target */
  padding: 15px 24px;
  border: 0; border-radius: 14px;
  background: var(--circle-btn-rest);
  color: var(--color-font);
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(41,38,38,0.10);
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 60ms ease;
}

/* Hover is a pointer-only affordance: on touch it would stick after the tap. */
@media (hover: hover) {
  .circle-btn:hover,
  .membership-btn:hover,
  .thanks-btn:hover,
  .dash-preview-ok:hover,
  .loginbutton_:hover, .loginbutton:hover {
    background: var(--circle-btn-hover);
    color: var(--color-font);
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(41,38,38,0.14);
  }
}

.circle-btn:active,
.membership-btn:active,
.thanks-btn:active,
.dash-preview-ok:active,
.loginbutton_:active, .loginbutton:active {
  background: var(--circle-btn-active);
  color: var(--color-font);
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(41,38,38,0.22);
}

/* :focus-visible only — a mouse click should not leave a ring behind. */
.circle-btn:focus-visible,
.membership-btn:focus-visible,
.thanks-btn:focus-visible,
.dash-preview-ok:focus-visible,
.loginbutton_:focus-visible, .loginbutton:focus-visible {
  outline: 2px solid var(--orange-700);
  outline-offset: 2px;
}

.circle-btn:disabled, .circle-btn[aria-disabled="true"],
.membership-btn:disabled, .membership-btn[aria-disabled="true"],
.thanks-btn:disabled, .thanks-btn[aria-disabled="true"],
.dash-preview-ok:disabled,
.loginbutton_:disabled, .loginbutton:disabled {
  background: var(--orange-200);
  color: var(--black-700);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* Full-width is a layout choice, not a kind of button. */
.circle-btn-block,
.membership-btn,
.thanks-btn { display: flex; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .circle-btn, .membership-btn, .thanks-btn, .dash-preview-ok,
  .loginbutton_, .loginbutton { transition: background-color 140ms ease; }
  .circle-btn:active, .membership-btn:active, .thanks-btn:active { transform: none; }
}

/* ── Secondary ────────────────────────────────────────────────────────────
   Same shape and states, no fill. The label stays Circle black: an orange
   label on an unfilled button reads as a text link, and then the two actions
   on a page compete as though they were the same kind of thing.
   Must follow the base rules above — equal specificity, so order decides. */
.circle-btn-quiet,
.thanks-btn-ghost {
  background: transparent;
  color: var(--color-font);
  border: 1px solid var(--sand-300);
  box-shadow: none;
}
@media (hover: hover) {
  .circle-btn-quiet:hover,
  .thanks-btn-ghost:hover {
    background: var(--orange-050);
    color: var(--color-font);
    border-color: var(--orange-200);
    box-shadow: none;
  }
}
.circle-btn-quiet:active,
.thanks-btn-ghost:active {
  background: var(--orange-100);
  color: var(--color-font);
  box-shadow: none;
}

/* ── App-wide sweep, still to do ──────────────────────────────────────────
   There is no other button component in this app: ~49 one-off button classes
   each carry their own fill, weight and hover. `.membership-btn` is aliased
   above as the first adopter. To adopt the rest, put `circle-btn` on the
   element (plus `circle-btn-block` where it spans the column), delete that
   class's own colour/state declarations, and drop its alias from this file. */
