.form-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.form-modal.is-open {
  display: flex;
}

.form-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(11, 22, 34, 0.56);
  cursor: pointer;
}

.form-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(100vh - 48px, 900px);
  max-height: min(100dvh - 48px, 900px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-lg);
}

.form-modal__dialog .form-card {
  max-width: none !important;
  width: 100%;
  margin: 0;
  box-shadow: 0 22px 60px rgba(19, 52, 79, 0.2);
}

.form-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(19, 52, 79, 0.16);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .form-modal {
    align-items: flex-end;
    padding: 0;
  }

  .form-modal__dialog {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
  }

  .form-modal__dialog .form-card {
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  }
}
