.form-modal[hidden] {
  display: none;
}

.form-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.form-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 12, 12, 0.72);
}

.form-modal__window {
  position: relative;
  width: min(100%, 430px);
  background: #fff;
  color: #1c1917;
  padding: 34px;
  border-top: 5px solid #8f1018;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.form-modal__window--success {
  border-color: #26724b;
}

.form-modal__window--error {
  border-color: #9c151c;
}

.form-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: #f1ece8;
  color: #1c1917;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.form-modal__icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #f1ece8;
  color: #8f1018;
  font-size: 28px;
  font-weight: 700;
}

.form-modal__window--success .form-modal__icon {
  color: #26724b;
}

.form-modal h2 {
  margin: 0 0 10px;
  font-family: "PT Serif", Georgia, serif;
  font-size: 28px;
}

.form-modal p {
  margin: 0;
  color: #5f5751;
  font-size: 16px;
  line-height: 1.5;
}

.form-modal__action {
  width: 100%;
  border: 0;
  margin-top: 24px;
  padding: 14px 18px;
  background: #171514;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

body.form-modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .form-modal {
    padding: 18px;
  }

  .form-modal__window {
    padding: 30px 22px 24px;
  }

  .form-modal h2 {
    font-size: 24px;
  }
}
