/* Paywall modal styles — ported from OdinAI FronEnd/Site/src/styles/main.css
   (auth-modal / paywall-modal / pricing in modal), adapted to PG light theme.
   PG uses --surface/--primary/--muted; OdinAI rgb(var(--fg)) vars don't exist here. */

/* ── Auth + paywall dialog base ── */
.auth-modal {
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  max-height: 90dvh;
}
.auth-modal::backdrop {
  background: rgb(0 0 0 / 0.55);
  backdrop-filter: blur(4px);
}
.auth-card {
  position: relative;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: inherit;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.auth-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.auth-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
}

/* [03.11] Форма входа внутри модалки. В OdinAI блок опирался на Tailwind
   (@apply btn / btn-accent / btn-subtle / input-field), в PG этих классов нет:
   до этой правки кнопки рисовались дефолтным браузерным видом. Значения — на
   токенах PG (--primary/--border/--muted). */
.auth-modal .input-field {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.auth-modal .input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 48, 255, 0.12);
}
.auth-modal .btn-accent,
.auth-modal .btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.auth-modal .btn-accent {
  color: #fff;
  background: var(--primary);
}
.auth-modal .btn-accent:hover:not(:disabled) {
  background: var(--primary-dark);
}
.auth-modal .btn-accent:disabled {
  opacity: 0.6;
  cursor: default;
}
.auth-modal .btn-subtle {
  color: var(--text);
  background: var(--surface-alt);
  border-color: var(--border);
}
.auth-modal .btn-subtle:hover {
  background: #e6ebff;
}
/* display из правил выше перебивает UA-правило [hidden] — возвращаем. */
.auth-modal .auth-oauth-btn[hidden],
.auth-modal .auth-step[hidden] {
  display: none;
}
.auth-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.auth-label {
  font-size: 0.8125rem;
  color: var(--muted);
}
.auth-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.auth-submit {
  margin-top: 0.25rem;
}
.auth-link {
  font-size: 0.8125rem;
  text-align: center;
}
.auth-consent {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.auth-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  cursor: pointer;
}
.auth-consent-checkbox {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  accent-color: var(--primary);
  cursor: pointer;
}
.auth-consent-label a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-consent-label a:hover {
  color: var(--primary);
}
.auth-oauth-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-oauth-btn {
  justify-content: center;
}
.auth-error {
  margin: 0;
  font-size: 0.8125rem;
  text-align: center;
  color: #dc2626;
}
.auth-error[hidden] {
  display: none;
}
.tg-qr-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}
.tg-qr-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
  background: #fff;
  border-radius: 0.5rem;
}
.tg-qr-timer {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

/* ── Paywall: wider than auth (needs room for plans + packages grid) ── */
.paywall-modal {
  max-width: 860px;
}
.paywall-card {
  padding: 2rem;
  gap: 1rem;
}
.paywall-hint {
  margin: -0.25rem 0 0.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Pricing grid inside modal ── */
.paywall-card .pricing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.paywall-card .pricing-grid > * {
  flex: 1 1 240px;
  min-width: 0;
}
.paywall-card .pricing-section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.paywall-card .pricing-section + .pricing-section {
  margin-top: 1.5rem;
}

/* ── Plan cards in modal: typographic ladder (name/price/stats/timer/button) ── */
.paywall-card .pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.paywall-card .pricing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 48, 255, 0.24);
  box-shadow: 0 24px 48px -30px rgba(34, 48, 255, 0.2);
}
.paywall-card .pricing-card > * {
  position: relative;
  z-index: 1;
}
.paywall-card .pricing-card__name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  line-height: 1.25;
  text-align: center;
  margin-top: 1.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}
.paywall-card .pricing-card__price,
.paywall-card .pricing-card__price-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
}
.paywall-card .pricing-card__price-line strong {
  white-space: nowrap;
}
.paywall-card .pricing-card__per-month {
  white-space: nowrap;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}
.paywall-card .pricing-card__price-old {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  white-space: nowrap;
}
.paywall-card .pricing-card__price-final {
  font-weight: 700;
  white-space: nowrap;
}
.paywall-card .pricing-card__discount-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  white-space: nowrap;
}
.paywall-card .pricing-card__stats {
  margin-top: 1rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.9375rem;
  color: #0f172a;
}
.paywall-card .pricing-card__stat-credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
.paywall-card .pricing-card__timer {
  margin: 0.5rem auto 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.875rem;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ef4444;
  background: rgb(239 68 68 / 0.1);
  border: 1px solid rgb(239 68 68 / 0.35);
  border-radius: 999px;
  white-space: nowrap;
}
.paywall-card .pricing-card__buy {
  margin-top: 1.25rem;
  min-height: 48px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
.paywall-card .pricing-card__buy:hover {
  background: var(--primary-dark);
}
.paywall-card .pricing-card__buy:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Popular plan — lifted out of the row, accent border + badge line. */
.paywall-card .pricing-card--popular {
  border-color: rgba(34, 48, 255, 0.5);
  box-shadow: 0 24px 48px -30px rgba(34, 48, 255, 0.35);
  transform: translateY(-6px);
  z-index: 2;
}
.paywall-card .pricing-card--popular::after {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  z-index: 1;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.paywall-card .pricing-card--popular:hover {
  transform: translateY(-8px);
}
.paywall-card .pricing-card__badge {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 2;
  padding: 0.3rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  white-space: nowrap;
}

/* Ghost card (step 3 «try without subscription») — dashed, transparent. */
.paywall-offer-ghost {
  width: 100%;
  margin-bottom: 1.25rem;
}
.paywall-card .pricing-card--ghost {
  background: transparent;
  border: 1.5px dashed rgba(34, 48, 255, 0.55);
  box-shadow: none;
  padding-top: 1.25rem;
}
.paywall-card .pricing-card--ghost:hover {
  transform: none;
  background: transparent;
  border-color: rgba(34, 48, 255, 0.75);
}

/* Mobile: single column, no lift. */
@media (max-width: 640px) {
  .paywall-modal {
    max-width: calc(100vw - 2rem);
  }
  .paywall-card {
    padding: 1.25rem;
  }
  .paywall-card .pricing-grid > * {
    flex-basis: 100%;
  }
  .paywall-card .pricing-card--popular {
    transform: none;
  }
}
