/* Страница тарифов /tariffs в стиле лендинга. Общее (страница, шапка, подвал, поля и согласия) в public-v2.css.
   Карточки рисует tariff-cards.js, итог оплаты и окно оформления — tariffs-page.js.
   Кукла сидит на верхнем краю лаймовой карточки (поза из web/img/doll/, см. docs/plans/public-pages-v2.md). */

.tf-head-actions { display: flex; gap: 10px; }

.tf-main { padding: clamp(32px, 6vw, 88px) max(var(--pad), env(safe-area-inset-right, 0px)) 0 max(var(--pad), env(safe-area-inset-left, 0px)); }

/* ---------- заголовок ---------- */
.tf-hero { display: flex; flex-direction: column; gap: 20px; max-width: 880px; }
.tf-account { font-size: var(--font-small); color: var(--text-secondary); }
.tf-account__id { color: var(--text-muted); }
.tf-hero h1 { font-size: clamp(48px, 7.2vw, 108px); line-height: 0.95; }
.tf-lead { max-width: 560px; font-size: clamp(17px, 1.6vw, 22px); color: var(--text-secondary); }
.tf-bonus { max-width: 620px; }

/* ---------- итог оплаты ---------- */
.tf-payment {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  max-width: 880px;
  margin-top: 32px;
  padding: 20px 24px;
  border-radius: var(--radius-card);
  background: var(--surface);
}
.tf-payment__text { flex: 1 1 280px; font-size: 17px; }
.tf-payment--fail .tf-payment__text { color: var(--danger); }
.tf-payment--success { background: var(--lime); color: var(--accent-ink); padding-left: 112px; min-height: 120px; }
.tf-payment__doll { position: absolute; left: 22px; bottom: 6px; width: 72px; height: auto; }

/* ---------- карточки: место сверху под куклу ---------- */
.tf-plans {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 2vw;
  align-items: start;
  max-width: 1240px;
  padding-top: 216px;
}
.tf-plans[data-count="1"] { max-width: 600px; }
.tf-plans[data-count="2"] { --cols: 2; max-width: 1080px; }
.tf-plans[data-count="3"] { --cols: 3; }
.tf-plans__state { grid-column: 1 / -1; color: var(--text-muted); }

.tf-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(22px, 2.4vw, 36px);
  border-radius: var(--radius-panel);
  background: var(--surface);
  outline: 2px solid transparent;
  outline-offset: 4px;
  transition: outline-color 0.2s ease;
}
.tf-plan.is-selected { outline-color: var(--lime); }
.tf-plan--featured { background: var(--lime); color: var(--accent-ink); }
.tf-plan--featured.is-selected { outline-color: var(--text-primary); }

.tf-plan__name { font-size: clamp(20px, 1.8vw, 26px); font-weight: var(--weight-medium); letter-spacing: -0.01em; }
.tf-plan__deal { font-size: var(--font-small); }
.tf-plan__deal s { opacity: 0.7; }
.tf-plan__price { margin-top: 4px; font-size: clamp(48px, 5.4vw, 88px); font-weight: var(--weight-light); line-height: 1; white-space: nowrap; }
.tf-plan__price b { font-weight: var(--weight-light); }
.tf-plan__price small { font-size: 0.26em; font-weight: 400; letter-spacing: 0; }
.tf-plan__summary { font-size: var(--font-body); color: var(--text-secondary); }
.tf-plan--featured .tf-plan__summary { color: var(--accent-ink); }

/* возможности строками с тонкими разделителями, без точек и значков */
.tf-plan__list { list-style: none; margin: 16px 0 0; padding: 0; }
.tf-plan__list li { padding: 12px 0; border-top: 1px solid var(--border-strong); font-size: var(--font-body); }
.tf-plan--featured .tf-plan__list li { border-top-color: color-mix(in srgb, var(--accent-ink) 18%, transparent); }
.tf-plan__gift { font-weight: var(--weight-medium); }

.tf-plan__action { width: 100%; margin-top: 16px; }
.tf-plan__action:disabled { opacity: var(--opacity-off); cursor: default; }
.tf-plan--featured .ui-button--ink:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-ink) 86%, var(--lime)); }
.tf-plan__have { margin-top: 16px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-secondary); font-weight: var(--weight-medium); }

/* кукла сидит на верхнем крае лаймовой карточки: сиденье на линии края (около 72% высоты кадра), ноги свешиваются на карточку.
   Без анимации. */
.tf-doll {
  --doll-w: 150px;
  position: absolute;
  right: clamp(24px, 4vw, 56px);
  top: calc(var(--doll-w) * -1.237);
  width: var(--doll-w);
  height: auto;
  pointer-events: none;
}

/* ---------- вопросы ---------- */
.tf-faq { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px 6vw; align-items: start; padding: clamp(72px, 9vw, 144px) 0 clamp(56px, 7vw, 112px); }
.tf-faq h2 { font-size: clamp(40px, 5.4vw, 88px); line-height: 0.98; }
.tf-faq__list { display: flex; flex-direction: column; gap: 12px; }
.tf-faq__list article { background: var(--surface); border-radius: var(--radius-card); padding: 20px 24px; }
.tf-faq__list h3 { margin: 0; font-size: 20px; font-weight: var(--weight-medium); }
.tf-faq__list p { margin-top: 6px; color: var(--text-secondary); }

/* ---------- окно оформления: по центру, на телефоне лист снизу ---------- */
.tf-checkout {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 28px;
  border: 0;
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-ui);
  overflow-y: auto;
}
.tf-checkout::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.tf-checkout[open] { animation: tf-rise 0.24s ease-out; }
@keyframes tf-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.tf-checkout__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.tf-checkout__head h2 { font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; }
.tf-checkout__price { margin-top: 6px; color: var(--text-secondary); }
.tf-checkout__close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -6px 0 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-primary);
  cursor: pointer;
}
.tf-checkout__close svg { width: 20px; height: 20px; }
.tf-checkout__consents { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-card); background: var(--surface-2); }
body:has(.tf-checkout[open]) { overflow: hidden; }

@media (max-width: 899px) {
  .tf-plans, .tf-plans[data-count] { --cols: 1; max-width: 600px; gap: 14px; }
  .tf-plan--featured { order: -1; }   /* кукла стоит на первой карточке, в поле под нитью */
  .tf-faq { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .tf-head-actions { gap: 8px; }
  .tf-head-actions .ui-button { height: 44px; padding: 0 16px; }
  .tariffs-v2 .lg-logo img { height: 40px; }
  .tf-hero { gap: 14px; }
  .tf-hero h1 { font-size: 44px; }
  .tf-plans { padding-top: 160px; }
  .tf-plan { padding: 22px; border-radius: var(--radius-card); }
  .tf-plan__price { font-size: 52px; }
  .tf-doll { --doll-w: 112px; right: 24px; }
  .tf-payment { padding: 18px 20px; }
  .tf-payment--success { padding-left: 92px; }
  .tf-payment__doll { width: 60px; left: 18px; }
  .tf-faq__list article { padding: 18px 20px; }
  .tf-faq__list h3 { font-size: 18px; }
  .tf-checkout {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    padding: 24px 20px max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
    border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  }
  .tf-checkout__head h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .tf-checkout[open] { animation: none; }
  .tf-plan { transition: none; }
}
