/* Всплывающее окно заявки на индивидуальный тариф (landingpage/js/tariff_request.js) */

.tr-modal {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--text-main);
  box-shadow: 0 18px 50px rgba(40, 55, 20, 0.3);
  overflow: auto;
}

.tr-modal::backdrop {
  background: rgba(70, 95, 40, 0.45);
}

/* Плавное появление и закрытие (класс --closing ставит tariff_request.js) */
.tr-modal[open] {
  animation: trModalIn 0.25s ease-out;
}

.tr-modal[open]::backdrop {
  animation: trFadeIn 0.25s ease-out;
}

.tr-modal.tr-modal--closing {
  animation: trModalOut 0.2s ease-in forwards;
}

.tr-modal.tr-modal--closing::backdrop {
  animation: trFadeOut 0.2s ease-in forwards;
}

@keyframes trModalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes trModalOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes trFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes trFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tr-modal[open],
  .tr-modal[open]::backdrop,
  .tr-modal.tr-modal--closing,
  .tr-modal.tr-modal--closing::backdrop {
    animation: none;
  }
}

.tr-modal__inner {
  position: relative;
  padding: 26px 32px 28px;
}

.tr-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-highlight);
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.tr-modal__close:hover {
  background: var(--border-soft);
}

.tr-modal__title {
  margin: 0 0 18px;
  padding: 0 28px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}

.tr-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.tr-row__label {
  text-align: right;
  font-size: 16px;
  line-height: 1.2;
}

.tr-row__req {
  color: var(--pink-hot);
  vertical-align: super;
  font-size: 13px;
  margin-left: 1px;
}

.tr-input {
  width: 100%;
  border: 2px solid #c9e2b0;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text-main);
  background: #fff;
  outline: none;
  transition: border-color 0.12s ease-out, box-shadow 0.12s ease-out;
}

.tr-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.tr-form--checked .tr-input:invalid {
  border-color: #e0294f;
}

.tr-modal__note {
  margin: 16px 0 18px;
  text-align: center;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text-muted);
}

.tr-modal__error {
  margin: -6px 0 14px;
  text-align: center;
  font-size: 14px;
  color: #e0294f;
}

.tr-modal__error:empty {
  display: none;
}

.tr-modal__submit {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--pink-hot);
  color: #fff;
  font: inherit;
  /* Как у кнопок выбора тарифа (.pricing-card__price) */
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, opacity 0.12s ease-out;
}

.tr-modal__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(238, 70, 127, 0.35);
}

.tr-modal__submit:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.tr-modal__done {
  text-align: center;
}

.tr-modal__done[hidden],
.tr-form[hidden] {
  display: none;
}

.tr-modal__done p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .tr-modal__inner {
    padding: 22px 16px 20px;
  }

  .tr-modal__title {
    font-size: 23px;
  }

  .tr-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .tr-row__label {
    text-align: left;
  }
}
