/* =============================================================================
   BillGrid public site: a "BillGrid vs X" page built to land on (pages/compare/*.html).
   A price calculator in the hero, the facts as a scoreboard, an honest "pick the one that fits", real close-ups
   with the competitor's fact beside each, every row side by side, and how to switch.
   Parts: fragments/compare-parts.html; design source docs/mocks/site/compare-freshbooks.html. Loads after site.css,
   pages.css and spotlight.css.
   ============================================================================= */

.cmp section[id] { scroll-margin-top: 88px; }
.cmp-section { padding-block: clamp(64px, 8vw, 112px); }
.cmp-section--paper { background: var(--paper); border-block: 1px solid var(--line); }
.cmp-head { max-width: 860px; }
.cmp-head h2, .cmp-head .lead { text-wrap: balance; }
.cmp-head h2 { margin-top: 10px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: var(--fs-d2); line-height: 1.02; }
.cmp-head .lead { margin-top: 14px; }

/* ---------- hero: the answer on the left, the visitor's own price on the right ---------- */
.cmp-hero {
  padding-block: clamp(40px, 6vw, 88px) clamp(56px, 7vw, 104px);
  background: radial-gradient(60% 70% at 85% 30%, var(--gold-soft), transparent 70%), radial-gradient(50% 60% at 10% 10%, var(--sand-50), transparent 70%);
}
.cmp-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.cmp-crumb { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.cmp-crumb a { color: inherit; text-decoration: none; }
.cmp-crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-crumb time { color: var(--caption); letter-spacing: .06em; }
.cmp-hero h1 { margin-top: 18px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(42px, 4.8vw, 70px); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.cmp-hero h1 .accent { display: block; }
.cmp-hero .lead { max-width: 34em; margin-top: 22px; }
.cmp-hero__actions { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 30px; }
.cmp-link { display: inline-flex; gap: var(--icon-gap-sm); align-items: center; font-weight: 600; color: var(--ink); text-decoration: none; }
.cmp-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- the calculator: two sliders, two needs, two bars ---------- */
.cmp-calc { padding: clamp(20px, 2.6vw, 30px); border-radius: 22px; background: #fff; box-shadow: var(--shadow-card); }
.cmp-calc__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cmp-calc__head h2 { font-size: var(--fs-md); letter-spacing: -.01em; }
.cmp-calc__inputs { display: grid; gap: 18px; margin-top: 20px; }
.cmp-range { display: grid; gap: 8px; }
.cmp-range__label { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); color: var(--text-muted); }
.cmp-range__label output { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-range input[type="range"] {
  --fill: 50%;
  width: 100%; height: 28px; margin: 0; background: none; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.cmp-range input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--ink) var(--fill), var(--sand-200) var(--fill)); }
.cmp-range input[type="range"]::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--sand-200); }
.cmp-range input[type="range"]::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: var(--ink); }
.cmp-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: var(--shadow-pop); transition: transform .15s var(--ease-out); }
.cmp-range input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: var(--shadow-pop); }
.cmp-range input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.cmp-range input[type="range"]:focus-visible { outline: none; }
.cmp-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--gold-wash), var(--shadow-pop); border-color: var(--gold-deep); }
.cmp-range input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--gold-wash); border-color: var(--gold-deep); }
.cmp-needs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cmp-needs__label { width: 100%; font-size: var(--fs-sm); color: var(--text-muted); }
.cmp-need {
  display: inline-flex; gap: var(--icon-gap-sm); align-items: center; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: var(--r-pill); background: #fff; font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.cmp-need .bg-icon { display: none; }
.cmp-need:hover { border-color: var(--sand-400); color: var(--ink); }
.cmp-need[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.cmp-need[aria-pressed="true"] .bg-icon { display: inline-block; }

.cmp-calc__result { display: grid; gap: 14px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.cmp-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: baseline; }
.cmp-bar__name { font-weight: 600; color: var(--ink); }
.cmp-bar__name small { margin-left: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--caption); }
.cmp-bar__price { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-bar__price small { font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; color: var(--caption); }
.cmp-bar__track { grid-column: 1 / -1; height: 10px; border-radius: var(--r-pill); background: var(--sand-100); overflow: hidden; }
.cmp-bar__track i { display: block; width: var(--w, 50%); height: 100%; border-radius: inherit; background: var(--sand-500); transition: width .5s var(--ease-out); }
/* the bars grow in from nothing once compare.js has drawn the first answer */
.cmp-calc:not(.is-ready) .cmp-bar__track i { width: 0; }
.cmp-bar--us .cmp-bar__track i { background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); }
.cmp-bar--them .cmp-bar__name { color: var(--text-muted); }
.cmp-calc__save { margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: var(--gold-soft); color: var(--ink); }
.cmp-calc__save b { display: block; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(30px, 3vw, 40px); line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cmp-calc__save span { font-size: var(--fs-sm); color: var(--text-muted); }
.cmp-calc__save.is-fit { background: var(--sent-bg); }
.cmp-calc__nojs { margin-top: 18px; color: var(--text-muted); }
.js .cmp-calc__nojs { display: none; }
.cmp-fees { border-top: 1px solid var(--line); padding-top: 14px; }
.cmp-fees summary { display: flex; gap: 8px; align-items: center; list-style: none; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.cmp-fees summary::-webkit-details-marker { display: none; }
.cmp-fees summary::before { content: "+"; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--field-border); font-weight: 400; color: var(--caption); transition: rotate .2s var(--ease-out); }
.cmp-fees[open] summary::before { rotate: 45deg; }
.cmp-fees__body { display: grid; gap: 16px; margin-top: 14px; }
.cmp-method { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.cmp-method .cmp-needs__label { width: auto; }
.cmp-method .billing-cycle { margin: 0; }
.cmp-calc__why { margin-top: 12px; font-size: var(--fs-sm); line-height: 1.5; color: var(--caption); }

/* ---------- scoreboard: the four differences as figures, then what's the same ---------- */
.cmp-score { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 48px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sand-300); }
.cmp-score li { display: grid; align-content: start; gap: 10px; padding: 28px 28px 8px 0; }
.cmp-score li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.cmp-score__figure { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(40px, 4.4vw, 60px); line-height: 1; letter-spacing: -.035em; color: var(--ink); }
.cmp-score__figure small { font-size: .42em; letter-spacing: -.01em; color: var(--caption); }
.cmp-score h3 { font-size: var(--fs-md); letter-spacing: -.01em; line-height: 1.3; }
.cmp-score p { font-size: var(--fs-sm); line-height: 1.5; color: var(--text-muted); }
.cmp-score p b { font-weight: 600; color: var(--text); }
.cmp-same { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 40px; padding: 16px 20px; border: 1px dashed var(--field-border); border-radius: 14px; font-size: var(--fs-sm); color: var(--text-muted); }
.cmp-same > b { margin-right: 6px; color: var(--ink); }
.cmp-same span { display: inline-flex; gap: var(--icon-gap-xs); align-items: center; padding: 3px 10px; border-radius: var(--r-pill); background: var(--paper); }
.cmp-same .bg-icon { color: var(--paid-fg); }

/* ---------- pick the one that fits: the competitor's side first ---------- */
.cmp-fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.cmp-fit__card { display: flex; flex-direction: column; padding: clamp(24px, 3vw, 36px); border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.cmp-fit__card--us { box-shadow: 0 0 0 2px var(--ink); }
.cmp-fit__card h3 { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(26px, 2.4vw, 32px); line-height: 1.1; letter-spacing: -.02em; }
.cmp-fit__card .kicker { margin-bottom: 10px; }
.cmp-fit__card--them .kicker { color: var(--caption); }
.cmp-fit__card ul { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.cmp-fit__card li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; line-height: 1.5; }
.cmp-fit__card li .bg-icon { margin-top: .2lh; color: var(--sand-500); }
.cmp-fit__card--us li .bg-icon { color: var(--gold); }
.cmp-fit__card li small { display: block; font-size: var(--fs-sm); color: var(--caption); }
.cmp-fit__foot { margin-top: auto; padding-top: 24px; }

/* ---------- scenes: one real close-up each, the competitor's fact beside it ---------- */
.cmp-scenes { display: grid; gap: clamp(56px, 8vw, 104px); margin-top: clamp(40px, 6vw, 72px); }
.cmp-scene { display: grid; gap: clamp(24px, 3vw, 36px); }
/* the words in two columns over the stage: the claim on the left, the detail and the competitor's fact on the right */
.cmp-scene__text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px clamp(28px, 5vw, 72px); align-items: start; }
.cmp-scene__text h3 { margin-top: 10px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(30px, 3.2vw, 44px); line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.cmp-scene__text > div > p { color: var(--text-muted); }
.cmp-scene__text .cmp-link { margin-top: 16px; }
.cmp-vs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-sm); line-height: 1.5; }
.cmp-vs dt { font-weight: 600; color: var(--ink); }
.cmp-vs dd { margin: 0; color: var(--text-muted); }
.cmp-scene .spotlight { --spot-pad: clamp(18px, 3.4vw, 48px); }
/* a tall screen shows its top and rises out of the stage (spotlight--rise), so its words stay at full size */
.cmp-scene .spotlight--rise .spotlight__shot { aspect-ratio: var(--crop); object-fit: cover; object-position: top; }

/* ---------- every row, side by side ---------- */
.cmp-table-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; margin-top: 36px; }
.cmp-table-tools .billing-cycle { margin: 0; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--caption); }
.cmp-legend li { display: inline-flex; gap: var(--icon-gap-sm); align-items: center; }
.cmp-sheet { margin-top: 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; overflow: clip; }
.cmp-sheet table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.cmp-sheet thead th { position: sticky; top: 68px; z-index: 2; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--ink); text-align: left; font-size: var(--fs-md); color: var(--ink); }
.cmp-sheet thead th:first-child { width: 28%; }
.cmp-sheet thead th + th { width: 36%; }
.cmp-sheet thead th small { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--caption); }
.cmp-sheet tbody th, .cmp-sheet tbody td { padding: 14px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.5; }
.cmp-sheet tbody:last-child tr:last-child > * { border-bottom: 0; }
.cmp-sheet tbody th[scope="row"] { font-weight: 500; color: var(--ink); }
.cmp-sheet tbody td { color: var(--text); }
.cmp-sheet tbody td + td { color: var(--text-muted); }
.cmp-sheet tr.cmp-group th { padding: 26px 20px 10px; border-bottom: 1px solid var(--line); background: var(--paper); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.cmp-cell { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; }
.cmp-cell .bg-icon { margin-top: .2lh; }
.cmp-cell--yes .bg-icon { color: var(--paid-fg); }
.cmp-cell--no { color: var(--caption); }
.cmp-cell--no .bg-icon { color: var(--sand-400); }
.cmp-cell--plan .bg-icon { color: var(--partial-fg); }
.cmp-cell--note .bg-icon { color: var(--overdue-fg); }
.cmp-plan { display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: var(--r-pill); background: var(--partial-bg); font-size: var(--fs-sm); font-weight: 600; color: #6b4a0c; white-space: nowrap; } /* the site's warning ink (.alert--warn) */
/* only the differences: rows the same on both step aside */
.cmp-sheet.is-diff tr[data-same] { display: none; }

/* ---------- switching: three steps ---------- */
.cmp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); margin: 44px 0 0; padding: 0; list-style: none; counter-reset: step; }
.cmp-steps li { padding-top: 22px; border-top: 1px solid var(--sand-300); counter-increment: step; }
.cmp-steps li::before { content: "0" counter(step); display: block; margin-bottom: 14px; font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--gold); }
.cmp-steps h3 { font-size: var(--fs-lg); line-height: 1.3; letter-spacing: -.02em; }
.cmp-steps p { margin-top: 8px; color: var(--text-muted); }
.cmp-faq { margin-top: 36px; }
.cmp-note { max-width: 720px; margin-top: 36px; font-size: var(--fs-sm); color: var(--caption); }
.cmp-note .cmp-link { margin-left: 6px; font-size: var(--fs-body); }

/* Moving over through a connection (compare/harvest.html): each step with its real screen. Reads down by default;
   .is-tabs (compare.js, wide screens only) puts the steps in a column and the chosen screen beside them, every screen
   in the same cell so the section never changes height. */
.cmp-move { margin-top: 44px; }
.cmp-move__steps { display: grid; gap: 28px; margin: 0; padding: 0; list-style: none; }
.cmp-move__step { display: grid; gap: 18px; }
.cmp-move__tab { display: flex; gap: 16px; align-items: flex-start; width: 100%; padding: 0; border: 0; border-radius: 18px; background: transparent; font: inherit; text-align: left; color: var(--ink); cursor: default; }
.cmp-move__num { flex: none; width: 1.6em; font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--gold); }
.cmp-move__copy b { display: block; font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.cmp-move__copy > span { display: block; margin-top: 6px; line-height: 1.55; color: var(--text-muted); }
.cmp-move__shot { margin: 0; min-width: 0; }
.cmp-move .spotlight--rise .spotlight__shot { aspect-ratio: var(--crop); object-fit: cover; object-position: top; }
.cmp-move.is-tabs .cmp-move__steps { grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); grid-template-rows: repeat(3, min-content) 1fr; gap: 8px clamp(24px, 4vw, 56px); align-items: start; }
.cmp-move.is-tabs .cmp-move__step { display: contents; }
.cmp-move.is-tabs .cmp-move__tab { grid-column: 1; padding: 18px 20px; cursor: pointer; box-shadow: inset 0 0 0 1px transparent; transition: background-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.cmp-move.is-tabs .cmp-move__tab:hover { background: color-mix(in srgb, #fff 60%, transparent); }
.cmp-move.is-tabs .cmp-move__tab[aria-selected="true"] { background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card); }
.cmp-move.is-tabs .cmp-move__shot { grid-column: 2; grid-row: 1 / -1; align-self: stretch; display: flex; flex-direction: column; justify-content: center; transition: opacity .25s var(--ease-out), visibility .25s; }
.cmp-move.is-tabs .cmp-move__shot.spotlight--rise { justify-content: flex-end; }
.cmp-move.is-tabs .cmp-move__shot[hidden] { visibility: hidden; opacity: 0; }
.cmp-move__tab:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cmp-move.is-tabs .cmp-move__shot { transition: none; } }
.cmp-note a { color: inherit; text-underline-offset: 3px; }

/* ---------- closing band ---------- */
.cmp-close { padding-block: clamp(72px, 9vw, 128px) 40px; background: var(--sand-900); color: #cabfa6; text-align: center; }
.cmp-close h2 { font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(40px, 5.6vw, 76px); line-height: 1; letter-spacing: -.035em; color: var(--cream); }
.cmp-close h2 .accent { color: var(--hl); }
.cmp-close p { max-width: 36em; margin: 18px auto 0; }
.cmp-close .btn { margin-top: 30px; background: var(--cream); color: var(--ink); }
.cmp-close .btn:hover { background: #fff; }
.cmp-close .trustline { justify-content: center; color: #a99f84; }
.cmp-fine { max-width: 860px; margin: clamp(64px, 8vw, 104px) auto 0; padding-top: 24px; border-top: 1px solid #392f1f; font-size: var(--fs-xs); line-height: 1.6; color: #a99f84; }
.cmp-fine a { color: inherit; text-underline-offset: 3px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .cmp-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .cmp-calc { max-width: 560px; }
  .cmp-score { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-score li:nth-child(3) { padding-left: 0; border-left: 0; }
  .cmp-score li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .cmp-fit, .cmp-steps { grid-template-columns: minmax(0, 1fr); }
  .cmp-scene__text { grid-template-columns: minmax(0, 1fr); }
  /* the sheet becomes a card per row: the row's name across, the two answers under it */
  .cmp-sheet table, .cmp-sheet tbody { display: block; }
  .cmp-sheet thead { display: block; position: sticky; top: 68px; z-index: 2; }
  .cmp-sheet thead th { position: static; padding: 12px 14px; font-size: var(--fs-body); }
  .cmp-sheet thead th:first-child { display: none; }
  .cmp-sheet thead tr, .cmp-sheet tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-sheet thead th + th { width: auto; }
  .cmp-sheet tbody th[scope="row"] { grid-column: 1 / -1; padding: 16px 14px 4px; border-bottom: 0; font-weight: 600; }
  .cmp-sheet tbody td { padding: 4px 14px 16px; font-size: var(--fs-sm); }
  .cmp-sheet tr.cmp-group { display: block; }
  .cmp-sheet tr.cmp-group th { display: block; padding: 22px 14px 8px; }
}
@media (max-width: 520px) {
  .cmp-score { grid-template-columns: minmax(0, 1fr); }
  .cmp-score li, .cmp-score li + li { padding: 22px 0 6px; border-left: 0; }
  .cmp-score li + li { border-top: 1px solid var(--line); }
  .cmp-hero__actions .btn { width: 100%; }
}
