/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 16, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 720px);
  background: rgba(14, 20, 40, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glow);
  border-radius: 22px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .55), 0 0 40px rgba(91, 141, 239, .15);
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform .25s ease;
  overflow: hidden;
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal--wide { max-width: 680px; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__head h2 {
  font-size: 20px;
  font-weight: 800;
}

.modal__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
}
.modal__close:hover {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .35);
  color: #fca5a5;
}

.modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal__body--legal {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.modal__body--legal h3 {
  color: var(--text);
  font-size: 15px;
  margin: 20px 0 8px;
}
.modal__body--legal h3:first-child { margin-top: 0; }

.modal__body--legal p { margin-bottom: 10px; }
.modal__body--legal ul { margin: 0 0 12px 18px; }

.modal__foot {
  padding: 18px 24px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.buy-product {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(91, 141, 239, .08);
  border: 1px solid rgba(91, 141, 239, .2);
  margin-bottom: 20px;
}

.buy-product__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(55,118,171,.4), rgba(91,141,239,.3));
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
}

.buy-product__title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 4px;
}

.buy-product__price {
  font-size: 22px;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.buy-agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.buy-agree input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.buy-agree a {
  color: #a5c4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.buy-agree a:hover { color: var(--text); }

.btn--telegram {
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff;
  box-shadow: 0 8px 28px rgba(42, 171, 238, .35);
}
.btn--telegram:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(42, 171, 238, .5);
}
.btn--telegram:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--telegram svg { flex-shrink: 0; }

.modal-link {
  background: none;
  border: none;
  padding: 0;
  color: #a5c4ff;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__links .modal-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.footer__links .modal-link:hover { color: var(--text); }
