/* ---------------------------------------------------------------
   Pricing page (/pricing/) - loaded after site.css, pricing page only.
   The calculator is driven by /assets/pricing.js (sliders, billing
   period, budget cap). /pricing/* is the only path whose CSP allows
   scripts - see _headers. Without JavaScript the controls are hidden
   (noscript loads pricing-nojs.css) and the cards show the prefilled
   default: 1 event, 1 country, monthly.
   Local amber tokens carry the budget-cap warning state - orange
   stays action-only, teal stays cleared-only, per the site rules.
   --------------------------------------------------------------- */

:root {
  --warn-text: #8f5a0e;
  --warn-fill: #d97a08;
  --warn-tint: #fdf3e2;
}

/* Shared band background for the explainer sections */
.band-paper { background: var(--paper-reading); }

/* Controls ------------------------------------------------------ */
.calc-controls {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 24px 36px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 26px 28px; box-shadow: var(--shadow); margin-bottom: 28px;
}
.calc-ctl { min-width: 0; }
.calc-ctl > label, .calc-ctl > .calc-label {
  display: block; font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted-foreground); margin-bottom: 12px;
}
.calc-inrow { display: flex; gap: 12px; align-items: center; }
.calc-inrow input[type="range"] { flex: 1 1 auto; min-width: 0; }
input[type="range"] { accent-color: var(--brand); height: 28px; }
.calc-num, .calc-cap {
  font-family: var(--font); font-size: 15px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  width: 84px; padding: 8px 10px; color: var(--foreground);
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius-btn);
}
.calc-cap { width: 130px; }
input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.calc-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.calc-seg button {
  font-family: var(--font); font-size: 13.5px; font-weight: 500; cursor: pointer;
  color: var(--foreground); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--radius-btn); padding: 7px 12px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.calc-seg button:hover { background: var(--secondary); }
.calc-seg button[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: var(--chrome-foreground);
}
.calc-seg button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.calc-hint { font-size: 12.5px; line-height: 1.55; color: var(--muted-foreground); margin-top: 8px; max-width: 34ch; }

/* Plan cards ---------------------------------------------------- */
.tier-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(6, auto); gap: 16px; row-gap: 0;
}
.tier-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tier-card {
  position: relative; min-width: 0;
  display: grid; grid-template-rows: subgrid; grid-row: span 6; align-content: start; gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 22px 20px; box-shadow: var(--shadow);
}
.tier-card.off { display: none; }
@supports not (grid-template-rows: subgrid) {
  .tier-card { display: block; grid-row: auto; }
}
@media (max-width: 980px) {
  .tier-grid, .tier-grid.four { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); grid-template-rows: none; gap: 14px; }
  .tier-card { display: block; grid-row: auto; padding: 18px 16px; }
  .tier-card .calc-per { margin-bottom: 6px; }
}
.tier-card.best { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.calc-fit {
  display: none; position: absolute; top: -12px; left: 14px;
  align-items: center; background: var(--brand); color: var(--brand-foreground);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 11px; border-radius: var(--radius-pill);
}
.tier-card.best .calc-fit { display: inline-flex; }
.tier-card h3 { font-size: 18px; letter-spacing: -0.02em; color: var(--primary); }
.tier-tag { font-size: 13.5px; line-height: 1.5; color: var(--muted-foreground); margin: 2px 0 10px; }
.tier-spec {
  font-size: 13px; line-height: 1.55; color: var(--muted-foreground);
  border-top: 1px solid var(--line-soft); padding-top: 10px; margin-bottom: 14px;
}
.calc-total {
  display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.calc-per { display: block; font-size: 12.5px; line-height: 1.5; color: var(--muted-foreground); min-height: 19px; margin-top: 3px; }
/* Styled like the site's other text links (.signin, source links):
   primary colour, plain underline, 3px offset. */
.tier-cta {
  align-self: start; justify-self: start; margin-top: 10px;
  font-size: 14px; font-weight: 500; color: var(--primary);
  text-decoration: underline; text-underline-offset: 3px;
}

/* Budget cap box ------------------------------------------------ */
.capbox {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 24px 28px; box-shadow: var(--shadow); margin-top: 28px;
}
.capbox h3 {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-foreground); margin-bottom: 12px;
}
.capbox p { font-size: 14.5px; line-height: 1.6; max-width: none; }
#capMsg { margin-bottom: 12px; color: var(--foreground); }
.capbar { height: 10px; background: var(--paper-reading); border-radius: var(--radius-pill); overflow: hidden; }
.capbar i {
  display: block; height: 100%; width: 0;
  background: var(--brand); border-radius: var(--radius-pill);
  transition: width 0.15s var(--ease);
}
.capbar.over i { background: var(--warn-fill); }
.callout { border-radius: var(--radius); padding: 12px 16px; font-size: 14px; line-height: 1.6; margin-top: 14px; }
.callout.warn { background: var(--warn-tint); color: var(--warn-text); }
.callout.ok { background: var(--paper-reading); color: var(--foreground); }
.callout strong { font-weight: 600; }
.callout ul { margin: 6px 0 0 18px; padding: 0; }
.callout li { margin-top: 4px; }

/* Billing-rhythm note under the cards */
.calc-note { margin-top: 26px; font-size: 14.5px; line-height: 1.7; color: var(--muted-foreground); max-width: 74ch; }
.calc-note strong { color: var(--primary); font-weight: 600; }
