/*
    THE PRICING PAGE'S OWN STYLESHEET.

    Its consumer is Components/Pages/Marketing/Pricing.razor: a short head with the period switch
    beside it, the four plans on one row under it, the free plan's price list under them, the
    table that compares every plan, the data pack and the questions under it.

    ONE BOLD SURFACE AND EVERYTHING ELSE QUIET. The free plan's price list is the product's own dark
    surface - data-theme="dark" on the element re-declares every token for the subtree, as the
    landing page's ink band does - because it is the one thing on the page a reader has not seen on
    another vendor's. The plans, the table and the questions are the ordinary light surfaces,
    bordered rather than shadowed.

    A CAPABILITY A PLAN DOES NOT INCLUDE IS SHOWN, not omitted - the house dash in the comparison
    table - because the whole point of listing it is that the reader can see what they would gain.
    It is the same rule a waterfall step that did not apply is drawn by.

    WHAT IT DOES NOT OWN. .sv-toggle is the monthly/annual switch and the billing screen inside the
    application wears the same control, so it is a utility and stays in utilities.css. The table
    and its scroll box are DataTable's; this file only sets this table's own columns.
*/

/* ── The page ─────────────────────────────────────────────────────────────── */

.sv-pricing {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-7);
}

.sv-pricing__head {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-3);
}

.sv-pricing__head > * {
  margin: 0;
}

/* A HEADLINE IS A LINE, NOT A PARAGRAPH. Held short enough to break into two deliberate halves on a
   desk rather than run the width of the container. */
.sv-pricing__head > .sv-h1 {
  max-width: 24ch;
}

/* ── The plans ───────────────────────────────────────────────────────────── */

.sv-pricing__plans {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-5);
}

.sv-pricing__plans-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sv-space-4);
}

/* THE FOUR CARDS ARE ONE GRID OF ROWS. Each card is a subgrid spanning the same seven rows - the
   head, the audience, the price, the line under it, the button, the allowance and what it adds - so
   every price, button and allowance sits on one line across the row whatever any card's words run
   to. Seven is the number of direct children a card has; a child added to the card is a row added
   here. The row gap only ever falls between two sets of seven, where the cards wrap to two a row;
   inside a card the subgrid's own gap stands. */
.sv-plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sv-space-4);
}

.sv-plan {
  display: grid;
  grid-row: span 7;
  grid-template-rows: subgrid;
  row-gap: var(--sv-space-3);
  padding: var(--sv-space-5);
  background: var(--sv-bg-raised);
  border: 1px solid var(--sv-border-subtle);
  border-radius: var(--sv-radius-panel);
}

.sv-plan--featured {
  border-color: var(--sv-accent-fill);
}

.sv-plan > p {
  margin: 0;
}

.sv-plan__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sv-space-2);
}

.sv-plan__head > h2 {
  margin: 0;
}

/* The price is the one figure on the card at display size, in the mono every measured value
   wears. The unit sits on its baseline beside it. */
.sv-plan__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: var(--sv-space-1);
}

.sv-plan__figure {
  font: 400 30px/1.1 var(--sv-font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--sv-text);
}

.sv-plan__action {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-2);
}

/* THE ALLOWANCE, one ruled row each: the name ranged left and the figure right in mono. The same
   three rows on every card and in the band, so a reader compares down a column rather than across
   a sentence. */
.sv-plan__facts {
  margin: 0;
  border-top: 1px solid var(--sv-border-subtle);
}

.sv-plan__facts > div {
  display: flex;
  justify-content: space-between;
  gap: var(--sv-space-3);
  padding: var(--sv-space-2) 0;
  border-bottom: 1px solid var(--sv-border-subtle);
  font-size: 13px;
}

.sv-plan__facts dt {
  color: var(--sv-text-secondary);
}

.sv-plan__facts dd {
  margin: 0;
  color: var(--sv-text);
  font-family: var(--sv-font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sv-plan__includes {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-2);
}

.sv-plan__includes > p {
  margin: 0;
}

.sv-plan__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-2);
}

.sv-plan__features li {
  display: flex;
  gap: var(--sv-space-2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--sv-text-secondary);
}

.sv-plan__features li::before {
  content: '✓';
  flex: none;
  color: var(--sv-accent);
  font-family: var(--sv-font-mono);
}

/* A feature the plan does not carry: a dash in place of the tick, in the quieter ink. */
.sv-plan__features--absent li {
  color: var(--sv-text-tertiary);
}

.sv-plan__features--absent li::before {
  content: '-';
  color: var(--sv-text-tertiary);
}

/* What the prices are in and where the reference figures come from, once, under all four. */
.sv-pricing__provenance {
  margin: 0;
  max-width: 96ch;
}

/* ── What the free plan charges ───────────────────────────────────────────────

   THE WORDS, THEN THE SCHEDULE. A heading and one paragraph saying how the free plan charges and
   what a pack costs, then the tariff two entries a row, so the band runs the width of the cards
   over it rather than standing a seven-row column beside a short one. On a phone the schedule is
   one entry a row.

   data-theme flips the tokens, not the colour of the text already inherited from the page, so the
   band states its own. */
.sv-plan-free {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-5);
  padding: var(--sv-space-6);
  background: var(--sv-bg);
  color: var(--sv-text);
  border: 1px solid var(--sv-border);
  border-radius: var(--sv-radius-panel);
}

.sv-plan-free__intro,
.sv-plan-free__tariff {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sv-plan-free__intro {
  gap: var(--sv-space-2);
}

.sv-plan-free__tariff {
  gap: var(--sv-space-3);
}

.sv-plan-free__intro > *,
.sv-plan-free__tariff > .sv-label--section {
  margin: 0;
}

.sv-plan-free__intro > p {
  max-width: 76ch;
}

/* Two entries a row, ruled like a table: the rule over the first row spans both columns, and each
   entry carries the rule under it. */
.sv-plan-free__costs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--sv-space-6);
  margin: 0;
  border-top: 1px solid var(--sv-border);
}

.sv-plan-free__costs > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sv-space-4);
  padding: var(--sv-space-3) 0;
  border-bottom: 1px solid var(--sv-border-subtle);
}

/* The deliverable and, under it, what one payment covers - the line that answers "per what". */
.sv-plan-free__costs dt {
  min-width: 0;
  color: var(--sv-text);
}

.sv-plan-free__costs dt > span {
  display: block;
}

.sv-plan-free__costs dt > span + span {
  margin-top: 2px;
}

.sv-plan-free__costs dd {
  margin: 0;
  white-space: nowrap;
}

/* ── Compare every plan ───────────────────────────────────────────────────────

   READ ACROSS LIKE A DATASHEET. The first column is the row's name; every other column is a plan,
   centred over a tick, a dash or a figure. A group row names the block under it in the label
   face, the way a datasheet heads "Electrical" and "Mechanical". */
.sv-pricing__compare {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-4);
  margin-top: var(--sv-space-6);
}

.sv-pricing__compare > .sv-h2 {
  margin: 0;
}

.sv-pricing__table thead th:not(:first-child),
.sv-pricing__table tbody td {
  text-align: center;
}

.sv-pricing__table tbody th {
  padding: 10px var(--sv-space-3);
  text-align: left;
  font-weight: 400;
  color: var(--sv-text);
  border-bottom: 1px solid var(--sv-border-row);
}

.sv-pricing__table tbody td {
  white-space: nowrap;
}

/* The row heading takes the width; the plan columns share what is left equally. */
.sv-pricing__table thead th:first-child {
  width: 34%;
}

.sv-pricing__table .sv-pricing__group th {
  padding: var(--sv-space-4) var(--sv-space-3) var(--sv-space-2);
  background: var(--sv-bg-overlay);
  font: 600 10px/1.2 var(--sv-font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sv-text);
  border-bottom: 1px solid var(--sv-border-subtle);
}

.sv-pricing__tick {
  color: var(--sv-accent);
  font-family: var(--sv-font-mono);
}

.sv-pricing__dash {
  color: var(--sv-text-faint);
  font-family: var(--sv-font-mono);
}

/* ── The data pack ───────────────────────────────────────────────────────── */

.sv-pricing__pack {
  display: flex;
  flex-direction: column;
  gap: var(--sv-space-2);
}

.sv-pricing__pack > * {
  margin: 0;
}

/* ── The period switch, without a circuit ──────────────────────────────────

   THE PAGE IS SSR, and the switch is two radios and plain sibling combinators: the radios sit as
   direct siblings of the plans' head, the cards and the comparison, so `~` reaches everything that
   has to change. Nothing here needs a parent selector or a server.

   .sv-toggle IS A SHARED UTILITY and the billing screen inside the application wears the same
   control with real buttons. Its `button` rules are untouched; these mirror them onto the labels
   this page uses instead, which is why they live in the page's own stylesheet.

   THE RADIO STAYS FOCUSABLE. It is moved off-screen rather than display:none - a hidden input is
   not in the tab order, and the switch has to be operable from the keyboard. The focus ring is
   drawn on the label the focused radio names. */

.sv-period {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sv-toggle label {
  border: 0;
  background: transparent;
  color: var(--sv-text-secondary);
  padding: 6px 14px;
  border-radius: var(--sv-radius-pill);
  font: 500 12px/1 var(--sv-font-sans);
  cursor: pointer;
  user-select: none;
}

#sv-period-monthly:checked ~ .sv-pricing__plans-head .sv-toggle label[for="sv-period-monthly"],
#sv-period-annual:checked ~ .sv-pricing__plans-head .sv-toggle label[for="sv-period-annual"] {
  background: var(--sv-accent-fill);
  color: var(--sv-on-accent);
}

#sv-period-monthly:focus-visible ~ .sv-pricing__plans-head .sv-toggle label[for="sv-period-monthly"],
#sv-period-annual:focus-visible ~ .sv-pricing__plans-head .sv-toggle label[for="sv-period-annual"] {
  outline: 2px solid var(--sv-accent);
  outline-offset: 2px;
}

/* Both figures, both lines and both buttons are rendered; the switch decides which is shown. */
#sv-period-monthly:checked ~ * [data-period="annual"],
#sv-period-annual:checked ~ * [data-period="monthly"] {
  display: none;
}

/* ── Before you start ───────────────────────────────────────────────────────

   THE QUESTIONS UNDER THE PRICES, one ruled row each. Not .sv-explainer: that is the application's
   collapsed note, set in the mono label face, and a question a buyer is scanning for has to read as
   a sentence at the page's own scale. The marker is the explainer's, so the two disclosures in the
   product open the same way.

   HELD TO A READING MEASURE rather than the container, because an answer is prose and a
   1100-pixel line is the other way prose stops being read. */

.sv-faq {
  max-width: 820px;
  margin-top: var(--sv-space-5);
  border-top: 1px solid var(--sv-border-subtle);
}

.sv-faq + p {
  margin-top: var(--sv-space-5);
}

.sv-faq__item {
  border-bottom: 1px solid var(--sv-border-subtle);
}

.sv-faq__item > summary {
  display: flex;
  gap: var(--sv-space-3);
  margin: 0;
  padding: var(--sv-space-4) 0;
  cursor: pointer;
  list-style: none;
  color: var(--sv-text);
}

.sv-faq__item > summary::-webkit-details-marker {
  display: none;
}

.sv-faq__item > summary::before {
  content: "+";
  flex: none;
  width: 1rem;
  color: var(--sv-accent);
  font-family: var(--sv-font-mono);
}

.sv-faq__item[open] > summary::before {
  content: "-";
}

.sv-faq__item > summary:hover {
  color: var(--sv-accent);
}

/* Indented by the marker's own width plus the gap, so the answer hangs under the question's first
   word rather than under the marker. */
.sv-faq__answer {
  padding: 0 0 var(--sv-space-4) calc(1rem + var(--sv-space-3));
}

.sv-faq__answer p {
  margin: 0;
  max-width: 68ch;
  color: var(--sv-text-secondary);
}

.sv-faq__answer p + p {
  margin-top: var(--sv-space-3);
}

/* ── Narrower than four cards ───────────────────────────────────────────────

   BELOW THE WIDTH FOUR CARDS STAY READABLE, THEY GO TWO A ROW, and each pair still shares its seven
   rows, so the free plan sits beside Solo and the two it is weighed against most line up. */
@media (max-width: 1000px) {
  .sv-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ON A PHONE THE CARDS STACK, and the subgrid goes with them: a row shared by one card is no row at
   all, and a stacked card is a column of its own content. The band's schedule goes one entry a row.

   THE TABLE SCROLLS AND ITS ROW NAMES STAY. Four plan columns do not fit 390 pixels, so the table
   scrolls sideways inside its own box as every readout does - and the column naming each row is
   pinned, or the second plan column arrives with nothing beside it to say what it is a figure of. A
   group row spans the table and is left to scroll with it. */
@media (max-width: 620px) {
  .sv-pricing {
    gap: var(--sv-space-6);
  }

  .sv-plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .sv-plan {
    display: flex;
    flex-direction: column;
    grid-row: auto;
  }

  .sv-plan-free {
    padding: var(--sv-space-5);
  }

  .sv-plan-free__costs {
    grid-template-columns: minmax(0, 1fr);
  }

  .sv-pricing__table thead th:first-child {
    left: 0;
    z-index: 2;
  }

  /* Narrow enough that two plan columns stand beside it on the narrowest phone; a long name wraps
     inside it rather than widening it. */
  .sv-pricing__table thead th:first-child,
  .sv-pricing__table tbody tr:not(.sv-pricing__group) > th {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
  }

  .sv-pricing__table tbody tr:not(.sv-pricing__group) > th {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--sv-bg);
    border-right: 1px solid var(--sv-border-subtle);
  }

  /* The group row spans the table, so its words would scroll away with it: they are pinned inside
     their own cell instead. */
  .sv-pricing__group th > span {
    display: inline-block;
    position: sticky;
    left: var(--sv-space-3);
  }
}
