/* ═══════════════════════════════════════════════════════════════════════════
   synora-plancards.css — the plan cards and the audience tabs, once.

   ── WHY THIS FILE EXISTS ───────────────────────────────────────────────────
   Pricing moved off the nav bar and onto the home page, which meant the same
   cards had to appear in two places. Two copies of a card that prints a PRICE
   is the kind of duplication that ends with a visitor reading $49 on one page
   and $59 on the other, so the markup, the behaviour and the look are each
   written down once: this file and synora-plancards.js.

   ── THE TOKEN BRIDGE AT THE TOP ────────────────────────────────────────────
   The two pages do not share a palette. synora-pricing.html names its
   surfaces --bg / --line / --slate2 / --ink2; synora-home.html names its own
   --panel / --rule / --ink-3 / --ink-2, and neither was written with the
   other in mind. Rather than rename one page's tokens — a change with a blast
   radius far wider than this feature — every colour below is read through a
   --pc-* variable that tries each page's name in turn and ends in a literal.

   So this file works on a page that has either vocabulary, or neither. Add it
   to a third page with its own palette and the fallbacks still produce a card
   that is legible; teach the bridge that page's token names and it produces a
   card that belongs there.

   ── EVERYTHING IS SCOPED TO .syn-plans ─────────────────────────────────────
   Including the buttons. Both host pages already have a global .btn of their
   own, drawn to their own proportions, and a shared stylesheet that redefined
   .btn globally would restyle a hero button on one page to suit a card on the
   other. Nothing here escapes the container.
   ═══════════════════════════════════════════════════════════════════════════ */

.syn-plans{
  --pc-card:  var(--panel, var(--bg, #FFFFFF));
  --pc-sunk:  var(--bg2, var(--sunk, #F7F8F6));
  --pc-line:  var(--line, var(--rule, #E1E4E6));
  --pc-line2: var(--line2, var(--rule, #CDD3D7));
  --pc-ink:   var(--ink, #0D1F2A);
  --pc-body:  var(--ink2, var(--ink-2, #23384A));
  --pc-mid:   var(--slate, var(--ink-2, #4F5F6B));
  --pc-muted: var(--slate2, var(--ink-3, #6A7883));
  --pc-grad:  var(--grad, linear-gradient(135deg,#2B5BD7 0%,#00A79E 58%,#4FE3D0 100%));
  --pc-sans:  var(--sans, var(--f, 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif));
  --pc-r:     var(--r, 16px);
}

/* ── WHO THE PLAN IS FOR ──────────────────────────────────────────────
   Two tabs, because one grid of seven cards made a student read past the
   plans for universities to reach their own. The split is the server's
   `for` field, so this control chooses between answers it was given
   rather than deciding here which plan belongs to whom. */
.syn-plans .audience{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px;padding:5px;
  border:1px solid var(--pc-line);border-radius:999px;background:var(--pc-sunk);
  width:max-content;max-width:100%}
.syn-plans .audience button{appearance:none;cursor:pointer;border:0;border-radius:999px;
  font:700 13.5px/1 var(--pc-sans);letter-spacing:-.01em;padding:11px 18px;
  background:transparent;color:var(--pc-muted);transition:background .14s,color .14s}
.syn-plans .audience button:hover{color:var(--pc-ink)}
.syn-plans .audience button[aria-selected="true"]{background:var(--pc-grad);color:#fff}
.syn-plans .aud-note{margin:0 0 20px;font:400 14px/1.5 var(--pc-sans);
  color:var(--pc-muted);max-width:62ch}

/* ── PLAN CARDS ───────────────────────────────────────────────────────
   Every card carries the colour of the service it is FOR, because "which
   of these is mine" is the question and identical white boxes answered it
   with prose only.

   THE COLUMN COUNT IS THE CARD COUNT, set by the script from what the tab
   actually holds. It was auto-fit against a 214px minimum, which was
   right for the five cards that used to sit here and wrong the moment a
   tab holds three: auto-fit lays three cards across five tracks' worth of
   room and stretches each one into a banner. A tab of three or fewer is
   also held to a width that keeps a card looking like a card. */
.syn-plans .cards{display:grid;gap:16px;align-items:stretch;
  grid-template-columns:repeat(var(--cols,4),minmax(0,1fr))}
.syn-plans .cards[data-count="3"],
.syn-plans .cards[data-count="2"]{max-width:920px;margin-inline:auto}
.syn-plans .cards[data-count="1"]{max-width:380px;margin-inline:auto}
@media (max-width:1180px){.syn-plans .cards{grid-template-columns:repeat(auto-fit,minmax(248px,1fr))}}
@media (max-width:620px){.syn-plans .cards{grid-template-columns:1fr}}

.syn-plans .plan{position:relative;border:1px solid var(--pc-line);border-radius:var(--pc-r);
  background:var(--pc-card);padding:22px 20px;display:flex;flex-direction:column;gap:12px;
  min-width:0;height:100%;border-top:4px solid var(--c,var(--pc-line2));
  font-family:var(--pc-sans)}
.syn-plans .plan.feature{border-color:var(--c);
  box-shadow:0 0 0 1px var(--c),0 18px 40px -26px rgba(11,26,28,.5)}
.syn-plans .plan .badge{position:absolute;top:-11px;left:20px;font:800 10px/1 var(--pc-sans);
  letter-spacing:.11em;text-transform:uppercase;padding:6px 10px;border-radius:999px;
  background:var(--pc-grad);color:#fff}
.syn-plans .plan h3{font:700 18px/1.25 var(--pc-sans);margin:0;letter-spacing:-.02em;
  color:var(--pc-ink)}
.syn-plans .plan .who{font:400 13px/1.45 var(--pc-sans);color:var(--pc-muted);margin:0}

/* WHAT THE PLAN IS FOR, as chips, from the server's own `covers`. */
.syn-plans .covers{display:flex;flex-wrap:wrap;gap:5px}
.syn-plans .covers span{font:700 10.5px/1 var(--pc-sans);letter-spacing:.06em;
  text-transform:uppercase;padding:5px 8px;border-radius:999px;
  background:var(--ct);color:var(--c)}

.syn-plans .price{font:700 38px/1 var(--pc-sans);font-variant-numeric:tabular-nums;
  letter-spacing:-.04em;color:var(--pc-ink)}
.syn-plans .price small{font:500 14px/1 var(--pc-sans);color:var(--pc-muted);letter-spacing:0}
.syn-plans .plan .sum{font:400 14px/1.5 var(--pc-sans);color:var(--pc-mid);margin:0}

.syn-plans .nums{display:flex;flex-wrap:wrap;gap:7px}
.syn-plans .nums div{flex:1 1 auto;min-width:0;border:1px solid var(--pc-line);
  border-radius:10px;padding:9px 11px;background:var(--pc-card)}
.syn-plans .nums b{display:block;font:700 15px/1.1 var(--pc-sans);
  font-variant-numeric:tabular-nums;color:var(--c)}
.syn-plans .nums span{display:block;font:600 9.5px/1.25 var(--pc-sans);letter-spacing:.07em;
  text-transform:uppercase;color:var(--pc-muted);margin-top:3px}

.syn-plans .plan ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;
  gap:8px;flex:1 1 auto}
.syn-plans .plan li{position:relative;padding-left:22px;font:400 13.8px/1.45 var(--pc-sans);
  color:var(--pc-body)}
.syn-plans .plan li::before{content:"";position:absolute;left:0;top:6px;width:12px;height:6px;
  border-left:2px solid var(--c);border-bottom:2px solid var(--c);
  transform:rotate(-45deg);border-radius:1px}

/* The card's own buttons. Scoped, so neither host page's global .btn is
   touched and neither page's hero button changes shape because a card
   needed a taller one. */
.syn-plans .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;
  font:700 14px/1 var(--pc-sans);letter-spacing:-.01em;padding:13px 18px;border-radius:999px;
  border:1px solid transparent;cursor:pointer;text-decoration:none;
  transition:filter .14s,border-color .14s}
.syn-plans .btn.pri{background:var(--pc-grad);color:#fff;
  box-shadow:0 8px 20px -10px rgba(0,167,158,.65)}
.syn-plans .btn.pri:hover{filter:saturate(1.08) brightness(1.04)}
.syn-plans .btn.sec{background:var(--pc-card);color:var(--pc-ink);border-color:var(--pc-line2)}
.syn-plans .btn.sec:hover{border-color:var(--pc-ink)}
.syn-plans .btn.block{width:100%}
.syn-plans .btn[aria-disabled="true"]{opacity:.5;pointer-events:none}

.syn-plans .plan .foot{font:400 12.5px/1.45 var(--pc-sans);color:var(--pc-muted);margin:0;
  text-align:center}

/* THE NOTES GO ABOVE THE ACTION, NOT INSIDE IT. First attempt put the
   button and its explanatory lines together in one bottom-aligned box. The
   box aligned perfectly and the BUTTONS still did not, because a card with
   a "waiting on" line has a taller box and its button therefore starts
   higher. Only the button is bottom-aligned; the prose above it absorbs
   the slack like the feature list does. */
.syn-plans .plan .act{margin-top:auto;padding-top:12px}
/* 52px, not 44px, and the same whether the label wraps. The label is the
   server's "Upgrade to " plus the plan's own name, so its length is a
   property of the catalogue rather than of this stylesheet: "Upgrade to
   Company Pro Annual" takes two lines in a narrow card, and a button that
   grew to fit left its neighbours' buttons sitting a line higher. A box
   tall enough for two lines holds the row level for a one-line label too,
   and text-wrap:balance splits a two-line label evenly instead of leaving
   one word alone underneath. */
.syn-plans .plan .act .btn{min-height:52px;width:100%;box-sizing:border-box;
  text-align:center;text-wrap:balance}

.syn-plans .loading,.syn-plans .err{grid-column:1/-1;font:400 14px/1.6 var(--pc-sans);
  color:var(--pc-muted);margin:0}
.syn-plans .err{border:1px solid var(--pc-line);border-radius:var(--pc-r);padding:18px 20px;
  background:var(--pc-card)}

/* ── COMING BACK FROM SIGNING IN ──────────────────────────────────────
   highlightChosen() marks the card somebody picked before they had an
   account. The mark lives here rather than on the pricing page because the
   script that applies it is shared: a page that mounts these cards and
   receives an ?upgrade= of its own would otherwise add a class with
   nothing behind it. */
.syn-plans .plan.chosen{outline:2px solid var(--c,#00707F);outline-offset:3px}
.syn-plans .plan.chosen .badge{background:var(--c,#00707F);color:#fff}
@media (prefers-reduced-motion:reduce){.syn-plans .plan.chosen{outline-offset:2px}}

@media (prefers-color-scheme:dark){
  /* Only the one rule the host pages cannot supply: a gradient button's
     shadow is tuned for a light ground and reads as a smear on a dark one.
     Every other colour here already comes from the host page's own tokens,
     which each page redefines for dark in its own stylesheet. */
  :root:not([data-theme="light"]) .syn-plans .btn.pri{box-shadow:none}
  /* Dark text on the gradient, taken from whatever the host page calls its
     card surface, so the badge reads the same on both pages instead of one
     of them keeping a hard-coded ink value the other never had. */
  :root:not([data-theme="light"]) .syn-plans .plan .badge{color:var(--pc-card)}
}
:root[data-theme="dark"] .syn-plans .btn.pri{box-shadow:none}
:root[data-theme="dark"] .syn-plans .plan .badge{color:var(--pc-card)}
