.pricing {
  padding-block: clamp(60px, 9vh, 140px);
  text-align: center;
  position: relative;
  /* visible so clouds can bleed into adjacent sections; main's overflow:hidden
     prevents any horizontal scroll at the page level. */
  overflow: visible;
  isolation: isolate;
}

@media (max-width: 720px) {
  .pricing { padding-block: clamp(40px, 7vh, 100px); }
}

/* Decorative clouds — clustered low-left + one drifting mid-right + a small
   one peeking from top-center. Deliberately asymmetric so the layout doesn't
   echo the CTA section's four-corner pattern. */
.pricing__cloud {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: -1;
  height: auto;
}

/* Big foreground-feeling cluster at bottom-left */
.pricing__cloud--low1 { bottom: -2%;  left: -4%; width: 28%; max-width: 480px; opacity: 0.45; }
.pricing__cloud--low2 { bottom: 12%;  left: 12%; width: 16%; max-width: 280px; opacity: 0.30; }

/* Mid-right drift, fills the negative space alongside the card row */
.pricing__cloud--mid  { top: 56%; right: -3%; width: 22%; max-width: 400px; opacity: 0.40; }

/* Small peek up top, slightly off-center, behind the heading area */
.pricing__cloud--top  { top: 4%;  left: 28%; width: 14%; max-width: 240px; opacity: 0.28; }

@media (max-width: 860px) {
  .pricing__cloud { display: none; }
}

.pricing__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pricing__heading {
  font-size: clamp(46px, 5vw, 70px);
  margin-top: 12px;
  text-align: center;
}

/* ── Billing toggle ───────────────────────────────────────────── */

.pricing__toggle {
  margin-top: clamp(24px, 4vh, 40px);
  display: inline-flex;
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 6px;
  gap: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.pricing__toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  border: 0;
  background: transparent;
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-navy);
  cursor: pointer;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.pricing__toggle-btn:hover { color: color-mix(in srgb, var(--c-navy) 70%, black); }
.pricing__toggle-btn.is-active {
  background: var(--c-sage);
  color: #fff;
}

.pricing__save {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--c-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}

/* ── Grid + cards ─────────────────────────────────────────────── */

.pricing__grid {
  margin-top: clamp(40px, 6vh, 64px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: left;
}

.plan {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  isolation: isolate;
}

.plan__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* Uniform height so the price below starts at the same spot on every card —
     otherwise the differently-sized plan icons (27/47/55px) push each price
     down by a different amount. */
  min-height: 56px;
}

.plan__name {
  font-family: var(--ff-script);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
  color: var(--c-navy);
}

.plan__icon {
  display: block;
  width: auto;
  flex-shrink: 0;
}

/* Per-plan icon heights — widths follow naturally via auto + intrinsic aspect ratio.
   Margin-top nudges compensate for the different visual weights of each cloud SVG. */
.plan--free     .plan__icon { height: 27px; margin-top: 12px; }
.plan--standard .plan__icon { height: 47px; margin-top: 4px; }
.plan--pro      .plan__icon { height: 55px; }

/* Price line */
.plan__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.plan__price-amount {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1;
  color: var(--c-text);
}
.plan__price-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-sage);
}

/* Monthly / Annually price swap — driven by data-period on the section
   (set in PHP for initial state, toggled by bootPricingToggle in main.js). */
.pricing[data-period="monthly"] [data-annually] { display: none; }
.pricing[data-period="annually"] [data-monthly] { display: none; }

/* "Everything in X, plus:" line */
.plan__lead {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-orange);
  margin: 0;
}

/* Feature list */
.plan__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan__features li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 14px;
  line-height: 1.45;
  color: var(--c-text);
}
.plan__features li::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2388BC86' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 12 10 17 19 7'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 2px;
}

/* ── Enterprise plan — sky-themed background + outline button ──
   Background image goes directly on the card (no .plan__sky element needed);
   negative-z-index siblings can get occluded by the parent's solid bg color. */
.plan--enterprise {
  background-image: url('../../images/enterprise-cloud.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: contain;
}

.plan__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border: 2px solid var(--c-navy);
  border-radius: var(--radius-pill);
  background: #fff;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--c-navy);
  width: fit-content;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.plan__contact:hover { background: var(--c-navy); color: #fff; }

/* ── CTA row below the grid ───────────────────────────────────── */

.pricing__actions {
  margin-top: clamp(36px, 5vh, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pricing__microcopy {
  font-size: var(--fs-micro);
  color: var(--c-microcopy);
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .pricing__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .pricing__grid { grid-template-columns: 1fr; }
  .plan { padding: 28px 24px; }
  .plan__name { font-size: 32px; }
  .plan__price-amount { font-size: 42px; }
}
