/* Form Modal */

.form-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.form-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* Overlay */
.form-modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

/* Dialog — matches faq-contact__form styling */
.form-modal__dialog {
  position: relative;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 0 8px 0 rgba(13, 21, 50, 0.20);
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.form-modal.is-open .form-modal__dialog {
  transform: scale(1);
}

@media (min-width: 768px) {
  .form-modal__dialog {
    padding: 2rem;
  }
}

/* Close button */
.form-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: color 0.2s, background-color 0.2s;
  z-index: 1;
}

.form-modal__close:hover {
  color: #111827;
  background-color: #f3f4f6;
}

/* Body scroll lock (position: fixed keeps scrollbar visible, no layout shift) */
body.form-modal-open {
  position: fixed;
  width: 100%;
  overflow-y: scroll;
}
