/*
  style.css — only what Tailwind utilities can't express cleanly:
  the sliding toggle, the label colours that follow it, and the price-change effect.
  Every selector is prefixed .pm- so nothing leaks into a host page.
*/

/* ---------- Billing toggle ---------- */
.pm-toggle { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.pm-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6366f1; }

/* The coloured pill slides from the left half to the right half.
   aria-checked="true" means "Annual" is selected. */
.pm-thumb { transition: transform 350ms cubic-bezier(.22, 1, .36, 1); }
.pm-toggle[aria-checked="true"] .pm-thumb { transform: translateX(100%); }

/* Label colours: white on the pill, grey off it. They fade as the pill moves. */
.pm-option { color: #475569; transition: color 250ms ease; }
.pm-toggle[aria-checked="false"] [data-option="monthly"],
.pm-toggle[aria-checked="true"]  [data-option="annual"] { color: #fff; }

/* The "Save 20%" chip: green when not selected, soft white when selected. */
.pm-save { background: #d1fae5; color: #047857; transition: background-color 250ms ease, color 250ms ease; }
.pm-toggle[aria-checked="true"] .pm-save { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Price change effect ---------- */
/* app.js adds .is-changing for a moment whenever the number is replaced. */
@keyframes pm-pop {
  0%   { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: none; }
}
.pm-amount { display: inline-block; font-variant-numeric: tabular-nums; }
.pm-amount.is-changing { animation: pm-pop 250ms ease-out; }

/* Cards lift slightly on hover */
.pm-card { transition: transform 200ms ease, box-shadow 200ms ease; }
.pm-card:hover { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .pm-thumb, .pm-option, .pm-save, .pm-card { transition: none; }
  .pm-amount.is-changing { animation: none; }
  .pm-card:hover { transform: none; }
}
