/*
  extops.dev/pricing (EP-265). Loaded after landing.css and uses its tokens (BRANDBOOK §3–§5); nothing
  here hardcodes a colour. The month/year switch is two radio inputs at the top of <main> and the
  sibling selectors below: no script, so the page works under script-src 'self' with JS off.
*/

/* --- month / year ------------------------------------------------------------------------------ */
.pr-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

#pr-month:checked ~ section .pr-y,
#pr-year:checked ~ section .pr-m {
  display: none;
}

.pr-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 24px;
}

.pr-toggle-label {
  color: var(--fg2);
  font-size: 12px;
  font-weight: 600;
}

.pr-seg {
  display: inline-flex;
  padding: 3px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pr-seg label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: var(--fg2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.pr-seg label:hover {
  color: var(--fg);
}

#pr-month:checked ~ .pr-plans label[for='pr-month'],
#pr-year:checked ~ .pr-plans label[for='pr-year'] {
  color: var(--fg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

#pr-month:focus-visible ~ .pr-plans label[for='pr-month'],
#pr-year:focus-visible ~ .pr-plans label[for='pr-year'] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pr-gift {
  padding: 3px 10px;
  color: var(--success-text);
  background: var(--soft-success);
  border-radius: var(--r-full, 999px);
  font-size: 12px;
  font-weight: 700;
}

/* --- hero -------------------------------------------------------------------------------------- */
.pr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 48px;
  align-items: start;
  padding-bottom: 72px;
}

.pr-crumbs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--fg2);
  font-size: 12px;
}

.pr-crumbs a {
  color: var(--fg2);
}

.pr-crumbs a:hover {
  color: var(--fg);
}

.pr-subscribe {
  margin-top: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 14px;
  box-shadow: var(--sh-md);
}

.pr-subscribe h2 {
  font-size: 17px;
  line-height: 24px;
}

.pr-subscribe > p {
  margin: 10px 0 0;
  color: var(--fg2);
  line-height: 21px;
}

.pr-steps {
  display: grid;
  gap: 10px;
  margin: 18px 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: pr-step;
}

.pr-steps li {
  position: relative;
  padding-left: 34px;
  line-height: 21px;
  counter-increment: pr-step;
}

.pr-steps li::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  content: counter(pr-step);
  color: var(--accent-text);
  background: var(--soft-accent);
  border-radius: 999px;
  font-family: 'JBMono', ui-monospace, monospace;
  font-size: 11px;
}

.pr-subscribe .button {
  width: 100%;
}

/* --- plan cards -------------------------------------------------------------------------------- */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.pr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.pr-card.is-reco {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--sh-md);
}

.pr-ribbon {
  position: absolute;
  top: -11px;
  left: 22px;
  padding: 2px 10px;
  color: var(--accent-ink);
  background: var(--accent-fill);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

.pr-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pr-card-head img {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
}

.pr-card-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
}

.pr-card-head p {
  /* Two lines on every card, so the four prices sit on one line. */
  min-height: 34px;
  margin: 2px 0 0;
  color: var(--fg2);
  font-size: 12px;
  line-height: 17px;
}

.pr-price {
  margin: 20px 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.pr-price-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.pr-price-main b {
  font-family: 'JBMono', ui-monospace, monospace;
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.03em;
}

.pr-price-main > span {
  color: var(--fg2);
  font-size: 13px;
}

.pr-price-sub {
  min-height: 21px;
  margin: 4px 0 0;
  color: var(--fg2);
  font-size: 12px;
}

.pr-diffs {
  display: grid;
  gap: 9px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.pr-diffs li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  line-height: 19px;
}

.pr-diffs .pr-diffs-base {
  display: block;
  color: var(--fg2);
  font-size: 12px;
  font-weight: 600;
}

.pr-check {
  margin-top: 2px;
  color: var(--success-text);
  vertical-align: -3px;
}

.pr-extra {
  margin: 0 0 18px;
  padding: 10px 12px;
  color: var(--fg2);
  background: var(--surface2);
  border-radius: 8px;
  font-size: 12px;
  line-height: 18px;
}

.pr-cta {
  width: 100%;
  margin-top: auto;
}

.pr-foot {
  margin: 20px 0 0;
  color: var(--fg2);
  font-size: 12px;
}

/* --- what each plan is for --------------------------------------------------------------------- */
.pr-fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pr-fit-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.pr-fit-card img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.pr-fit-card h3 {
  margin: 0 0 6px;
}

.pr-fit-card p {
  margin: 0;
  color: var(--fg2);
  line-height: 21px;
}

/* --- comparison -------------------------------------------------------------------------------- */
.pr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--fg2);
  font-size: 12px;
}

.pr-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pr-legend .pr-check {
  margin: 0;
}

.pr-trial {
  margin: 12px 0 20px;
  color: var(--fg2);
  font-size: 13px;
}

.pr-no {
  color: var(--fg2);
}

.pr-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 18px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pr-tag.is-soon {
  color: var(--accent-text);
  background: var(--soft-accent);
}

.pr-tag.is-free {
  color: var(--success-text);
  background: var(--soft-success);
}

.pr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 13px;
}

.pr-table th,
.pr-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.pr-table td {
  width: 15%;
  font-variant-numeric: tabular-nums;
}

.pr-table td.is-reco,
.pr-table thead th.is-reco {
  background: color-mix(in srgb, var(--soft-accent) 60%, transparent);
}

/* The plan header follows the reader down the table (the sticky site bar is 72 px). */
.pr-table thead th {
  position: sticky;
  top: 72px;
  z-index: 2;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
  font-family: 'JBMono', ui-monospace, monospace;
  font-size: 14px;
}

.pr-table thead th.is-reco {
  background: color-mix(in srgb, var(--accent-fill) 14%, var(--surface));
}

.pr-table thead th:first-child {
  border-top-left-radius: 14px;
  color: var(--fg2);
  font-family: inherit;
  font-size: 12px;
}

.pr-table thead th:last-child {
  border-top-right-radius: 14px;
}

.pr-table thead small {
  display: block;
  margin-top: 2px;
  color: var(--fg2);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.pr-reco-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-left: 4px;
  vertical-align: 2px;
  background: var(--accent-fill);
  border-radius: 999px;
}

.pr-grp th {
  padding-top: 22px;
  color: var(--accent-text);
  background: transparent;
  font-family: 'JBMono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pr-grp th span {
  margin-left: 8px;
  color: var(--fg2);
  font-weight: 500;
}

.pr-table tbody th[scope='row'] {
  font-weight: 600;
}

.pr-row-label {
  display: inline;
}

.pr-row-label .pr-tag {
  margin-left: 6px;
  vertical-align: 1px;
}

.pr-table tbody th small {
  display: block;
  margin-top: 3px;
  color: var(--fg2);
  font-size: 12px;
  font-weight: 400;
  line-height: 17px;
}

.pr-table tbody:last-of-type tr:last-child > * {
  border-bottom: 0;
}

/* --- small screens ----------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .pr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .pr-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .pr-fit-grid {
    grid-template-columns: 1fr;
  }
}

/* A phone: the table becomes one card per row, the four plan values side by side under the label,
   each named by its plan (data-plan), so nothing scrolls sideways. */
@media (max-width: 700px) {
  .pr-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .pr-table,
  .pr-table tbody {
    display: block;
  }

  .pr-table {
    border-radius: 12px;
  }

  .pr-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .pr-table tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
  }

  .pr-table tbody:last-of-type tr:last-child {
    border-bottom: 0;
  }

  .pr-table th,
  .pr-table td {
    border-bottom: 0;
  }

  .pr-table tbody th[scope='row'],
  .pr-grp th {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }

  .pr-table td {
    width: auto;
    padding: 4px 10px 12px 14px;
    overflow-wrap: anywhere;
  }

  .pr-table td::before {
    display: block;
    margin-bottom: 2px;
    content: attr(data-plan);
    color: var(--fg2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .pr-table td.is-reco {
    background: transparent;
  }

  .pr-table td.is-reco::before {
    color: var(--accent-text);
  }
}
