/* ==========================================================================
   Pricing page (pricing.html). Agent Guru plans (agp- classes, from the
   shared Agent Guru pricing page) plus the Agent Jasmine and pay-online
   panels (prc- classes). Loads after styles.css. Every rule is scoped to
   .page-pricing or uses an agp- / prc- class. Tokens only: no raw colour
   values, no priority overrides. System breakpoints: 1180, 1080, 920, 760, 520, 420.
   ========================================================================== */

/* Unlayered page CSS beats the system's [hidden] utility, so restate it */
.page-pricing [hidden] { display: none; }

/* --------------------------------------------------------------------------
   Header block: kicker + H1 left, intro right (anchored to the 12-col grid)
   -------------------------------------------------------------------------- */
.agp-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--space-5);
  align-items: end;
}
.agp-head > * { grid-column: 1 / -1; min-width: 0; }
.agp-head__title > span { display: block; }
.agp-head__intro { max-width: 44ch; }
@media (min-width: 921px) {
  .agp-head > :first-child { grid-column: 1 / span 7; }
  .agp-head > :last-child { grid-column: 8 / span 5; }
}

/* Toolbar: billing control left, terms note right */
.agp-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
}
.agp-toolbar__note { max-width: 46ch; font-size: var(--fs-small); line-height: 1.55; color: var(--fg-2); }

.agp-billing__legend { margin-bottom: 8px; font-size: var(--fs-caption); font-weight: 600; color: var(--fg-2); }

/* --------------------------------------------------------------------------
   Segmented radio control (native radios: arrow keys, one tab stop)
   -------------------------------------------------------------------------- */
.agp-seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 3px; padding: 3px;
  background: var(--bg-muted);
  border: 1px solid var(--line-2); border-radius: var(--radius-3);
}
.agp-seg--block { display: grid; width: 100%; }
.agp-seg__opt {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 44px; padding: 7px 16px;
  border-radius: var(--radius-2);
  cursor: pointer;
  line-height: 1.25;
  transition: background-color .15s ease, color .15s ease;
}
.agp-seg__opt input {
  position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;
}
.agp-seg__text { font-size: var(--fs-small); font-weight: 600; color: var(--fg); }
.agp-seg__opt small { margin-top: 2px; font-size: var(--fs-caption); color: var(--fg-2); }
.agp-seg__opt:hover { background: var(--bg-hover); }
/* Selected: the brand indigo of the primary button, white text (14.8:1),
   the same on paper and alt bands */
.agp-seg__opt.is-checked,
.agp-seg__opt:has(input:checked) { background: var(--btn-bg); }
.agp-seg__opt.is-checked .agp-seg__text,
.agp-seg__opt:has(input:checked) .agp-seg__text,
.agp-seg__opt.is-checked small,
.agp-seg__opt:has(input:checked) small { color: var(--btn-fg); }
.agp-seg__opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.agp-seg--block .agp-seg__opt { align-items: center; text-align: center; padding-inline: 10px; }

@media (max-width: 520px) {
  .agp-billing { width: 100%; }
  .agp-billing .agp-seg { display: grid; width: 100%; grid-auto-columns: auto; }
  .agp-seg__opt { padding-inline: 12px; }
}

/* --------------------------------------------------------------------------
   Plan cards. On desktop the cards share rows through subgrid, so the name,
   price, button and inclusions line up across all three.
   -------------------------------------------------------------------------- */
.agp-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--col-gap);
  margin-top: var(--space-6);
}
.agp-plan {
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 0 var(--space-5) var(--space-5);
  background: var(--bg-raised);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  scroll-margin-top: calc(var(--bar-h) + 24px);
}
.agp-plan__head { padding-top: var(--space-5); }

.agp-plan__price {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.agp-plan__buy { padding-top: var(--space-5); }
.agp-plan__min {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: var(--space-4);
  font-size: var(--fs-small); font-weight: 500;
}
.agp-plan__min .i { color: var(--mark); }

/* "Talk to sales" link under the Buy online button */
.agp-plan__sales { margin-top: var(--space-3); font-size: var(--fs-small); text-align: center; }
.agp-plan__sales .arrow-link { color: var(--fg); }

.agp-plan__incl { padding-top: var(--space-6); }
.agp-plan__incl-h { padding-bottom: 8px; font-size: var(--fs-small); font-weight: 600; }
.agp-plan__incl .plan__features { margin-top: 0; }
.agp-plan__incl .plan__features li:last-child { border-bottom: 1px solid var(--line); }
.agp-plan__note {
  margin-top: var(--space-4);
  padding: 12px 14px;
  background: var(--mark-soft);
  border: 1px solid var(--mark-soft-line); border-radius: var(--radius-3);
  font-size: var(--fs-small); line-height: 1.55; color: var(--fg);
}

@supports (grid-template-rows: subgrid) {
  @media (min-width: 921px) {
    .agp-plans { grid-template-rows: repeat(4, auto); }
    .agp-plan { grid-row: span 4; display: grid; grid-template-rows: subgrid; row-gap: 0; }
    .agp-plan__head { grid-row: 1; align-self: start; }
    .agp-plan__price { grid-row: 2; }
    .agp-plan__buy { grid-row: 3; align-self: end; }
    .agp-plan__incl { grid-row: 4; }
  }
}

@media (max-width: 1080px) {
  .agp-plan { padding: 0 var(--space-4) var(--space-4); }
}
@media (max-width: 920px) {
  .agp-plans { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-5); }
  .agp-plan { padding: 0 var(--space-5) var(--space-5); }
}
@media (max-width: 420px) {
  .agp-plan { padding: 0 var(--space-4) var(--space-4); }
}

/* Price blocks: one per billing option. Without JS both show, labelled.
   With JS (.agp-js) only the selected billing shows; the label stays for
   screen readers and the other price is named underneath. */
.agp-bill__label { margin-bottom: 6px; font-size: var(--fs-caption); font-weight: 600; color: var(--fg-2); }
.agp-bill__amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.agp-bill__fig {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.75rem, 2.2rem + 1.4vw, 3.75rem); line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: lining-nums;
}
.agp-bill__unit { font-size: var(--fs-small); color: var(--fg-2); }
.agp-bill__basis { margin-top: 10px; font-size: var(--fs-small); font-weight: 500; line-height: 1.45; }
.agp-bill__other { margin-top: 4px; font-size: var(--fs-caption); line-height: 1.5; color: var(--fg-2); }
.agp-bill__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.agp-bill__facts > div { padding-top: 10px; min-width: 0; }
.agp-bill__facts > div + div { padding-left: var(--space-4); border-left: 1px solid var(--line); }
.agp-bill__facts dt { font-size: var(--fs-caption); line-height: 1.4; color: var(--fg-2); }
.agp-bill__facts dd { margin-top: 2px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; font-variant-numeric: lining-nums; }

.page-pricing:not(.agp-js) .agp-bill__other { display: none; }
.page-pricing:not(.agp-js) .agp-bill + .agp-bill { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.page-pricing.agp-js[data-billing="annual"] .agp-bill[data-bill="monthly"],
.page-pricing.agp-js[data-billing="monthly"] .agp-bill[data-bill="annual"] { display: none; }
.page-pricing.agp-js .agp-bill__label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.agp-billnote { margin-top: var(--space-6); }

/* --------------------------------------------------------------------------
   Comparison table. Desktop: plan header row sticks below the site bar.
   Small screens: scrolls inside its own region; the row labels stay put.
   -------------------------------------------------------------------------- */
.agp-compare { border-collapse: separate; border-spacing: 0; }
.agp-compare .agp-col-label { width: 40%; }
.agp-compare thead th { background: var(--bg); }
.agp-compare__sub { display: block; margin-top: 4px; font-size: var(--fs-caption); font-weight: 400; color: var(--fg-2); }
.agp-compare__note { display: block; margin-top: 2px; font-size: var(--fs-caption); font-weight: 400; line-height: 1.45; color: var(--fg-2); }
.agp-compare__group { display: inline-block; position: sticky; left: 0; }
.agp-compare tbody th { line-height: 1.45; }
.agp-compare tbody th, .agp-compare tbody td { vertical-align: baseline; }
.agp-compare td.agp-all { color: var(--fg-2); }
.agp-compare .agp-yes { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; color: var(--mark); }
.agp-compare .mx--no { vertical-align: 0.3em; }
.agp-compare tbody:first-of-type tr.compare__group th { padding-top: 18px; }
.agp-compare tfoot td { padding: var(--space-5) 12px 0; border-bottom: 0; vertical-align: top; }
.agp-compare tfoot td:first-child { padding-left: 0; }

/* Sticky plan header row. Desktop without JS; any width where the script
   measured that the table fits ([data-fits]). */
.page-pricing .agp-compare-scroll[data-fits] { overflow: visible; }
.agp-compare-scroll[data-fits] .agp-compare thead th { position: sticky; top: var(--bar-h); z-index: 2; }
@media (min-width: 921px) {
  .page-pricing .agp-compare-scroll { overflow: visible; }
  .agp-compare thead th { position: sticky; top: var(--bar-h); z-index: 2; }
}

/* When it has to scroll (very narrow or zoomed): row labels stay put */
.agp-compare-scroll[data-scrollable] .agp-compare thead th:first-child,
.agp-compare-scroll[data-scrollable] .agp-compare tbody th[scope="row"],
.agp-compare-scroll[data-scrollable] .agp-compare tfoot td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--bg);
  box-shadow: 1px 0 0 var(--line);
}

@media (max-width: 920px) {
  .agp-compare thead th, .agp-compare td { padding-inline: 10px; }
  .agp-compare .compare__plan { font-size: 1.25rem; }
  .agp-compare td strong { font-size: 1.1875rem; }
}
/* Phones: the whole table fits the screen, so all three plans compare at a glance */
@media (max-width: 760px) {
  .agp-compare { min-width: 0; }
  .agp-compare .agp-col-label { width: 36%; }
}
@media (max-width: 520px) {
  .agp-compare { font-size: var(--fs-caption); }
  .agp-compare thead th { padding: 10px 6px 9px; }
  .agp-compare thead th:first-child { padding-left: 0; }
  .agp-compare td { padding: 10px 6px; }
  .agp-compare tbody th { padding: 10px 8px 10px 0; font-size: var(--fs-caption); }
  .agp-compare .agp-col-label { width: 40%; }
  .agp-compare thead th:not(:first-child) { padding-inline: 4px; }
  .agp-compare .compare__plan { font-size: 0.9375rem; }
  .agp-compare__sub,
  .agp-compare td .agp-unit {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .agp-compare td strong { font-size: 1.0625rem; }
  .agp-compare__note { font-size: var(--fs-micro); }
  .agp-compare .agp-yes { width: 14px; height: 14px; }
  .agp-compare .mx--no { width: 10px; }
  /* The plan cards and the closing band carry these buttons on phones */
  .agp-compare tfoot { display: none; }
}

.agp-scroll-hint { margin-bottom: var(--space-3); font-size: var(--fs-caption); color: var(--fg-2); }

/* Terms under the table */
.agp-terms { margin-top: clamp(40px, 5vw, 64px); padding-top: var(--space-5); border-top: 1px solid var(--rule); }
.agp-terms .steps { border-top: 0; }
.agp-terms .steps > li:first-child { padding-top: 6px; }
.agp-terms .steps > li:first-child::before { top: 3px; }
.agp-terms .steps a { color: var(--fg); }

/* --------------------------------------------------------------------------
   Agent Jasmine and pay-online panels, side by side on desktop
   -------------------------------------------------------------------------- */
.prc-duo {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--col-gap);
}
.prc-card {
  display: flex; flex-direction: column; min-width: 0;
  padding: clamp(22px, 2.6vw, 36px);
  background: var(--bg-raised);
  border: 1px solid var(--line-2); border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
}
.prc-card__kicker { font-size: var(--fs-small); font-weight: 600; line-height: 1.4; color: var(--accent); }
.prc-card__title { margin-top: var(--space-3); }
.prc-card__lead { margin-top: var(--space-4); max-width: 52ch; font-size: var(--fs-body); line-height: 1.55; color: var(--fg-2); }
.prc-card__spec { margin-top: var(--space-5); }
.prc-card__checks { margin-top: var(--space-4); }
.prc-card__actions { margin-top: auto; padding-top: var(--space-6); }
.prc-card__more {
  display: flex; align-items: center; gap: 8px;
  margin-top: var(--space-4); font-size: var(--fs-small); color: var(--fg-2);
}
.prc-card__more .arrow-link { color: var(--fg); }
.prc-card__more > .i { color: var(--mark); }
@media (max-width: 920px) {
  .prc-duo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .prc-card__actions .btn { flex: 1 1 100%; }
}
