/* ==========================================================================
   tarify.css — Страница тарифов | Алиса AI Bridge
   Зависит от theme.css (переменные, базовые классы)
   ========================================================================== */

/* ==========================================================================
   HERO
   ========================================================================== */

.tarify-hero {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.tarify-hero__sub {
  font-size: clamp(1rem, 2vw, 1.125rem);
  max-width: 56ch;
  margin-inline: auto;
  margin-top: 1rem;
  color: var(--ink-soft);
}

.link-clay {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t);
}

.link-clay:hover {
  color: var(--clay-deep);
}

/* ==========================================================================
   TIERS GRID
   ========================================================================== */

/* Колонки по размеру карточки, а не «четыре на всю ширину»: при двух тарифах
   жёсткая сетка из четырёх колонок оставляла карточки прижатыми влево, с пустой
   половиной справа. auto-fit + justify-content центрирует любое их количество и
   не потребует правки CSS, если тарифов станет больше или меньше. */
.tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  gap: 1.5rem;
  align-items: start;
}

/* Совсем узкие экраны: карточка занимает всю доступную ширину, иначе
   минимум в 240px вылезет за края. */
@media (max-width: 360px) {
  .tiers-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading placeholder */
.tiers-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ==========================================================================
   TIER CARD
   ========================================================================== */

.tier-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  role: listitem;
}

.tier-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Highlight variant */
.tier-card--hl {
  border-color: var(--clay);
  background: linear-gradient(160deg, #fff 60%, rgba(217,119,87,.04) 100%);
  box-shadow: 0 12px 48px rgba(217,119,87,.18);
}

.tier-card--hl:hover {
  box-shadow: 0 20px 60px rgba(217,119,87,.26);
}

/* Badge (Популярный) */
.tier-card__badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Card header */
.tier-card__header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.tier-card--hl .tier-card__header {
  border-bottom-color: rgba(217,119,87,.2);
}

.tier-card__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: 0.375rem;
}

.tier-card__tagline {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* Price block */
.tier-card__price {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  margin-top: 1rem;
}

.tier-card__amount {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.625rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.tier-card--hl .tier-card__amount {
  color: var(--clay-deep);
}

.tier-card__per {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.tier-card__from {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Limit-level switcher (segmented control) */
.tier-levels {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.tier-level {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.5rem 0.375rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: calc(var(--r-sm) - 2px);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), color var(--t), box-shadow var(--t);
}

.tier-level:hover {
  color: var(--ink);
}

.tier-level.is-active {
  color: var(--clay-deep);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(33, 30, 26, .12);
}

/* Features list */
.tier-card__features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  list-style: none;
  padding: 0;
}

.tier-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.tier-card__features li::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8l3.5 3.5L13 5' stroke='%23D97757' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 2px;
}

/* CTA button */
.tier-card__btn {
  margin-top: auto;
}

/* ==========================================================================
   BUSINESS BLOCK
   ========================================================================== */

.business-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem 3rem;
  align-items: center;
  margin-top: 2.5rem;
}

.business-block h3 {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.business-block p {
  max-width: 52ch;
}

.business-block__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.business-block__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.business-block__list li::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8l3.5 3.5L13 5' stroke='%23D97757' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 2px;
}

.business-block__cta {
  text-align: center;
  flex-shrink: 0;
}

.business-block__price {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.business-block__note {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
  max-width: 22ch;
}

@media (max-width: 768px) {
  .business-block {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .business-block__cta {
    text-align: left;
  }
}

/* ==========================================================================
   MODAL OVERRIDES
   ========================================================================== */

.modal__tier-name {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 1.5rem;
}

.modal__tier-price {
  font-size: 0.9375rem;
  color: var(--clay-deep);
  font-weight: 600;
  margin-top: 0.25rem;
}

.modal__note {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   SPINNER
   ========================================================================== */

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--clay);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--clay);
    opacity: 0.6;
  }
}

/* ==========================================================================
   SUCCESS / FAIL PAGE SHARED STYLES
   ========================================================================== */

.result-section {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.result-card {
  width: 100%;
  max-width: 540px;
  text-align: center;
}

.result-card__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.result-card__icon--success {
  background: rgba(217,119,87,.12);
  color: var(--clay-deep);
}

.result-card__icon--pending {
  background: rgba(232,201,160,.25);
  color: var(--ink-soft);
}

.result-card__icon--fail {
  background: rgba(252,63,29,.08);
  color: var(--red);
}

.result-card h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.result-card p {
  margin-inline: auto;
  max-width: 44ch;
}

/* Activation code display */
.voice-code {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--bg-warm);
  border: 2px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 0.6em 1.2em;
  margin-block: 1.5rem;
}

.result-card__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1.75rem;
}

.result-card__instructions {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-top: 1.5rem;
  max-width: 42ch;
  margin-inline: auto;
}

.result-card__instructions a {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Status sub-text */
.result-status {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 0.75rem;
  min-height: 1.4em;
}

/* Spinner inside result page */
.result-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-block: 1.5rem;
}

/* ==========================================================================
   ВЫБОР ОБЪЁМА (окно для семейства MAX)
   Список, а не сетка карточек: выбор из трёх строк с ценой справа читается
   сверху вниз за секунду, тогда как три мини-карточки заставляют сравнивать
   их между собой — ровно та работа, от которой мы избавляем покупателя.
   ========================================================================== */

.level-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

.level-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.875em 1em;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), transform var(--t);
}

.level-item:hover,
.level-item:focus-visible {
  border-color: var(--clay);
  background: var(--bg-warm);
}

.level-item:active {
  transform: scale(0.995);
}

.level-item__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.level-item__name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.level-item__vol {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.level-item__price {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Подпись в карточке о том, что объёмы можно увеличить */
.tier-card__levels-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: center;
}

/* Строка «код придёт на …» вместо поля ввода, когда покупатель уже вошёл */
.buy-as {
  margin-top: 1.25rem;
  padding: 0.875em 1em;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.buy-as[hidden] {
  display: none;
}

.buy-as__line {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.buy-as__line strong {
  display: block;
  word-break: break-all;
}

/* «Claude Fable 5 — скоро» в строке уровня. Тоном тише объёма: это обещание
   на будущее, а не то, за что платят сегодня. */
.level-item__soon {
  font-size: 0.75rem;
  color: var(--clay-deep);
  line-height: 1.35;
}
