/* Модалка скидочной кампании: одно окно на все страницы сайта.

   Разметку рисует scripts/discount-offer.js — страницам достаточно подключить
   этот файл. Цвета и формы берутся из токенов темы и шкалы DESIGN.md, поэтому
   окно одинаково уместно в тёмной и в светлой теме. Бейдж скидки повторяет
   `.plan-price-badge` с витрины тарифов: одна и та же скидка не должна
   выглядеть в модалке иначе, чем в прайсе. */

.discount-offer-overlay[hidden] {
  display: none !important;
}

body.discount-offer-open {
  overflow: hidden;
}

.discount-offer-overlay {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(2, 7, 17, 0.78);
  backdrop-filter: blur(8px);
}

.discount-offer-dialog {
  position: relative;
  width: min(100%, 520px);
  margin-block: auto;
  overflow: hidden;
  border-radius: 16px;
  padding: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(24, 116, 217, 0.22), transparent 42%),
    var(--panel-strong);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 30px 80px var(--shadow);
  animation: discount-offer-enter 260ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes discount-offer-enter {
  from {
    opacity: 0;
    translate: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .discount-offer-dialog {
    animation: none;
  }
}

.discount-offer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}

.discount-offer-close:hover {
  color: var(--ink);
  background: rgba(24, 116, 217, 0.22);
}

.discount-offer-close:focus-visible,
.discount-offer-primary:focus-visible,
.discount-offer-secondary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.discount-offer-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.discount-offer-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin: 0 0 16px;
  border-radius: 999px;
  padding: 6px 12px;
  color: #d8ebff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
  background: rgba(24, 116, 217, 0.24);
}

html[data-theme="light"] .discount-offer-badge {
  color: var(--blue-strong);
}

.discount-offer-title {
  margin: 0 0 12px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.discount-offer-body {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.discount-offer-packages {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.discount-offer-package {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.discount-offer-package-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.discount-offer-package-coins {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
}

.discount-offer-package-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.discount-offer-price-old {
  color: var(--soft);
  font-size: 14px;
  text-decoration: line-through;
}

.discount-offer-price-new {
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

html[data-theme="light"] .discount-offer-price-new {
  color: var(--blue-strong);
}

.discount-offer-deadline {
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

.discount-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.discount-offer-primary {
  display: inline-flex;
  min-height: 44px;
  flex: 1 1 220px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  color: #f7fbff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  background: var(--blue);
  cursor: pointer;
  transition: transform 150ms ease-out, background-color 150ms ease-out;
}

.discount-offer-primary:hover {
  transform: translateY(-1px);
  background: var(--blue-strong);
}

.discount-offer-primary:active {
  transform: scale(0.99);
}

.discount-offer-secondary {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}

.discount-offer-secondary:hover {
  color: var(--ink);
  background: rgba(24, 116, 217, 0.22);
}

@media (max-width: 560px) {
  .discount-offer-overlay {
    padding: 16px;
    place-items: end center;
  }

  .discount-offer-dialog {
    padding: 20px;
  }

  .discount-offer-actions {
    flex-direction: column;
  }

  /* В колонке flex-basis становится высотой: без сброса кнопка растягивается
     на 220px и занимает пол-экрана. */
  .discount-offer-primary,
  .discount-offer-secondary {
    flex: 0 0 auto;
  }
}
