/* ──────────────────────────────────────────────────────────────────
   Plan Builder  (/get-started)
   Plan picker + asset selector + live pricing summary.
   Extends the site design system in styles.css — every colour, radius
   and shadow here comes from the tokens defined there. Loaded only by
   get-started.html and es/get-started.html.
   ────────────────────────────────────────────────────────────────── */

.pb-wrap { max-width: 920px; margin-inline: auto; }

/* Screen-reader-only text (labels for controls that read visually) */
.pb-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Steps ───────────────────────────────────────────────────────── */
.pb-step { margin-bottom: 2.75rem; border: 0; padding: 0; min-width: 0; }
.pb-step-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .35rem; }
.pb-step-num {
  width: 32px; height: 32px;
  flex-shrink: 0;
  background: var(--g700);
  color: var(--white);
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .92rem;
}
.pb-step-head h2 { font-size: 1.22rem; font-weight: 800; color: var(--ink); line-height: 1.25; }
.pb-step-sub {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.1rem 2.8rem;
}
@media (max-width: 600px) { .pb-step-sub { margin-left: 0; } }

/* ── Step 1 · Plan cards ─────────────────────────────────────────── */
.pb-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: stretch;
}
.pb-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  /* 2px on every card, selected or not, so switching plans only changes the
     colour — never the box size, which would shift the row. */
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.35rem 1.35rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.pb-plan:hover { border-color: var(--g400); }
/* The radio stays in the accessibility tree and keeps keyboard focus —
   it is only visually hidden, never display:none. */
.pb-plan input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
  pointer-events: none;
}
/* The selected plan has to be readable at a glance from across the row: a
   solid green edge, a wide ring, a tinted face and a tick. */
.pb-plan:has(input:checked),
.pb-plan.is-selected {
  border-color: var(--g500);
  background: var(--g50);
  box-shadow: 0 0 0 5px rgba(0,166,81,.20), var(--shadow);
}
.pb-plan:has(input:checked)::before,
.pb-plan.is-selected::before {
  content: '\2713';
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--g500);
  color: var(--white);
  font-size: .85rem;
  font-weight: 800;
  line-height: 26px;
  text-align: center;
}
.pb-plan:focus-within { outline: 3px solid rgba(0,122,66,.35); outline-offset: 2px; }

.pb-plan-badge {
  position: absolute;
  z-index: 2;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: var(--g500);
  color: var(--white);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .26rem .85rem;
  border-radius: 999px;
  white-space: nowrap;
}
/* The plan name is the radio's <label>. It is written last in the source
   (so its stretched ::after paints over the rest of the card and makes
   the whole card a click target) and pulled back to the top with order. */
.pb-plan-name {
  order: -1;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g600);
  margin-bottom: .45rem;
}
.pb-plan-name::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}
.pb-plan-price {
  display: flex;
  align-items: baseline;
  gap: .15rem;
  flex-wrap: wrap;
  padding-bottom: .9rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.pb-plan-price-currency {
  font-size: 1.15rem; font-weight: 700; color: var(--ink2);
  align-self: flex-start; margin-top: .35rem; line-height: 1;
}
.pb-plan-price-amount {
  font-size: 2.4rem; font-weight: 900; color: var(--ink);
  letter-spacing: -.04em; line-height: 1;
}
.pb-plan-price-period {
  font-size: .82rem; color: var(--muted); font-weight: 500;
  align-self: flex-end; padding-bottom: .2rem;
}
/* Visits a year — the thing the tier actually buys. */
.pb-plan-visits {
  font-size: .82rem;
  font-weight: 800;
  color: var(--g700);
  margin: -.4rem 0 .9rem;
}
.pb-plan-features { list-style: none; flex: 1; margin-bottom: 1rem; }
.pb-plan-features li {
  font-size: .85rem;
  color: var(--ink2);
  padding: .34rem 0;
  border-bottom: 1px solid var(--g50);
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  line-height: 1.45;
}
.pb-plan-features li::before {
  content: '✓';
  color: var(--g500);
  font-weight: 800;
  font-size: .82rem;
  flex-shrink: 0;
  margin-top: .08rem;
}
.pb-plan-features li.pb-plan-divider {
  font-size: .72rem; font-weight: 700; color: var(--muted);
  letter-spacing: .05em; text-transform: uppercase;
  border-bottom: none;
}
.pb-plan-features li.pb-plan-divider::before { display: none; }
.pb-plan-assets {
  display: inline-flex;
  align-self: flex-start;
  background: var(--g100);
  color: var(--g700);
  border-radius: var(--radius-sm);
  padding: .38rem .78rem;
  font-size: .84rem;
  font-weight: 700;
}

/* ── Billing toggle ──────────────────────────────────────────────── */
.pb-billing {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.5rem;
  font-size: .92rem;
  color: var(--ink2);
  font-weight: 600;
}
.pb-switch {
  position: relative;
  width: 50px; height: 28px;
  flex-shrink: 0;
  background: var(--line);
  border: none;
  border-radius: 999px;
  padding: 0;
  transition: background var(--transition);
}
.pb-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.pb-switch[aria-checked="true"] { background: var(--g500); }
.pb-switch[aria-checked="true"]::after { transform: translateX(22px); }
.pb-switch:focus-visible { outline: 3px solid rgba(0,122,66,.35); outline-offset: 2px; }
.pb-save { color: var(--g600); font-weight: 800; }

/* ── Step 2 · Asset categories ───────────────────────────────────── */
.pb-search { margin-bottom: 1rem; }
.pb-search input {
  width: 100%;
  padding: .72rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .94rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pb-search input:focus {
  border-color: var(--g600);
  box-shadow: 0 0 0 3px rgba(0,122,66,.12);
}

.pb-cat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: .75rem;
}
.pb-cat-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 1.4rem;
  background: var(--g50);
  border: none;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background var(--transition);
}
.pb-cat-head:hover { background: var(--g100); }
.pb-cat-head:focus-visible { outline: 3px solid rgba(0,122,66,.35); outline-offset: -3px; }
.pb-cat-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: var(--g100);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.pb-cat-title { flex: 1; min-width: 0; }
.pb-cat-title strong { display: block; font-size: 1rem; font-weight: 800; color: var(--g800); line-height: 1.25; }
.pb-cat-title span { display: block; font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.pb-cat-count {
  flex-shrink: 0;
  min-width: 26px;
  text-align: center;
  background: var(--g500);
  color: var(--white);
  font-size: .76rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: 999px;
  transition: opacity var(--transition);
}
.pb-cat-count.is-zero { opacity: 0; }
.pb-cat-chevron {
  flex-shrink: 0;
  color: var(--g700);
  font-size: .8rem;
  transition: transform var(--transition);
}
.pb-cat.is-open .pb-cat-chevron { transform: rotate(180deg); }
.pb-cat-body { display: none; border-top: 1px solid var(--line); }
.pb-cat.is-open .pb-cat-body { display: block; }
.pb-cat-list { list-style: none; }

.pb-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .7rem 1.4rem;
  border-bottom: 1px solid var(--g50);
  transition: background var(--transition);
}
.pb-item:last-child { border-bottom: none; }
.pb-item:hover { background: var(--g50); }
.pb-item.is-checked { background: var(--g50); }
.pb-item-label {
  flex: 1;
  min-width: 0;
  display: flex;
  /* flex-start, not center: rows carrying a note are two lines tall and the
     box should sit against the name, not float between the two. */
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink2);
  line-height: 1.4;
}
.pb-item-label input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: .12rem;   /* optically centres it on the first line of text */
  flex-shrink: 0;
  accent-color: var(--g500);
  cursor: pointer;
}
.pb-item-label input[type="checkbox"]:focus-visible { outline: 3px solid rgba(0,122,66,.35); outline-offset: 2px; }
.pb-item-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pb-item-name { overflow-wrap: anywhere; }
/* "What this covers" line on the merged assets. */
.pb-item-note {
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Quantity stepper — only meaningful once the asset is actually selected,
   so it stays out of the way entirely until then rather than sitting there
   greyed out against every row. */
.pb-qty { display: none; }
.pb-item.is-checked .pb-qty {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}
.pb-qty button {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--g700);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: all var(--transition);
}
.pb-qty button:hover:not(:disabled) { border-color: var(--g500); background: var(--g100); }
.pb-qty button:disabled { opacity: .3; cursor: not-allowed; }
.pb-qty button:focus-visible { outline: 3px solid rgba(0,122,66,.35); outline-offset: 1px; }
.pb-qty-value {
  min-width: 20px;
  text-align: center;
  font-size: .86rem;
  font-weight: 700;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}

/* "Something else" row */
.pb-other {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.4rem;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  margin-top: .75rem;
}
.pb-other label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  flex-shrink: 0;
}
.pb-other input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--g500); cursor: pointer; }
.pb-other input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: .55rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  color: var(--ink);
  background: var(--g50);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.pb-other input[type="text"]:focus {
  border-color: var(--g600);
  box-shadow: 0 0 0 3px rgba(0,122,66,.12);
  background: var(--white);
}

.pb-no-results {
  display: none;
  padding: 1.5rem;
  text-align: center;
  font-size: .92rem;
  color: var(--muted);
}
.pb-no-results.is-shown { display: block; }

/* ── Step 3 · Customer details ───────────────────────────────────── */
.pb-fields {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

/* ── Summary ─────────────────────────────────────────────────────── */
.pb-summary {
  background: var(--white);
  border: 1.5px solid var(--g500);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem;
}
.pb-summary h2 {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g600);
  margin-bottom: 1rem;
}
.pb-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .45rem 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink2);
}
.pb-sum-row dt { color: var(--muted); font-weight: 500; }
.pb-sum-row dd { text-align: right; }
.pb-sum-row.pb-sum-total {
  margin-top: .5rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--ink);
}
.pb-sum-row.pb-sum-total dt { color: var(--ink2); font-weight: 700; font-size: .95rem; }
.pb-sum-note {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: .85rem;
}
.pb-submit { width: 100%; justify-content: center; margin-top: 1.1rem; text-align: center; }
/* Sits directly under the estimated total, because it qualifies that figure. */
.pb-parts-note {
  margin-top: .9rem;
  padding: .7rem .9rem;
  background: var(--g50);
  border-left: 3px solid var(--g500);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--ink2);
  line-height: 1.55;
}
.pb-parts-note strong { color: var(--g700); font-weight: 800; }

.pb-warn {
  display: none;
  margin-top: .85rem;
  padding: .7rem .9rem;
  background: #fdeceb;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  color: #b0331f;
  line-height: 1.5;
}
.pb-warn.is-shown { display: block; }

/* Send failure, shown under the button. Empty until then, so it collapses. */
.pb-result:empty { display: none; }
.pb-result {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  line-height: 1.6;
}
.pb-result.is-error { background: #fdeceb; color: #b0331f; }
.pb-result p + p { margin-top: .5rem; }
.pb-result a { font-weight: 700; text-decoration: underline; }

/* ── Confirmation, shown in place of the form once sent ──────────── */
/* Clears the sticky site header when scrolled to, so the tick is not
   hidden underneath it. */
.pb-done { scroll-margin-top: 110px; }
.pb-done-head { text-align: center; max-width: 620px; margin: 0 auto 2.5rem; }
.pb-done-icon {
  width: 60px; height: 60px;
  margin: 0 auto 1.1rem;
  background: var(--g500);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,166,81,.3);
}
.pb-done-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: .6rem;
}
/* Focused from script after sending, purely to move the screen-reader
   position. It is tabindex="-1" so no keyboard user lands here — a visible
   ring would just look like a stray box around the headline. */
.pb-done-head h2:focus { outline: none; }
.pb-done-head > p { font-size: 1.02rem; color: var(--muted); line-height: 1.7; }
.pb-done-recap {
  display: inline-block;
  margin-top: 1.1rem;
  padding: .55rem 1.1rem;
  background: var(--g100);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--g700);
}
.pb-done-foot {
  max-width: 620px;
  margin: 2.5rem auto 0;
  text-align: center;
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.7;
}
.pb-done-foot p + p { margin-top: .9rem; }
.pb-done-contact { font-weight: 700; }
.pb-done-contact a { color: var(--g700); }
.pb-done-contact a:hover { color: var(--g500); }
.pb-done-contact span { margin: 0 .5rem; opacity: .4; }

/* ── Two-column layout on desktop ────────────────────────────────── */
/* 1081px matches the nav breakpoint in styles.css, so the sticky offset
   is only applied while the site header is actually sticky. */
@media (min-width: 1081px) {
  .pb-wrap { max-width: 1180px; }
  .pb-layout {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 2.25rem;
    align-items: start;
  }
  .pb-aside { position: sticky; top: 92px; }
}
/* A `display` declaration outranks the UA's `[hidden] { display: none }`, so
   the grid above would keep the form on screen after it is hidden. */
.pb-layout[hidden] { display: none; }
@media (max-width: 1080px) {
  /* Stacked layout — the summary sits at the end of the form, above the
     closing CTA, so it reads as the last step rather than floating. */
  .pb-aside { margin-top: 2rem; }
}

@media (max-width: 860px) {
  .pb-plans { grid-template-columns: 1fr; }
  .pb-cat-head { padding: 1rem 1.1rem; gap: .8rem; }
  .pb-cat-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .pb-item { padding: .7rem 1.1rem; gap: .6rem; }
  .pb-qty { margin-left: auto; }
  .pb-fields { padding: 1.35rem 1.15rem; }
  .pb-other { padding: 1rem 1.1rem; }
}
