/* ── Legal pages (terms, privacy, cookies, contact) ──
   A readable document column on the app's tokens: tabs between the four documents, the landing's type for the title,
   comfortable prose, and tables that scroll sideways on a phone instead of breaking the page. */

.legal { width: 100%; max-width: 820px; margin: 0 auto; padding: 32px 24px 96px; }
.legal-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 32px; padding: 4px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); }
.legal-tabs a { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.legal-tabs a:hover { color: var(--text); }
.legal-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.legal-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.legal-draft { margin: 0 0 28px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--amber) 55%, var(--line)); border-radius: 10px;
  background: var(--amber-soft); color: var(--text); font-size: 13.5px; line-height: 1.5; }

.legal-doc { color: var(--text-2); font-size: 15px; line-height: 1.7; }
.legal-doc h1 { margin: 10px 0 6px; font-size: clamp(32px, 4vw, 44px); font-weight: 740; letter-spacing: -0.04em; line-height: 1.05; color: var(--text); }
.legal-updated { margin: 0 0 28px; font-family: var(--mono-font); font-size: 12px; color: var(--text-3); }
.legal-lede { font-size: 17px; color: var(--text); }
.legal-doc h2 { margin: 40px 0 10px; font-size: 20px; font-weight: 680; letter-spacing: -0.02em; color: var(--text); scroll-margin-top: 72px; }
.legal-doc p { margin: 0 0 14px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px; padding-left: 22px; }
.legal-doc ul { list-style: disc; }
.legal-doc ol { list-style: decimal; }
.legal-doc li { margin: 4px 0; }
.legal-doc b { color: var(--text); font-weight: 600; }
.legal-doc code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; color: var(--text); overflow-wrap: anywhere; }
.legal-doc a { overflow-wrap: anywhere; }
.legal-doc p a, .legal-doc li a { text-decoration: underline; text-underline-offset: 2px; } /* a link in text is told apart without colour (axe link-in-text-block) */
.legal-doc a.btn { text-decoration: none; }

.legal-table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.legal-table th { text-align: left; padding: 10px 14px; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.legal-table td { padding: 12px 14px; vertical-align: top; border-top: 1px solid var(--line); min-width: 140px; }
.legal-table tr:first-child td { border-top: 0; }
.legal-table code { white-space: nowrap; overflow-wrap: normal; } /* a cookie name reads whole; the table scrolls instead */

.legal-facts { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.legal-facts > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; padding: 10px 14px; border-top: 1px solid var(--line); }
.legal-facts > div:first-child { border-top: 0; }
.legal-facts dt { color: var(--text-3); font-size: 13.5px; }
.legal-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* Links to the documents from the sign-in forms and the landing footer */
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-3); }
.legal-links a { color: var(--text-3); }
.legal-links a:hover { color: var(--text); }
/* In the account area: under the settings rail (hidden where the rail turns into tabs — Personal data links them too) */
.account-rail .legal-links { padding: 14px 20px 18px 20px; border-top: 1px solid var(--line); }
.auth-consent { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }

@media (max-width: 760px) {
  .legal { padding: 20px 16px 64px; }
  .legal-tabs a { flex-basis: calc(50% - 4px); }
  .legal-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 900px) {
  .account-rail .legal-links { display: none; }
}

/* Pricing page as a plan chooser (spec docs/specs/pricing-and-refund-pages.md AC9). Two plan cards on the flat-sheet grammar (a bordered surface, no shadow), Premium marked by the one orange accent.
   The Monthly / Yearly choice is two radio inputs before the cards: CSS shows the matching price and button, so it needs no script. */
.pricing-page { max-width: 980px; }
.pricing-head { text-align: center; margin: 0 0 28px; }
.pricing-head .legal-lede { max-width: 56ch; margin: 0 auto; }
.plan-chooser { position: relative; margin: 0 0 40px; }
.bill-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.price-card h2 { margin: 0 0 10px; font-size: 18px; }
.plan-premium { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.price-line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: var(--text); }
.price-amount { font-size: 34px; font-weight: 740; letter-spacing: -0.03em; line-height: 1.1; }
.price-per { color: var(--text-3); font-size: 14px; }
.legal-doc .price-card .price-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--text-3); }
.legal-doc .price-card .price-saving { color: var(--text-2); }
.plan-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; letter-spacing: 0; }
/* The trial, first thing on the Premium card: a large line above the price (the length is Paddle's), and one honest line under the button. */
.legal-doc .trial-lede { margin: 6px 0 0; font-size: 17px; font-weight: 650; color: var(--brand-text, var(--text)); }
.legal-doc .price-card .trial-badge { display: inline-block; align-self: flex-start; margin: 0 0 10px; padding: 5px 14px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.legal-doc .price-card .trial-note { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.legal-doc .plan-lead { margin: 18px 0 8px; font-weight: 600; color: var(--text); }
.legal-doc ul.plan-features { list-style: none; margin: 16px 0 20px; padding: 0; }
.plan-premium ul.plan-features { margin-top: 0; }
.plan-features li { position: relative; margin: 0 0 8px; padding-left: 24px; color: var(--text-2); }
.plan-features li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
.price-action { margin-top: auto; }
.price-action form { margin: 0; }
.btn-block { display: flex; width: 100%; justify-content: center; align-items: center; height: 42px; font-size: 14.5px; font-weight: 600; margin: 0 0 8px; }
.plan-toggle { display: inline-flex; align-self: flex-start; padding: 3px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.plan-toggle label { padding: 5px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
#bill-year:checked ~ .plan-grid label[for="bill-year"],
#bill-month:checked ~ .plan-grid label[for="bill-month"] { background: var(--brand); color: var(--on-brand); }
#bill-year:focus-visible ~ .plan-grid label[for="bill-year"],
#bill-month:focus-visible ~ .plan-grid label[for="bill-month"] { outline: 2px solid var(--text); outline-offset: 2px; }
#bill-year:checked ~ .plan-grid .when-month,
#bill-month:checked ~ .plan-grid .when-year { display: none; }
.purchase-renewal, .purchase-consent { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.purchase-renewal a, .purchase-consent a, .plan-trust a, .faq a { text-decoration: underline; text-underline-offset: 2px; } /* a link in text is told apart without colour (axe link-in-text-block) */
.purchase-renewal { margin: 0 0 10px; }
.purchase-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; }
.purchase-consent input { margin-top: 3px; flex: none; }
.legal-doc ul.plan-trust { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.plan-trust li { margin: 0 0 4px; }
.faq details { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.faq summary { padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--text); }
.faq summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
.faq details > p { margin: 0; padding: 0 14px 14px; }
.plan-closing { margin: 40px 0 0; padding: 24px; text-align: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.plan-closing h2 { margin-top: 0; }
@media (max-width: 760px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-premium { order: -1; }
  .price-card { padding: 18px 16px 16px; }
}

/* Cookie choice about Microsoft Clarity (spec docs/specs/cookie-consent.md). A quiet card at the bottom-left, not a modal, so the page stays usable;
   Accept and Reject share one style on purpose: neither is the highlighted answer. */
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.lp-footer .linklike { color: var(--text-2); }
.legal-links .linklike { color: var(--text-3); }
.linklike:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cookie-banner { position: fixed; z-index: 40; left: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); padding: 16px 18px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-md, 10px); box-shadow: 0 6px 24px rgb(0 0 0 / 12%); font-size: 13.5px; line-height: 1.5; }
.cookie-banner[hidden] { display: none; }
.cookie-banner h2 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.cookie-banner p { margin: 0 0 12px; color: var(--text-2); }
.cookie-banner a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-btn { flex: 1 1 0; min-height: 38px; padding: 0 14px; font: inherit; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.cookie-btn:hover { background: var(--surface-3); }
.cookie-btn:focus-visible, .cookie-banner h2:focus-visible, .linklike:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.public-foot { max-width: 1100px; margin: 0 auto; padding: 28px 24px 36px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .cookie-banner { left: 8px; right: 8px; bottom: 8px; width: auto; }
}
