/*
 * Chef's Touch — the pricing card with a billing-cycle switch.
 *
 * One stylesheet for all three places the card appears: the home page (inside Astra's own styles),
 * the planner paywall, and the Memberships tab. Every token is declared on `.ct-pricing` rather
 * than :root, and every selector is scoped to it, so nothing leaks either way.
 *
 * The switch is CSS-only by design. `[data-cycle]` on the container is what actually shows a
 * pane; the script sets it on change, and `:has()` rules do the same thing for a reader whose
 * JavaScript never arrives. Either path alone is enough. Those rules are keyed per plan, so
 * Pricing::render() emits them beside the card; this file holds only what every card shares.
 */

.ct-pricing {
  --ct-p-ink: #1b3a2a;
  --ct-p-body: #55645b;
  --ct-p-green: #3f993b;
  --ct-p-green-dark: #2a6b26;
  --ct-p-mint: #eaf5e3;
  --ct-p-cream: #faf8f3;
  --ct-p-line: #dfe6da;
  --ct-p-radius: 18px;

  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ct-p-ink);
  line-height: 1.7;
}
.ct-pricing-in { max-width: 460px; margin-inline: auto; }
.ct-pricing *, .ct-pricing *::before, .ct-pricing *::after { box-sizing: border-box; }
.ct-pricing :focus { outline: none; }
.ct-pricing :focus-visible { outline: 2px solid var(--ct-p-green); outline-offset: 2px; }

.ct-pricing-title {
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.6rem; font-weight: 700; line-height: 1.3;
  margin: 0 0 6px; text-align: center; text-wrap: balance;
}
.ct-pricing-lede { margin: 0 0 20px; text-align: center; color: var(--ct-p-body); font-size: .95rem; }

.ct-pricing-card {
  background: var(--ct-p-cream);
  border: 2px solid var(--ct-p-green);
  border-radius: var(--ct-p-radius);
  padding: 28px 26px;
  text-align: center;
}

/* ─────────── the switch ─────────── */
/* Off-screen rather than display:none, so the keyboard and a screen reader still reach it. */
.ct-pricing-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.ct-pricing-switch {
  display: flex; gap: 4px; margin: 0 auto 22px; padding: 4px;
  background: #fff; border: 1px solid var(--ct-p-line); border-radius: 999px;
  max-width: 340px;
}
/* Three cycles (monthly, yearly, five years) need the card's full width. */
.ct-pricing-switch:has(> :nth-child(3)) { max-width: none; }
.ct-pricing-opt {
  flex: 1; display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px;
  min-height: 42px; padding: 6px 10px; border-radius: 999px;
  font-size: .9rem; font-weight: 700; color: var(--ct-p-body);
  cursor: pointer; user-select: none; line-height: 1.3;
  transition: background .14s, color .14s;
}
/* The label never breaks; the saving badge may drop under it when the pill is narrow. */
.ct-pricing-opt > span { white-space: nowrap; }
.ct-pricing-opt:hover { background: var(--ct-p-mint); color: var(--ct-p-green-dark); }
.ct-pricing-save {
  padding: 2px 8px; border-radius: 999px;
  background: var(--ct-p-mint); color: var(--ct-p-green-dark);
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
}

/* ─────────── panes ─────────── */
.ct-pricing-pane { display: none; }
/* Which pane shows, and which switch option is lit, is keyed per plan and emitted inline by
   Pricing::render() — a yearly and a five-yearly plan share the "year" interval and need keys of
   their own ("year", "year5"). The attribute path below is what the script drives; the `:has()`
   path does the same for a reader whose JavaScript never arrives. */
/* A single cycle has no switch and no attribute to match — show the only pane there is. */
.ct-pricing-card:not(:has(.ct-pricing-switch)) .ct-pricing-pane { display: block; }

/* ─────────── the price ─────────── */
.ct-pricing-name {
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.05rem; font-weight: 700; margin-bottom: 14px;
}
.ct-pricing-price {
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 2.4rem; font-weight: 700; line-height: 1.15; margin-bottom: 2px;
}
/* A sale: the old price struck through, and what it takes off. */
.ct-pricing-was { font-size: .95rem; color: var(--ct-p-body); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ct-pricing-was del { opacity: .75; }
.ct-pricing-off {
  padding: 2px 8px; border-radius: 999px; background: #c0392b; color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
/* A price is read left-to-right in both languages, symbol and all. */
.ct-pricing-amount { direction: ltr; unicode-bidi: isolate; }
.ct-pricing-per { font-size: .9rem; font-weight: 500; color: var(--ct-p-body); font-family: inherit; }
.ct-pricing-equiv { font-size: .82rem; color: var(--ct-p-body); margin-bottom: 18px; }
.ct-pricing-price + .ct-pricing-features { margin-top: 20px; }

.ct-pricing-features {
  list-style: none; margin: 18px 0 22px; padding: 0; text-align: start;
  display: grid; gap: 9px;
}
.ct-pricing-features li {
  position: relative; padding-inline-start: 27px;
  font-size: .92rem; color: var(--ct-p-body); margin: 0;
}
/* A tick drawn in CSS: no icon font, no extra request, and it mirrors with the text. */
.ct-pricing-features li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .5em;
  width: 16px; height: 16px; margin-top: -8px; border-radius: 999px;
  background: var(--ct-p-mint);
}
.ct-pricing-features li::after {
  content: ""; position: absolute; inset-inline-start: 5px; top: .5em;
  width: 5px; height: 9px; margin-top: -6px;
  border: solid var(--ct-p-green-dark); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ct-pricing a.ct-pricing-btn,
.ct-pricing-btn {
  display: block; width: 100%; min-height: 48px;
  padding: 12px 24px; border: 1px solid var(--ct-p-green); border-radius: 999px;
  background: var(--ct-p-green); color: #fff;
  font-family: inherit; font-size: .95rem; font-weight: 700; line-height: 1.5;
  text-align: center; text-decoration: none; text-transform: none; letter-spacing: normal;
}
.ct-pricing a.ct-pricing-btn:hover, .ct-pricing a.ct-pricing-btn:focus,
.ct-pricing-btn:hover, .ct-pricing-btn:focus { background: var(--ct-p-green-dark); border-color: var(--ct-p-green-dark); color: #fff; }
.ct-pricing a.ct-pricing-btn-out,
.ct-pricing-btn-out { background: #fff; color: var(--ct-p-green-dark); }
.ct-pricing-btn-out:hover, .ct-pricing-btn-out:focus { background: var(--ct-p-mint); color: var(--ct-p-green-dark); }

.ct-pricing-current {
  display: inline-block; margin-bottom: 12px; padding: 4px 14px; border-radius: 999px;
  background: var(--ct-p-mint); color: var(--ct-p-green-dark);
  font-size: .78rem; font-weight: 700;
}
.ct-pricing-note { margin: 16px 0 0; font-size: .78rem; line-height: 1.55; color: var(--ct-p-body); text-align: center; }

/* ─────────── compact: inside the account column ─────────── */
/* The account content column is a flex column. An auto inline margin on a flex item switches off
   `stretch`, so the centred card shrank to its own content — full width and no auto margin here. */
.ct-pricing--compact .ct-pricing-in { max-width: 560px; margin-inline: 0; }
.ct-pricing--compact .ct-pricing-title { font-size: 1.25rem; text-align: start; }
.ct-pricing--compact .ct-pricing-lede { text-align: start; }
.ct-pricing--compact .ct-pricing-card { padding: 22px 20px; }
.ct-pricing--compact .ct-pricing-price { font-size: 2rem; }
.ct-pricing--compact .ct-pricing-btn { width: auto; min-width: 220px; margin-inline: auto; }
/* The paywall card sits under the heading that introduces it, not centred away from it. This used
   to be scoped to the full-width builder; that layout is gone (every screen keeps the sidebar now),
   so it applies wherever the card appears inside the account shell. */
.ct-account .ct-pricing-in { margin-inline: 0; }

@media (max-width: 480px) {
  .ct-pricing-card { padding: 22px 18px; }
  .ct-pricing-price { font-size: 2rem; }
  .ct-pricing-opt { font-size: .82rem; padding: 6px 8px; }
  .ct-pricing--compact .ct-pricing-btn { width: 100%; min-width: 0; }
}
