/* ==========================================================================
   pricing.html only. Shared components (.price-card, .pricing-grid, .pill,
   .ticks, .table-wrap, .btn, .card, .cta-banner) are styled in styles.css;
   this file lays out the page and styles its own pieces: package card
   internals, the comparison table, the estimator, savings, extras and FAQ.
   ========================================================================== */

/* ---------------- Hero ---------------- */

.pricing-hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.pricing-hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pricing-hero-facts li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------------- Package cards ----------------
   Each card is a head (name to button) and a body (what's included). The
   cards share their row tracks (subgrid), so the buttons line up across a
   row however long each description is. */

.pkg-grid {
  padding-top: 0.75rem; /* room for the featured card's badge */
}
.pkg {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 1.25rem;
}
.pkg-head {
  display: flex;
  flex-direction: column;
}
.pkg-body {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.pkg-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.pkg .tier-desc {
  min-height: 0;
  margin-bottom: 0;
}
.pkg .price {
  margin-top: 1rem;
}
.pkg .price .amount {
  font-size: 2.25rem;
  line-height: 1.1;
}
.pkg-was {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.pkg .price-note {
  margin-bottom: 0.5rem;
}
.pkg-example {
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.pkg-callout {
  margin: 0 0 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: var(--success-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
}
.pkg-callout strong { color: inherit; }
.pkg .pkg-head .btn {
  margin-top: auto;
  width: 100%;
}
.pkg-includes {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.pkg .ticks {
  font-size: 0.9375rem;
}
.pkg .ticks a {
  color: var(--text);
  text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent);
}
.pkg .ticks a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.pkg-customise {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
  align-self: flex-start;
}
.pkg-footnote {
  max-width: 760px;
  margin: 2rem 0 0;
  font-size: 0.875rem;
}

/* ---------------- How licensing works ---------------- */

.how-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.how-item p {
  font-size: 0.9375rem;
  margin: 0;
}
.how-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}
.how-icon svg {
  width: 22px;
  height: 22px;
}

/* ---------------- Comparison table ----------------
   Scrolls sideways inside .table-wrap on a phone, with the app column
   pinned so each row stays readable. */

/* Positioned, so the cells' visually-hidden text (position: absolute) is
   contained by the scroller instead of widening the page. */
.compare-wrap {
  position: relative;
}
.compare {
  min-width: 680px;
}
.compare th,
.compare td {
  vertical-align: middle;
}
.compare thead th:not(:first-child),
.compare td {
  text-align: center;
}
.compare .compare-price {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.compare thead .compare-price { color: var(--text-muted); }
.compare tfoot td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare tfoot tr:not(.compare-total) :is(th, td) {
  font-weight: 500;
  border-top: 0;
  border-bottom: 1px solid var(--border);
}
.compare tfoot tr:first-child :is(th, td) { border-top: 2px solid var(--border); }
.compare tfoot tr:last-child :is(th, td) { border-bottom: 0; }
.compare tfoot .compare-total :is(th, td) {
  font-weight: 700;
  border-top: 0;
  border-bottom: 1px solid var(--border);
}

/* Pinned first column: needs its own opaque background. */
.compare :is(thead, tbody, tfoot) tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 11rem;
  background: var(--surface);
  box-shadow: inset -1px 0 0 var(--border);
}
.compare thead tr > :first-child { background: var(--surface-2); }
.compare tbody tr:hover > :first-child {
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
}
.compare tbody th a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent);
  text-underline-offset: 0.18em;
}
.compare tbody th a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* The recommended package's column */
.compare .is-featured {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.compare thead th.is-featured {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  color: var(--accent);
}

.compare .yes {
  display: inline-flex;
  color: var(--accent);
}
.compare .yes svg {
  width: 20px;
  height: 20px;
}
.compare .no {
  color: var(--text-muted);
}
.compare-note {
  margin: 1rem 0 0;
  font-size: 0.875rem;
}

/* ---------------- Estimator ---------------- */

.est-noscript {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.est {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 2rem;
  align-items: start;
}
.est[hidden] { display: none; }

/* Left: the form, one card with a section per question */
.est-form {
  gap: 0;
  padding: 0 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.est-group {
  min-width: 0;
  margin: 0;
  padding: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.est-group:first-child { border-top: 0; }
.est-group legend,
.est-label {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
/* A fieldset's legend sits on its border unless floated. */
.est-group legend { float: left; }
.est-group legend + * { clear: both; }
.est-help {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}
.est-users + .est-help { margin: 0.6rem 0 0; }
.est-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--warning-text);
}
.est-note:empty { display: none; }
.est-users + .est-help + .est-note { margin-top: 0.4rem; }

/* Package presets: toggle chips */
.est-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.est-preset {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}
.est-preset:hover { border-color: var(--accent); }
.est-preset[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
}
.est-preset--clear { color: var(--text-muted); }

/* App list */
.est-apps-head,
.est-admin {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  font-size: 0.8125rem;
}
.est-apps-head {
  padding: 0 0.75rem 0.4rem;
  color: var(--text-muted);
  font-weight: 600;
}
.est-admin {
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
}
.est-admin span { color: var(--text-muted); }
.est-apps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.est-app {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}
.est-app:hover { border-color: var(--accent); }
.est-app:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.est-app input { flex: none; margin: 0; }
.est-app label {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  padding: 0.6rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.est-app-price {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Users */
.est-users {
  max-width: 10rem;
  font-variant-numeric: tabular-nums;
}

/* Term: a segmented control over real radio buttons */
.est-segment {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.est-segment label {
  margin: 0;
  padding: 0.6rem 0.4rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  background: var(--surface);
  transition: background-color var(--duration-fast) ease;
}
.est-segment label + input + label { border-left: 1px solid var(--border); }
.est-segment label span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.est-segment label:hover { background: var(--hover-tint); }
.est-segment input:checked + label {
  background: var(--accent);
  color: var(--on-accent);
}
.est-segment input:checked + label span { color: var(--on-accent); }
.est-segment input:focus-visible + label {
  outline: var(--focus-ring);
  outline-offset: -4px;
}

/* Single checkbox (up front) */
.est-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1rem;
}
.est-check input { flex: none; margin: 0.2rem 0 0; }
.est-check label {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.est-check label span,
.est-option label span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
}
.est-check:has(input:disabled) label { color: var(--text-muted); cursor: not-allowed; }
.est-check + .est-note { margin: 0.4rem 0 0 1.6rem; color: var(--text-muted); }

/* Option boxes (hosting, support, add-ons) */
.est-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.est-options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.est-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}
.est-option:hover { border-color: var(--accent); }
.est-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.est-option input { flex: none; margin: 0.9rem 0 0; }
.est-option label {
  flex: 1;
  margin: 0;
  padding: 0.7rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}
.est-option label span { margin-top: 0.15rem; }

/* Right: the summary card, pinned while the form scrolls */
.est-summary {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.est-summary h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.est-summary h3:focus { outline: none; }
.est-summary h3:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.est-config {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.est-total-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  margin: 0;
  color: var(--text-muted);
}
.est-amount {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.est-total-sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}
.est-saving {
  margin: 0.75rem 0 0;
}
.est-saving .pill { white-space: normal; }
.est-request {
  width: 100%;
  margin-top: 1.25rem;
}
.est-tip {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  font-size: 0.875rem;
}
.est-tip p {
  margin: 0 0 0.6rem;
  color: var(--text);
}
.est-tip[hidden] { display: none; }

.est-table-title {
  margin: 1.5rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.is-empty .est-table-title,
.is-empty .est-breakdown { opacity: 0.5; }
.est-breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.est-breakdown th,
.est-breakdown td {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.est-breakdown th {
  text-align: left;
  font-weight: 500;
  color: var(--text);
  padding-right: 0.75rem;
}
.est-breakdown td {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.est-row-note {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}
.est-breakdown .is-off :is(th, td) { color: var(--text-muted); }
.est-breakdown .is-saving td { color: var(--success-text); }
.est-breakdown .is-subtotal :is(th, td) { font-weight: 700; }
.est-breakdown .is-total :is(th, td) {
  font-weight: 700;
  font-size: 1rem;
}
.est-breakdown tr:last-child :is(th, td) { border-bottom: 0; }
.est-small {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.est-small + .est-small { margin-top: 0.5rem; }

/* Phone and tablet: a running total pinned to the bottom of the form */
.est-mini { display: none; }

@media (max-width: 960px) {
  .est { grid-template-columns: minmax(0, 1fr); }
  .est-summary {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .est-mini {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 -1.75rem;
    padding: 0.75rem 1.75rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.12);
  }
  .est-mini-total {
    min-width: 0;
    margin: 0;
    font-size: 0.8125rem;
  }
  .est-mini .btn { flex: none; }
  .est-mini-total span {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }
}

/* ---------------- Savings ---------------- */

.save-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}
.save-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.save-card .save-rate {
  margin: 0 0 0.6rem;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.save-card p:last-child { margin-bottom: 0; }
.save-card p:not(.save-rate) { font-size: 0.9375rem; }
.save-bands {
  width: 100%;
  margin: 0 0 0.75rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.save-bands th,
.save-bands td {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text);
}
.save-bands th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.save-bands :is(th, td):last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.save-bands tr:last-child td { border-bottom: 0; }
.save-example {
  max-width: 760px;
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
  font-size: 0.9375rem;
}

/* ---------------- Extras ---------------- */

.extra-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.extra-card .extra-price {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}
.extra-card .extra-price span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}
.extra-card p:last-child {
  margin: 0;
  font-size: 0.9375rem;
}

/* ---------------- FAQ ---------------- */

.faq {
  max-width: 780px;
  border-top: 1px solid var(--border);
}
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  position: relative;
  padding: 1.1rem 2.5rem 1.1rem 0;
  list-style: none;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border: solid var(--text-muted);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--duration-base) ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p {
  margin: 0;
  padding: 0 2.5rem 1.25rem 0;
}

/* ---------------- CTA ---------------- */

.pricing-cta { padding-top: 0; }

/* ---------------- Narrow screens ---------------- */

@media (max-width: 900px) {
  .pkg-grid { row-gap: 2rem; }
}

@media (max-width: 720px) {
  .est-options--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .est-form { padding: 0 1.1rem; }
  .est-mini { margin: 0 -1.1rem; padding: 0.75rem 1.1rem; }
  .est-summary { padding: 1.25rem; }
  .est-apps,
  .est-options { grid-template-columns: minmax(0, 1fr); }
  .est-segment label { padding: 0.55rem 0.2rem; font-size: 0.875rem; }
  .compare :is(thead, tbody, tfoot) tr > :first-child { min-width: 8.5rem; max-width: 9.5rem; }
  .compare { min-width: 600px; }
}
