/* =========================================================
   CloudSpark — Pricing page CSS (only for /pricing/)
   ========================================================= */

/* Hero tweaks (reuses global hero tokens) */
.pricing-hero {
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

/* =========================
   Billing toggle (CSS-only)
   ========================= */
.billing-control {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  gap: 0.25rem;
  width: max-content;
  margin: 0 auto clamp(1.25rem, 3vw, 1.75rem) auto;
  background: var(--bs-surface-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  padding: 0.25rem;
}
.billing-control input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.billing-control label {
  position: relative;
  z-index: 2;
  user-select: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--bs-body-color);
  cursor: pointer;
}
.billing-control .save {
  font-weight: 700;
  margin-left: 0.35rem;
  color: var(--bs-primary);
}
.billing-control .bg {
  position: absolute;
  z-index: 1;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 0.25rem);
  background: rgba(var(--bs-primary-rgb), 0.12);
  border-radius: 999px;
  transition: transform 0.2s ease;
}

/* Move highlight when Yearly is selected (no JS) */
#billYearly:checked ~ .plans,
#billYearly:checked ~ .plans + * {
  /* no-op to keep sibling order awareness */
}

#billYearly:checked ~ .plans .price .price-monthly {
  display: none;
}
#billYearly:checked ~ .plans .price .price-yearly {
  display: inline;
}

#billMonthly:checked ~ .plans .price .price-monthly {
  display: inline;
}
#billMonthly:checked ~ .plans .price .price-yearly {
  display: none;
}

/* Move the highlight pill */
#billYearly:checked ~ .plans::before {
  transform: translateX(100%);
}
#billMonthly:checked ~ .plans::before {
  transform: translateX(0%);
}
/* Inject pseudo element linked to the control's bg (works because .plans follows the inputs) */
.plans {
  position: relative;
}
.plans::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -52px; /* aligns with .billing-control */
  left: 50%;
  transform: translateX(0%);
  width: min(182px, 42vw);
  height: 36px;
  background: rgba(var(--bs-primary-rgb), 0.12);
  border-radius: 999px;
  pointer-events: none;
  transition: transform 0.2s ease;
}
/* Hide the pseudo highlight on very small viewports if misaligned */
@media (max-width: 420px) {
  .plans::before {
    display: none;
  }
}

/* =========================
   Plan cards
   ========================= */
.plan-card {
  background-color: var(--bs-surface-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 16px;
  padding: 1.25rem;
}
.plan-card .plan-head h5 {
  margin-bottom: 0.1rem;
}
.plan-card .badge-spark {
  background: rgba(var(--bs-primary-rgb), 0.14);
  color: var(--bs-primary);
  border: 1px solid
    color-mix(in srgb, var(--bs-border-color), var(--bs-primary) 35%);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.plan--featured {
  border-color: color-mix(
    in srgb,
    var(--bs-border-color),
    var(--bs-primary) 35%
  );
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

/* Price block */
.price .value {
  font-size: 2rem;
  font-weight: 800;
  margin-right: 0.25rem;
}
.price .value.price-free {
  font-weight: 800;
}
.price .suffix {
  color: var(--bs-gray-600);
  font-weight: 600;
}
.price .price-yearly,
.price .price-monthly {
  display: none;
} /* CSS toggle will flip */

/* Feature list checks (pure CSS) */
.plan-feats li {
  display: flex;
  gap: 0.5rem;
  align-items: start;
}
.plan-feats .check {
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.15rem;
  border-radius: 8px;
  background: rgba(var(--bs-primary-rgb), 0.12);
  border: 1px solid
    color-mix(in srgb, var(--bs-border-color), var(--bs-primary) 35%);
  position: relative;
  flex: 0 0 auto;
}
.plan-feats .check::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.35rem;
  width: 0.4rem;
  height: 0.22rem;
  border-left: 2px solid var(--bs-primary);
  border-bottom: 2px solid var(--bs-primary);
  transform: rotate(-45deg);
}

/* =========================
   Comparison table
   ========================= */
.pricing-compare .table {
  margin-bottom: 0;
}
.pricing-compare .table thead th {
  background: color-mix(in srgb, var(--bs-surface-bg), transparent 0%);
  color: var(--bs-heading-color);
  border-bottom: 1px solid var(--bs-border-color);
}
.pricing-compare .table th,
.pricing-compare .table td {
  border-color: var(--bs-border-color);
}
.pricing-compare .table th {
  white-space: nowrap;
}

.pricing-compare .check {
  display: inline-block;
  vertical-align: middle;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 8px;
  background: rgba(var(--bs-primary-rgb), 0.12);
  border: 1px solid
    color-mix(in srgb, var(--bs-border-color), var(--bs-primary) 35%);
  position: relative;
  margin-right: 0.4rem;
}
.pricing-compare .check::after {
  content: "";
  position: absolute;
  left: 0.22rem;
  top: 0.3rem;
  width: 0.38rem;
  height: 0.2rem;
  border-left: 2px solid var(--bs-primary);
  border-bottom: 2px solid var(--bs-primary);
  transform: rotate(-45deg);
}

/* Responsive niceties */
.pricing-compare .table-responsive {
  background: var(--bs-surface-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 16px;
  overflow: auto; /* enable scroll only inside the wrapper */
}

/* Spacing tweaks */
.pricing-plans {
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
}
.pricing-compare {
  padding-top: clamp(2rem, 5vw, 3rem);
}
