/* ============================================================
   Pricing page

   Design notes
   ------------
   Each card puts the product, price and CTA ahead of its feature list. A subtle
   teal divider marks that transition without adding another information panel.

   Colour has one meaning each:
     teal  (--px-teal)  = accent and feature-list divider
     amber (--px-amber) = most popular         (the top rail, and nothing else)

   Type has two roles, both cut from the self-hosted IBM Plex Sans variable font
   so neither costs a network request: a display role at 600–700 with negative
   tracking, and a utility role — uppercase, 0.16em tracking, tabular numerals —
   for labels, units and spec values.

   Motion: one moment only. The minute meters fill on load, because that is the
   number the whole page turns on. Nothing else animates.

   NOTE: faq.html also loads this stylesheet and depends on .pricing-hero-*,
   .pricing-cta-section, .trust-*, .faq-* and .cta-buttons. Do not remove those.
   ============================================================ */

:root {
  --px-rule: rgba(255, 255, 255, 0.10);
  --px-rule-strong: rgba(255, 255, 255, 0.20);
  --px-teal: #38bfa1;
  --px-cyan: #22d3ee;
  --px-amber: #f2b441;
}

/* Keep pricing typography aligned with the shared Nexwin type system even if
   another stylesheet is added after the global base styles. */
body.pricing-page,
body.pricing-page button,
body.pricing-page input,
body.pricing-page select,
body.pricing-page textarea {
  font-family: var(--font-body);
}

/* Screen-reader-only text. The spec plate uses it to state whether a channel is
   included, so that state is never carried by colour or a glyph alone. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- The utility type role ---------- */
.pricing-section-label,
.spec-label,
.plan-rail-label,
.gst-note {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
}

/* ---------- Masthead ---------- */
.pricing-masthead {
  max-width: 880px;
  /* The trial banner used to sit between this and the plans; the gap is now
     the masthead's own. */
  margin: 0 auto 2.75rem;
  padding: 0.5rem 0 0;
  text-align: center;
}

.pricing-masthead h1 {
  margin: 0;
  font-size: clamp(1.7rem, 1.1rem + 2.1vw, 2.6rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: var(--text-primary);
  text-wrap: balance;
}

/* The trial terms, read as one line of separated clauses. The separator is a
   pseudo-element rather than a literal character so screen readers announce
   four plain phrases, and so the last item never trails a dot. On narrow
   screens the items wrap and the separators come along with them. */
.pricing-masthead-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.pricing-masthead-sub span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9rem;
}

.pricing-masthead-sub span + span::before {
  content: "\00B7";
  color: var(--px-teal);
  font-weight: 700;
}

/* ---------- Section label: tracked label followed by a hairline rule ---------- */
.pricing-tabs-container {
  max-width: 1200px;
  margin: 0 auto 3.5rem;
}

.pricing-section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.35rem;
  font-size: 0.68rem;
  color: var(--px-teal);
}

.pricing-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--px-rule);
}

/* ---------- The ladder ---------- */
.pricing-ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  /* Cards size to their own content: with the CTA up in the price row there is
     nothing at the bottom left to align, and stretching just left the shorter
     cards with a large empty tail. */
  align-items: start;
}

/* The per-product containers exist only so gen-pricing-html.ps1 keeps its
   markers and js/pricing.js keeps its fallback targets. Collapsing them lets
   all three cards share one grid, in DOM order: chat, then the two phone tiers. */
.pricing-ladder .pricing-cards-container {
  display: contents;
}

/* ---------- Card ---------- */
.pricing-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--px-rule);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02) 55%);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--px-rule-strong);
  box-shadow: 0 18px 40px rgba(2, 8, 18, 0.45);
}

/* Featured = whichever plan carries the badge. Marked in amber only, and never
   scaled: scaling would knock the spec plates out of line with each other. */
.pricing-card.featured {
  border-color: rgba(242, 180, 65, 0.45);
  background: linear-gradient(180deg, rgba(242, 180, 65, 0.09), rgba(255, 255, 255, 0.02) 45%);
  box-shadow: 0 18px 44px rgba(2, 8, 18, 0.50);
}

.pricing-card.featured:hover {
  border-color: rgba(242, 180, 65, 0.75);
}

/* ---------- Top rail ---------- */
/* Every card has one. Unflagged cards get an empty rail of the same height so
   plan names, prices and spec plates line up across the row. */
.plan-rail {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 1.6rem;
}

.plan-rail.is-flagged {
  background: var(--px-amber);
}

.plan-rail-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #17100a;
}

/* ---------- Card header ---------- */
.pricing-card-header {
  padding: 1.6rem 1.6rem 1.15rem;
  text-align: left;
}

.plan-name {
  margin: 0 0 0.45rem;
  /* Two lines reserved: "Nexwin AI Receptionist — Business" wraps and
     "Nexwin AI Chatbot" does not, and the prices below must still align. */
  min-height: 2.7em;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

/* The price is a fixed-height well with its contents pushed to the bottom, so
   the big numeral sits on the same line whether or not the plan has a
   struck-through "was" price above it. */
.plan-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 5.7rem;
  gap: 0.3rem;
  margin: 0;
}

.original-price {
  display: flex;
  align-items: baseline;
  text-decoration: line-through;
  opacity: 0.45;
}

.original-price .currency,
.original-price .period {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.original-price .amount {
  margin: 0 0.14rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-secondary);
}

.discounted-price {
  display: flex;
  align-items: baseline;
}

.currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.amount {
  margin: 0 0.3rem 0 0.1rem;
  font-size: 3.15rem;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.period {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dark-gray);
}

.gst-note {
  font-size: 0.62rem;
  color: var(--text-dark-gray);
}

/* Retained for the generator's custom-pricing branch (no tier uses it today). */
.plan-price.custom-pricing {
  justify-content: center;
}

.custom-pricing-text {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--px-teal);
}

.plan-description {
  min-height: 2.5em;
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--text-dark-gray);
}

/* Price and CTA on one row. The price well keeps its fixed height, so the
   buttons land on the same line across all three cards — which is what used to
   require the cards to be equal height. They no longer are. */
.plan-offer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.plan-cta {
  flex: 0 0 auto;
  padding-bottom: 0.35rem;
}

.plan-cta .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 1rem;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.plan-cta .btn:focus-visible {
  outline: 2px solid var(--px-cyan);
  outline-offset: 3px;
}

.trial-info {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--text-dark-gray);
  text-align: right;
}

/* ============================================================
   The spec plate — the page's signature element.
   Two rows, identical on every card: channels covered, and answered minutes
   per month. The meter is scaled against the highest tier's allowance
   (spec.minutesMax in pricing.json) so 500 reads as visibly half of 1,000,
   and chat — which is not metered at all — gets a dashed open rail instead
   of a fill.
   ============================================================ */
.plan-spec {
  display: grid;
  gap: 0.9rem;
  margin: 0 1.6rem 1.35rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--px-rule);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.spec-row {
  display: grid;
  gap: 0.5rem;
}

.spec-label {
  font-size: 0.6rem;
  color: var(--text-dark-gray);
}

/* Channels, stated as icons only — no chip, no label. The icon carries the
   whole message: teal = the plan covers that channel, dimmed = it does not.
   Colour is never the only signal; each icon is followed by .sr-only text
   naming the channel and its state. */
.spec-icons {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.spec-icon {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.26);
}

.spec-icon.is-on {
  color: var(--px-teal);
}

.spec-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.spec-row-minutes {
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.45rem 0.6rem;
}

.spec-row-minutes .spec-label {
  grid-column: 1;
}

.spec-value {
  grid-column: 2;
  justify-self: end;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.spec-meter {
  display: block;
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.spec-meter-fill {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--px-teal), var(--px-cyan));
  transform-origin: left center;
  animation: spec-meter-fill 0.85s 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes spec-meter-fill {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* Chat is unmetered, so there is nothing to fill — the rail is drawn open. */
.spec-meter.is-unmetered {
  background: repeating-linear-gradient(90deg,
      rgba(56, 191, 161, 0.28) 0 4px,
      rgba(255, 255, 255, 0.05) 4px 10px);
}

.spec-note {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--text-dark-gray);
}

/* ---------- Card body ---------- */
.pricing-card-body {
  position: relative;
  padding: 1.35rem 1.6rem 1.6rem;
}

/* Brightest at the centre, fading gently into the card at either end. */
.pricing-card-body::before {
  content: "";
  position: absolute;
  top: 0;
  right: 1.6rem;
  left: 1.6rem;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(56, 191, 161, 0.3) 20%,
      #83f3db 50%,
      rgba(56, 191, 161, 0.3) 80%,
      transparent 100%);
  box-shadow: 0 0 5px rgba(56, 191, 161, 0.5),
      0 0 12px rgba(56, 191, 161, 0.2);
}

/* A small offer marker gives the included Chatbot line one clear visual priority. */
.free-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 0.24rem;
  padding: 0.16rem 0.38rem 0.14rem;
  border-radius: 0.2rem;
  background: linear-gradient(135deg, #ffd777, #f2ad35);
  color: #182130;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: none;
  vertical-align: 0.08em;
  box-shadow: 0 2px 8px rgba(242, 173, 53, 0.25);
}

.plan-features-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-features-list li {
  position: relative;
  padding: 0.36rem 0 0.36rem 1.3rem;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.plan-features-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0.42rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--px-teal);
}

.plan-features-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}



/* ---------- Hero (used by faq.html, not by pricing.html) ---------- */
.pricing-hero-section {
  text-align: center;
  padding: 60px 0 40px;
}

/* faq.html opens with this section, where the 60px sits directly under main's
   header offset and reads as dead space. The padding is only meaningful when
   something precedes it. */
main > .container:first-child > .pricing-hero-section {
  padding-top: 0;
}

.pricing-hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--primary-color), var(--primary-accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-hero-content p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Value Comparison Section */
.value-comparison-section {
  padding: 60px 0;
  text-align: center;
}

.value-comparison-section h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.comparison-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--subtle-border-light);
  border-radius: 12px;
  padding: 30px;
  text-align: left;
}

.comparison-card.featured {
  border-color: var(--primary-accent-color);
  background: rgba(var(--primary-accent-color-rgb), 0.1);
}

.comparison-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.comparison-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-accent-color);
  margin-bottom: 25px;
}

.comparison-features {
  list-style: none;
  padding: 0;
}

/* Not flex: a flex li makes <strong> and the text after it separate items, so a
   bullet like "<strong>FREE Nexwin AI Chatbot</strong> — unlimited messages…"
   lays out as two narrow columns instead of one wrapping sentence. */
.comparison-features li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.comparison-features li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}

.comparison-features li.positive::before {
  content: "✓";
  color: var(--primary-color);
}

.comparison-features li.negative::before {
  content: "✗";
  color: #ff6b6b;
}

/* Default link blue is illegible on the dark ground. */
.comparison-features a {
  color: var(--primary-accent-color);
}

.roi-highlight {
  background: rgba(var(--primary-color-rgb, 56, 191, 161), 0.1);
  border: 1px solid rgba(var(--primary-color-rgb, 56, 191, 161), 0.3);
  border-radius: 12px;
  padding: 25px;
  margin-top: 30px;
}

.roi-highlight p {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
}

/* FAQ Section */
.pricing-faq-section {
  padding: 60px 0;
}

.pricing-faq-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  color: var(--text-primary);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--subtle-border-light);
  border-radius: 12px;
  padding: 25px;
}

.faq-item h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 15px;
}

.faq-item p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* CTA Section */
.pricing-cta-section {
  text-align: center;
  padding: 60px 0;
}

.pricing-cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.pricing-cta-section p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.trust-indicators {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.trust-icon {
  font-size: 1.2rem;
}

/* ============================================================
   Responsive
   ============================================================ */

/* A pricing ladder reads as a full row or a full stack — a 2-up leaves an
   orphan card and breaks the left-to-right reading order the plates rely on. */
@media (max-width: 1020px) {
  .pricing-ladder {
    grid-template-columns: minmax(0, 1fr);
    max-width: 480px;
    gap: 1.1rem;
  }

  /* Stacked, the alignment reserves are dead weight and just add whitespace. */
  .plan-name,
  .plan-price,
  .plan-description {
    min-height: 0;
  }

  .plan-rail:not(.is-flagged) {
    height: 0;
  }
}

@media (max-width: 768px) {
  .amount {
    font-size: 2.75rem;
  }

  .comparison-grid,
  .faq-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .trust-indicators {
    flex-direction: column;
    gap: 20px;
  }

  .value-comparison-section h2,
  .pricing-faq-section h2,
  .pricing-cta-section h2 {
    font-size: 2rem;
  }

  .cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .btn.large {
    width: 100%;
  }
}

@media (max-width: 560px) {
  /* Not enough room for price and button side by side. */
  .plan-offer {
    display: block;
  }

  .plan-cta {
    padding-bottom: 0;
    margin-top: 1rem;
  }

  .plan-cta .btn {
    width: 100%;
  }

  .trial-info {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .pricing-hero-content h1 {
    font-size: 1.8rem;
  }

  .pricing-card-header,
  .plan-spec,
  .pricing-card-body,
  .plan-rail {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .plan-spec {
    margin-left: 1.15rem;
    margin-right: 1.15rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .pricing-card-body::before {
    right: 1.15rem;
    left: 1.15rem;
  }

  .amount {
    font-size: 2.5rem;
  }

  .comparison-card,
  .faq-item {
    padding: 20px;
  }
}

/* One motion moment on this page — the meters filling. Honour the opt-out for
   it and for the card lift. */
@media (prefers-reduced-motion: reduce) {

  .spec-meter-fill {
    animation: none;
  }

  .pricing-card {
    transition: none;
  }

  .pricing-card:hover {
    transform: none;
  }
}
