/**
 * modal.css
 * Reusable modal system.
 *
 * HOW TO USE:
 * - Any element with class="open-modal" and data-modal="MODAL_ID" opens that modal.
 * - Modal markup:
 *     <div class="modal" id="MODAL_ID">
 *       <div class="modal-box">
 *         <button class="modal-close">&times;</button>
 *         ... your form here ...
 *       </div>
 *     </div>
 */

/* Overlay */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

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

/* Box */
.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 40px;
  width: 100%;
  max-width: 520px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.modal-close:hover {
  color: #000;
}

/* ===== OPEN MODAL BUTTON ===== */
/* Use class="open-modal" on any <a>, <button>, or <div> */
.open-modal {
  cursor: pointer;
}

/* ===== FORM RESPONSE MESSAGES ===== */
.form-response {
  display: none;
  margin-top: 14px;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.form-response .success {
  color: #155724;
  background: #d4edda;
  display: block;
  padding: 10px 15px;
  border-radius: 8px;
}

.form-response .error {
  color: #721c24;
  background: #f8d7da;
  display: block;
  padding: 10px 15px;
  border-radius: 8px;
}

/* ===== SPINNER ===== */
.form-spinner {
  display: none;
  text-align: center;
  padding: 10px 0;
  color: #555;
  font-size: 0.9rem;
}

/* Mobile */
@media (max-width: 600px) {
  .modal-box {
    margin: 20px;
    padding: 28px 20px;
  }
}
