/* Aptly marketing site: the pricing page. Its plan cards (.tier) are also used by the API page.
   Shared tokens, navigation, footer and buttons are in site.css.
   The page head, FAQ list and closing band are in pages.css. */

/* ---------- Billing switch ---------- */

.billing { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }

.switch { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(248, 247, 242, 0.1); border: 1px solid rgba(248, 247, 242, 0.18); }
.switch label { position: relative; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { display: block; padding: 8px 18px; border-radius: 999px; font-size: 0.92rem; font-weight: 600; color: var(--on-forest-soft); transition: background-color 0.2s, color 0.2s; }
.switch input:checked + span { background: var(--leaf); color: var(--forest); }
.switch input:focus-visible + span { outline: 3px solid var(--leaf); outline-offset: 2px; }

.billing-note { font-size: 0.9rem; color: var(--on-forest-soft); }

/* ---------- Plans ---------- */

/* The plan cards sit over the bottom of the forest band. */
.tiers { position: relative; margin-top: -96px; padding-bottom: 72px; }
.tier-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }

.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px 24px;
  box-shadow: 0 30px 70px -38px rgba(19, 34, 9, 0.45);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tier-featured { border-color: var(--green-mid); box-shadow: 0 0 0 1px var(--green-mid), 0 34px 70px -34px rgba(19, 34, 9, 0.5); }
/* Set by the calculator: the plan that covers the visitor's volume. */
.tier.is-match { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 34px 70px -34px rgba(19, 34, 9, 0.5); }

.tier-flag {
  position: absolute;
  top: -12px;
  left: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-mid);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

.tier-name { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.tier-price { margin-top: 10px; font-family: var(--serif); font-size: 2.9rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tier-price small { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); }
.tier-billed { margin-top: 6px; min-height: 2.6em; font-size: 0.84rem; line-height: 1.3; color: var(--muted); }

.tier-allow { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.93rem; color: var(--body); }
.tier-allow li + li { margin-top: 4px; }
.tier-allow strong { color: var(--ink); font-weight: 600; }

.tier .btn { margin-top: 20px; width: 100%; padding: 14px 18px; }

.tier-has { margin-top: 20px; font-size: 0.84rem; font-weight: 600; color: var(--muted); }
.tier-list { margin-top: 8px; font-size: 0.92rem; color: var(--body); }
.tier-list li { position: relative; padding-left: 22px; }
.tier-list li + li { margin-top: 7px; }
.tier-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--green-mid);
  border-bottom: 2px solid var(--green-mid);
  transform: rotate(-45deg);
}

/* Enterprise sits below the four self-serve plans. */
.tier-wide {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) auto;
  gap: 16px 40px;
  align-items: center;
  background: var(--forest);
  color: var(--on-forest-soft);
  border-radius: 18px;
  padding: 26px 28px;
}
.tier-wide .tier-name { color: var(--on-forest); }
.tier-wide .tier-price { color: var(--on-forest); font-size: 2.1rem; margin-top: 6px; }
.tier-wide .tier-price small { color: var(--on-forest-soft); }
.tier-wide p { font-size: 0.95rem; }
.tier-wide .btn { white-space: nowrap; }

.tier-fine { margin-top: 22px; font-size: 0.92rem; color: var(--muted); text-align: center; }

/* ---------- Calculator ---------- */

.calc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }

.calc { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }

.calc-row + .calc-row { margin-top: 22px; }
.calc-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.calc-label output { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; font-variant-numeric: tabular-nums; }

.calc input[type="range"] { display: block; width: 100%; margin: 12px 0 0; accent-color: var(--green-mid); height: 24px; cursor: pointer; }

.calc-result { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.calc-total { font-family: var(--serif); font-size: 2.2rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc-total small { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); }
.calc-plan { margin-top: 8px; font-size: 1rem; color: var(--body); }
.calc-plan strong { color: var(--ink); }

/* ---------- API link ---------- */

.api-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.api-link h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.2; color: var(--ink); }
.api-link p { margin-top: 4px; font-size: 0.97rem; color: var(--body); max-width: 40rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .tier-wide { grid-template-columns: 1fr; }
  .tier-wide .btn { justify-self: start; }
  .calc-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 600px) {
  .tier-grid { grid-template-columns: 1fr; }
  .tier { padding: 24px 20px 22px; }
  .tier-billed { min-height: 0; }
  .tier-wide { padding: 22px 20px; }
  .tier-wide .btn { width: 100%; }
  .calc { padding: 22px 18px; }
  .api-link { padding: 22px 20px; }
  .api-link .btn { width: 100%; }
}
