/* =================================================================
   css/plans.css — the plan comparison + upgrade experience, shared by
   every site (subscribe.html, alevel-frontend/subscribe-alevel.html,
   parent-pay.html). Tokens only (css/tokens.css); classes prefixed mrp-.
   Premium = space, restraint and type: white cards, one primary colour,
   one soft shadow, the featured plan lifted by a navy border.
   ================================================================= */
.mrp { font-family: var(--ibm-font); color: var(--ibm-ink);
  /* One icon set for the plans (SVG, brand navy; no text glyphs) */
  --mrp-ico-yes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23e8eef9'/%3E%3Cpath d='M6 10.4l2.6 2.6L14.2 7.4' fill='none' stroke='%230d3d8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --mrp-ico-no: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='9.25' fill='none' stroke='%23dfe6f1' stroke-width='1.5'/%3E%3Cpath d='M7 10h6' stroke='%239aa8be' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  --mrp-ico-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l5 1.9v4.1c0 3.1-2.1 5.6-5 6.9-2.9-1.3-5-3.8-5-6.9V3.4z' fill='none' stroke='%236b7a99' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M5.8 8l1.6 1.6 2.9-3' fill='none' stroke='%236b7a99' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.mrp *, .mrp *::before, .mrp *::after { box-sizing: border-box; }

/* Billing switch — annual first */
.mrp-billing { display: flex; justify-content: center; margin: 22px 0 28px; }
.mrp-switch { display: inline-flex; gap: 4px; padding: 4px; background: var(--ibm-surface); border: 1px solid var(--ibm-line); border-radius: var(--ibm-r-pill); box-shadow: var(--ibm-shadow); }
.mrp-switch button { font: 600 0.92rem var(--ibm-font); border: 0; background: transparent; color: var(--ibm-ink-2); padding: 9px 18px; border-radius: var(--ibm-r-pill); cursor: pointer; min-height: 44px; transition: background .15s ease, color .15s ease; }
.mrp-switch button:hover:not([aria-pressed="true"]) { color: var(--ibm-dark); background: var(--ibm-surface-2); }
.mrp-switch button:focus-visible, .mrp-btn:focus-visible, .mrp-pass-open:focus-visible { outline: 3px solid rgba(13,61,143,0.35); outline-offset: 2px; }
.mrp-switch button[aria-pressed="true"] { background: var(--ibm-dark); color: #fff; }
.mrp-switch .mrp-save { display: inline-block; margin-left: 6px; font-size: 0.72rem; font-weight: 700; color: var(--ibm-green); background: var(--ibm-green-soft); padding: 2px 8px; border-radius: var(--ibm-r-pill); }
.mrp-switch button[aria-pressed="true"] .mrp-save { background: rgba(255,255,255,0.16); color: #d7f5e3; }

/* Plan grid */
.mrp-grid { display: grid; gap: var(--ibm-s5); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: stretch; }
/* Cards: white, hairline border, one soft shadow. The suggested plan is the
   only one with a navy border, a faint navy wash and the solid button. */
.mrp-plan { position: relative; display: flex; flex-direction: column; background: var(--ibm-surface); border: 1px solid var(--ibm-line); border-radius: 16px; padding: 28px 24px 22px; box-shadow: var(--ibm-shadow); transition: box-shadow .18s ease, border-color .18s ease; }
@media (hover: hover) { .mrp-plan:not(.is-featured):not(.is-free):hover { border-color: var(--ibm-line-strong); box-shadow: var(--ibm-shadow-lift); } }
.mrp-plan.is-featured { border: 2px solid var(--ibm-dark); padding: 27px 23px 21px; background: linear-gradient(180deg, #f3f6fc 0, var(--ibm-surface) 150px); box-shadow: 0 2px 4px rgba(6,37,89,0.06), 0 16px 36px rgba(6,37,89,0.14); }
.mrp-plan.is-free { background: var(--ibm-surface-2); box-shadow: none; }
/* A plan that is not on sale yet (CBSE Pro until its price is approved). */
.mrp-plan.is-soon { border-style: dashed; }
.mrp-amount.mrp-soon { font-size: 1.6rem; color: var(--ibm-ink-2); letter-spacing: -0.01em; }
.mrp-flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ibm-dark); color: #fff; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 12px; border-radius: var(--ibm-r-pill); box-shadow: 0 4px 10px rgba(6,37,89,0.22); }
.mrp-name { margin: 0; font-size: var(--ibm-text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ibm-muted); }
.mrp-plan.is-featured .mrp-name { color: var(--ibm-primary); }
.mrp-title { margin: 6px 0 6px; font-size: 1.25rem; font-weight: 700; color: var(--ibm-dark); letter-spacing: -0.015em; line-height: 1.25; text-wrap: balance; }
.mrp-for { margin: 0 0 18px; font-size: var(--ibm-text-sm); color: var(--ibm-ink-2); line-height: 1.5; min-height: 3em; }
.mrp-price { display: flex; align-items: baseline; gap: 4px; margin: 0; padding-top: 16px; border-top: 1px solid var(--ibm-line); }
.mrp-amount { font-size: 2.4rem; font-weight: 800; color: var(--ibm-dark); letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mrp-amount .mrp-was { font-size: 0.55em; font-weight: 600; color: var(--ibm-muted); letter-spacing: 0; }
/* One quiet line about the founding offer (js/founding-line.js). */
.founding-line { max-width: 720px; margin: 0 auto 14px; text-align: center; font-size: 0.92rem; line-height: 1.5; color: var(--ibm-ink-2); }
.founding-line a { font-weight: 700; color: var(--ibm-primary); }
.mrp-per { font-size: 0.95rem; color: var(--ibm-muted); }
.mrp-week { margin: 4px 0 20px; font-size: 0.84rem; color: var(--ibm-muted); min-height: 1.3em; }
.mrp-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; font-size: var(--ibm-text-sm); color: var(--ibm-ink-2); }
.mrp-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; line-height: 1.45; }
.mrp-list li::before { content: ""; width: 18px; height: 18px; margin-top: 1px; background: var(--mrp-ico-yes) center / contain no-repeat; }
.mrp-list li.no { color: var(--ibm-muted); }
.mrp-list li.no::before { background-image: var(--mrp-ico-no); }
.mrp-list strong { color: var(--ibm-ink); font-weight: 600; }
/* Free card: the 7-day trial as an extra on top of the free account (js/plans.js `plus`). */
.mrp-plus { margin: -10px 0 22px; padding: 10px 12px; border-radius: 10px; background: var(--ibm-primary-soft, #e8eef9); font-size: var(--ibm-text-sm); line-height: 1.45; color: var(--ibm-ink-2); }
.mrp-plus strong { color: var(--ibm-dark); font-weight: 700; }
.mrp-cta { margin-top: auto; }
.mrp-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 12px 18px; border-radius: 10px; border: 0; background: var(--ibm-primary); color: #fff; font: 700 1rem var(--ibm-font); text-decoration: none; cursor: pointer; transition: background .15s ease; white-space: nowrap; }
/* One line, always (owner, Sep 2026): narrow plan cards trim the button's side padding rather than wrap its label. */
.mrp-plan .mrp-btn { padding-left: 10px; padding-right: 10px; }
.mrp-btn:hover { background: var(--ibm-primary-hover); }
.mrp-btn:not(.ghost) { box-shadow: 0 1px 2px rgba(6,37,89,0.18), 0 4px 12px rgba(13,61,143,0.22); }
.mrp-btn.ghost { background: var(--ibm-surface); color: var(--ibm-primary); border: 1px solid var(--ibm-line-strong); }
.mrp-btn.ghost:hover { background: var(--ibm-primary-soft); border-color: var(--ibm-primary); }
.mrp-btn[disabled] { opacity: .6; cursor: progress; }
/* Reassurance right under the button: a small shield, one line. */
.mrp-mb { margin: 10px 0 0; font-size: 0.8rem; color: var(--ibm-muted); text-align: center; }
.mrp-mb::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background: var(--mrp-ico-shield) center / contain no-repeat; }
.mrp-fine { margin: 10px 0 0; font-size: 0.8rem; color: var(--ibm-muted); text-align: center; line-height: 1.45; }
.mrp-mb a, .mrp-refund a, .mrp-pass-fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mrp-refund b { color: var(--ibm-dark); }

/* Exam pass: one quiet line under the price (js/plans.js applyPasses) */
.mrp-pass { margin: -10px 0 16px; font-size: 0.86rem; color: var(--ibm-ink-2); }
.mrp-pass[hidden], .mrp-pass-pick[hidden], [data-exam-pass-only][hidden] { display: none; }
.mrp-pass-line { margin: 0; }
.mrp-pass-open { font: 700 0.86rem var(--ibm-font); color: var(--ibm-primary); background: none; border: 0; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mrp-pass-pick { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--ibm-line); border-radius: 10px; background: var(--ibm-surface-2); }
.mrp-pass-label { font-size: 0.8rem; font-weight: 600; color: var(--ibm-ink); }
.mrp-pass-pick select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--ibm-line-strong); border-radius: 8px; font: 0.88rem var(--ibm-font); background: #fff; color: var(--ibm-ink); }
.mrp-pass-pick .mrp-btn { min-height: 42px; font-size: 0.92rem; }
.mrp-pass-fine, .mrp-pass-note { margin: 0; font-size: 0.78rem; color: var(--ibm-muted); line-height: 1.4; }
.mrp-pass-note:empty { display: none; }
.mrp-pass-note.err { color: var(--ibm-red); }

/* Trust row under the grid */
.mrp-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 26px 0 0; font-size: 0.86rem; color: var(--ibm-ink-2); }
.mrp-trust span { display: inline-block; }
.mrp-trust span::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; background: var(--mrp-ico-yes) center / contain no-repeat; }
.mrp-trust b { color: var(--ibm-dark); }
.mrp-trust a { color: inherit; }

/* "What Pro gives you" — the marks view */
.mrp-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; margin: 56px 0 0; padding: 32px; background: var(--ibm-surface); border: 1px solid var(--ibm-line); border-radius: 16px; box-shadow: var(--ibm-shadow); }
.mrp-feature h2 { margin: 0 0 10px; font-size: 1.45rem; color: var(--ibm-dark); letter-spacing: -0.3px; }
.mrp-feature p { margin: 0 0 12px; color: var(--ibm-ink-2); }
.mrp-marks { border: 1px solid var(--ibm-line); border-radius: 12px; overflow: hidden; font-size: 0.88rem; background: #fff; }
.mrp-marks-h { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; background: var(--ibm-surface-2); border-bottom: 1px solid var(--ibm-line); }
.mrp-marks-h b { color: var(--ibm-dark); }
.mrp-marks-h span { font-weight: 800; font-size: 1.1rem; color: var(--ibm-dark); font-variant-numeric: tabular-nums; }
.mrp-mark { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--ibm-line); }
.mrp-mark:last-child { border-bottom: 0; }
.mrp-mark code { font: 700 0.8rem ui-monospace, Menlo, monospace; color: var(--ibm-dark); background: var(--ibm-primary-soft); border-radius: 6px; padding: 2px 6px; text-align: center; }
.mrp-mark em { font-style: normal; color: var(--ibm-ink-2); }
.mrp-mark .y { color: var(--ibm-green); font-weight: 800; }
.mrp-feature .mrp-name { margin-bottom: 6px; color: var(--ibm-primary); }
.mrp-mark .n { color: var(--ibm-red); font-weight: 800; }
.mrp-marks-f { padding: 10px 14px; background: var(--ibm-amber-soft); color: #6b4200; font-size: 0.84rem; }
.mrp-caption { margin: 8px 0 0; font-size: 0.78rem; color: var(--ibm-muted); }

/* Comparison table */
.mrp-compare { margin: 56px 0 0; }
.mrp-compare h2 { margin: 0 0 14px; font-size: 1.45rem; color: var(--ibm-dark); letter-spacing: -0.3px; text-align: center; }
/* "What makes Math Revision different" (13 Oct 2026): one quiet card under the Free and Pro table. */
.mrp-diff { max-width: 760px; margin: 36px auto 0; padding: 22px 24px 8px; border: 1px solid var(--ibm-line); border-radius: 12px; background: #fff; }
.mrp-compare .mrp-diff h2 { font-size: 1.2rem; text-align: left; margin: 0 0 14px; }
.mrp-diff .mrp-list { margin: 0 0 14px; }
.mrp-diff .mrp-fine { text-align: left; margin: 0 0 14px; }
.mrp-table-wrap { overflow-x: auto; border: 1px solid var(--ibm-line); border-radius: 12px; background: #fff; }
.mrp-table { width: 100%; border-collapse: collapse; font-size: var(--ibm-text-sm); min-width: 340px; font-variant-numeric: tabular-nums; }
.mrp-table th, .mrp-table td { padding: 12px 14px; border-bottom: 1px solid var(--ibm-line); text-align: center; vertical-align: middle; }
.mrp-table th:first-child, .mrp-table td:first-child { text-align: left; color: var(--ibm-ink); }
.mrp-table thead th { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ibm-muted); background: var(--ibm-surface-2); }
.mrp-table thead th.is-featured { color: var(--ibm-dark); }
.mrp-table tbody tr:hover td { background: #fafbfd; }
.mrp-table tr:last-child td { border-bottom: 0; }
/* The tick / dash glyphs stay in the page for copy and paste (each has an
   aria-label); the eye sees the same SVG icons as the plan cards. */
.mrp-table .y, .mrp-table .n { display: inline-block; width: 18px; height: 18px; vertical-align: middle; font-size: 0; color: transparent; background: var(--mrp-ico-yes) center / contain no-repeat; }
.mrp-table .n { background-image: var(--mrp-ico-no); }

/* Plans & options (19 Oct 2026): the menu above the plans, the More options cards. */
.mro-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin: 4px auto 6px; }
.mro-menu a, .mro-card { background: var(--ibm-surface); border: 1px solid var(--ibm-line); }
.mro-menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: var(--ibm-r-pill); color: var(--ibm-primary); font: 600 .86rem var(--ibm-font); text-decoration: none; }
.mro-menu a:hover { border-color: var(--ibm-primary); }
.mro-menu a[hidden], .mro-card[hidden] { display: none; }
.mro { margin: 40px 0 0; font-family: var(--ibm-font); }
.mro h2 { margin: 0 0 16px; font-size: 1.45rem; color: var(--ibm-dark); text-align: center; }
.mro-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mro-card { display: flex; flex-direction: column; padding: 18px; border-radius: 14px; scroll-margin-top: 80px; }
.mro-card.is-match { outline: 2px solid var(--ibm-dark); }
.mro-title { margin: 6px 0; font-size: 1.08rem; color: var(--ibm-dark); }
.mro-line { margin: 0 0 16px; font-size: var(--ibm-text-sm); line-height: 1.5; color: var(--ibm-ink-2); }
.mro-card > .mrp-btn, .mro-act { margin-top: auto; }
.mro-act { min-height: 44px; display: flex; align-items: center; }

@media (max-width: 760px) {
  .mrp-feature { grid-template-columns: 1fr; padding: 22px 18px; gap: 20px; }
  .mrp-plan { padding: 26px 18px 18px; }
  .mrp-plan.is-featured { padding: 25px 17px 17px; }
  .mrp-for { min-height: 0; }
  .mrp-plan.is-featured { order: -1; }   /* the suggested plan first on phones */
}

/* Trial link under the pricing hero (alevel/igcse/cbse pricing pages; inline
   styled there): one line, always. Phones get a slightly smaller label. */
[data-testid="subscribe-trial-cta"] { white-space: nowrap; max-width: 100%; box-sizing: border-box; }
@media (max-width: 420px) {
  [data-testid="subscribe-trial-cta"] { font-size: 0.82rem !important; padding: 11px 12px !important; }
}

/* Touch screens (Oct 2026 tap targets): sign in / out, "Ask my parent to pay"
   (js/growth.js), the pass and compare links, and the A Level header (board
   switcher, logo) are at least 44px tall to tap. Mouse layouts are unchanged.
   The referral toggle does the same in js/referral-code.js. */
@media (pointer: coarse) {
  #signin-btn, #signout-btn, .mrg-link, .mrp-pass-open, header.topnav > .brand { min-height: 44px; }
  [data-testid="plans-compare-link"], .board-switcher a { display: inline-flex; align-items: center; min-height: 44px; padding-top: 0; padding-bottom: 0; }
  .board-switcher { padding-top: 0; padding-bottom: 0; }
}
