/* ── PRICING PAGE ──────────────────────────────────────── */
/* Reuses the tokens, .sec-label/.sec-h2, .feat-card, .faq and .cta-strip
   defined in styles.css — only pricing-specific pieces live here. */

.pricing-hero {
  background: var(--paper);
  padding: 4.5rem 0 5.5rem;
  position: relative;
  overflow: hidden;
}

/* Same treatment as the homepage hero, centred rather than offset left. */
.pricing-hero-blob {
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 130%;
  background: linear-gradient(83deg, #ceaed474 15%, #abd4e693 33%, #73edc097 55%, #8c91e86b 100%);
  filter: blur(110px);
  opacity: .7;
  pointer-events: none;
  z-index: 0;
}

.pricing-h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.1rem;
}
.pricing-h1 em { font-style: normal; color: var(--primary); }

.pricing-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto;
}

/* ── BILLING TOGGLE ────────────────────────────────────── */
/* Hidden from view but kept in the tab order and the accessibility tree, so the
   switch is operable by keyboard and announced by screen readers. `display:none`
   or the `hidden` attribute would remove both. */
.billing-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.billing-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin: 2.75rem 0 2.5rem;
}

.billing-switch-inner {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  cursor: pointer;
  user-select: none;
}

.bs-opt {
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .2s;
}
.bs-monthly { color: var(--primary); }

.bs-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 2rem;
  background: var(--primary);
  flex-shrink: 0;
  transition: background .2s;
}

.bs-thumb {
  position: absolute;
  top: 3px;
  /* Logical, not physical: in RTL the "Monthly" label sits on the right, so the
     thumb has to rest against the inline start and travel the other way. */
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .22s ease;
}

/* Keyboard focus lands on the visually-hidden checkbox, so surface it on the track. */
.billing-toggle-input:focus-visible ~ .billing-switch .bs-track {
  outline: 2px solid var(--primary-dark);
  outline-offset: 3px;
}

.billing-save {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #166534;
  background: #dcfce7;
  padding: .28rem .7rem;
  border-radius: 2rem;
  opacity: .55;
  transition: opacity .2s;
}

/* ── TOGGLE STATE ──────────────────────────────────────── */
/* Annual prices are hidden by default and swapped in when the box is checked.
   Both sets ship in the HTML so the page is complete without CSS or JS. */
.price-annual { display: none; }

.billing-toggle-input:checked ~ .billing-switch .bs-thumb { transform: translateX(20px); }
.billing-toggle-input:checked ~ .billing-switch .bs-monthly { color: var(--muted); }
.billing-toggle-input:checked ~ .billing-switch .bs-annual { color: var(--primary); }
.billing-toggle-input:checked ~ .billing-switch .billing-save { opacity: 1; }

.billing-toggle-input:checked ~ .pricing-grid .price-monthly { display: none; }
.billing-toggle-input:checked ~ .pricing-grid .price-annual { display: block; }
.billing-toggle-input:checked ~ .pricing-grid .plan-price-note .price-annual { display: inline; }

/* ── PLAN CARDS ────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.plan-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 1.15rem;
  padding: 2rem 1.85rem;
  position: relative;
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.plan-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79,85,193,.2);
  box-shadow: 0 12px 44px rgba(79,85,193,.12);
}

.plan-card-featured {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 16px 52px rgba(79,85,193,.18);
}
.plan-card-featured:hover {
  border-color: var(--primary);
  box-shadow: 0 20px 60px rgba(79,85,193,.26);
}

.plan-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .85rem;
  border-radius: 2rem;
  white-space: nowrap;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .35rem;
}

.plan-tagline {
  font-size: .88rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  min-height: 2.7em;
}

.plan-price { margin-bottom: .5rem; }

.price-amount {
  font-size: 2.85rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}

.price-period {
  font-size: .95rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: .25rem;
}

.plan-price-note {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 1.5rem;
  min-height: 1.4em;
}

.plan-portals {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--primary-pale);
  border-radius: .7rem;
  padding: .75rem 1rem;
  margin-bottom: 1.75rem;
}
.plan-portals svg { color: var(--primary); flex-shrink: 0; }

/* Pushed to the bottom so the buttons line up across cards of unequal height. */
.plan-cta {
  margin-top: auto;
  display: block;
  text-align: center;
  background: var(--primary-pale);
  color: var(--primary);
  font-weight: 700;
  font-size: .95rem;
  padding: .8rem 1.5rem;
  border-radius: 2rem;
  transition: background .2s, color .2s, transform .15s;
}
.plan-cta:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.plan-cta-featured {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 24px rgba(79,85,193,.32);
}
.plan-cta-featured:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 10px 32px rgba(79,85,193,.42);
}

/* ── INCLUDED-EVERYWHERE SECTION ───────────────────────── */
.pricing-incl {
  background: var(--paper-warm);
  padding: 6rem 0;
}

.pricing-incl-sub {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
  max-width: 520px;
  margin: .75rem auto 0;
}

/* The shared .feat-card sits on white; on the warm ground it needs its own surface. */
.pricing-incl .feat-card { background: #fff; }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto;
    gap: 2rem;
  }
  /* Vertical stacking puts the badge over the card above it, so lift the row. */
  .plan-card-featured { margin-top: .5rem; }
  .plan-tagline { min-height: 0; }
}

@media (max-width: 575.98px) {
  .pricing-hero { padding: 3rem 0 4rem; }
  .pricing-incl { padding: 4rem 0; }
  .plan-card { padding: 1.75rem 1.35rem; }
  .price-amount { font-size: 2.4rem; }
  .billing-switch { margin: 2.25rem 0 2rem; }
}

/* ── RTL ───────────────────────────────────────────────── */
[dir="rtl"] .price-period { margin-left: 0; margin-right: .25rem; }
[dir="rtl"] .billing-toggle-input:checked ~ .billing-switch .bs-thumb { transform: translateX(-20px); }

/* Prices are a Latin run inside RTL text. Isolating them keeps the currency symbol
   attached to its own number instead of being reordered against a neighbouring word. */
.price-amount { direction: ltr; unicode-bidi: isolate; }

/* .plan-badge needs no RTL rule: `left:50%` + `translate(-50%,-50%)` centres it in
   both directions, and transforms are not mirrored by `dir`. */

/* ── REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .plan-card, .plan-cta, .bs-thumb { transition: none; }
  .plan-card:hover, .plan-cta:hover { transform: none; }
}
