body.modal-open {
  overflow: hidden;
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 10px;
}
.modal.active {
  display: flex;
}
.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px) saturate(0.95);
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}
.modal.active::before {
  opacity: 1;
  pointer-events: auto;
}

.form-wrapper {
  position: relative;
  width: 100%;
  max-width: 450px;
  margin-inline: auto;
  background: #fff;
  border-radius: 10px;
  border: 2px solid red;
  background: white;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  will-change: transform, opacity;
}

.modal.active .form-wrapper {
  animation: form-zoom 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes form-zoom {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #ff0000;
}

/* Blur underlying app when modal open */
body.modal-open,
body.modal-open {
  filter: blur(6px) brightness(0.86);
  transition: filter 320ms ease;
  pointer-events: none;
}
body.modal-open .modal {
  pointer-events: auto;
}
.form-wrapper {
  pointer-events: auto;
}
