/* Subscription "Тарифы" page: a centered pricing table with a free plan and the
 * paid plan side by side, plus a monthly/yearly billing toggle
 * (billing_controller.js). Rendered inside the shared docs grid (left menu +
 * content), so it sits in the content column alongside the sidebar. */

/* The pricing UI lives inside the shared .content-card, which supplies the white
   frame and padding — so this wrapper just holds the content. */
.pricing {
  min-width: 0;
}

/* Header (title + lead) uses the shared .page-header / .page-title / .page-lead
   primitives (application.css). Only the inline brand wordmark is page-specific. */
.pricing__brand {
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

/* Billing period toggle -------------------------------------------------- */
/* Header text is left-aligned, but the billing toggle sits centered above the
   (centered) plan cards. width:fit-content + auto side margins centres the pill. */
.pricing__toggle {
  display: flex;
  width: fit-content;
  margin: 28px auto 0;
  padding: 4px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pricing__period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 9px 20px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.pricing__period.is-active {
  background: var(--ink);
  color: #fff;
}

.pricing__save {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--success-bg);
  color: var(--success);
}

/* ===== Plan grid ======================================================== */
.pricing__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  max-width: 880px;
  /* Top gap clears the toggle above and the pro card's РЕКОМЕНДУЕМ badge (top: -12px). */
  margin: 40px auto 0;
}

.plan {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 34px 32px;
}

.plan--pro {
  position: relative;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 40px 80px -40px rgba(14, 20, 36, 0.6);
}

.plan__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
}

.plan__name {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.plan__tagline {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 22px;
}

.plan--pro .plan__tagline {
  color: #9ba3b8;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 26px;
}

/* Paid card tightens the gap under the price to make room for the note line. */
.plan--pro .plan__price {
  margin-bottom: 4px;
}

.plan__amount {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan__period {
  font-size: 14px;
  color: var(--muted-2);
}

.plan--pro .plan__period {
  color: #9ba3b8;
}

/* Yearly/monthly savings line under the paid price. Reserves height so the
   toggle doesn't shift the layout when the note text changes length. */
.plan__note {
  font-size: 13px;
  color: #9ba3b8;
  margin: 0 0 22px;
  min-height: 20px;
}

/* Feature list ----------------------------------------------------------- */
.plan__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1;
  margin: 0;
  padding: 0;
}

.plan__features li {
  display: flex;
  gap: 11px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.plan--pro .plan__features li {
  color: #e4e7ef;
}

.plan--pro .plan__features b {
  color: #fff;
}

.plan__check {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--success);
}

.plan--pro .plan__check {
  color: #9de0b8;
}

/* Calls to action -------------------------------------------------------- */
/* The free and paid CTAs share these box metrics (font-size, line-height,
   padding, 1.5px border) so they render at the exact same height and line up
   perfectly where the cards sit side by side. */
/* Positioning only — appearance comes from .btn .btn--*. The paid CTA is wrapped
   in a button_to <form>, so zero the form's box and let the button carry the gap. */
.plan__cta {
  margin-top: 30px;
}

.plan > form:has(> .plan__cta) {
  margin: 0;
}

/* Caption line under each plan's CTA. Present on every card (empty on the free
   and unsubscribed cards) so its reserved height keeps the CTAs / status pill on
   a shared baseline where the cards sit side by side. */
.plan__caption {
  margin: 12px 0 0;
  min-height: 1.5em;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-2);
  text-align: center;
}

.plan--pro .plan__caption {
  color: #8890a2;
}

/* ===== Footnote ========================================================= */
.pricing__foot {
  margin-top: 36px;
  font-size: 13.5px;
  color: var(--muted-2);
  text-align: center;
}

/* ===== Subscribed account / status view ================================= */
/* Shown instead of the pricing table once the member has an active period. No
   card / renewal / change-plan controls yet — billing management isn't built. */
/* Header uses the shared .page-header / .page-title / .page-lead primitives. */
.account {
  min-width: 0;
}

/* Status card (dark) ---------------------------------------------------- */
.sub-status {
  display: flex;
  gap: 20px;
  padding: 30px 32px;
  margin-bottom: 24px;
  background: var(--ink);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 80px -46px rgba(14, 20, 36, 0.55);
}

.sub-status__icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: rgba(157, 224, 184, 0.14);
  color: #9de0b8;
}

.sub-status__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.sub-status__title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.sub-status__badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(157, 224, 184, 0.16);
  color: #9de0b8;
}

.sub-status__meta {
  font-size: 14.5px;
  line-height: 1.5;
  color: #9ba3b8;
}

.sub-status__meta b {
  color: #fff;
  font-weight: 700;
}

/* Plan-includes card (light) -------------------------------------------- */
.sub-plan {
  padding: 30px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.sub-plan__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.sub-plan__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.sub-plan__badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
}

.sub-plan__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
  padding: 0;
}

.sub-plan__features li {
  display: flex;
  gap: 11px;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--text-2);
}

.sub-plan__foot {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ===== Responsive ======================================================= */
@media (max-width: 720px) {
  .pricing__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .plan {
    padding: 30px 24px;
  }

  /* Keep the "РЕКОМЕНДУЕМ" badge clear of the free card above it. */
  .plan--pro {
    margin-top: 8px;
  }

  .sub-status,
  .sub-plan {
    padding: 26px 22px;
  }
}
