/* replace your whole .modal block with this */
.modal {
  display: none;                 /* hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  justify-content: center;       /* keep flex props here */
  align-items: center;
  box-sizing: border-box;
}

/* only visible when opened */
.modal.open {
  display: flex;
}

.modal-content {
  background-color: #ffffff;
  padding: 30px;
  width: 90%;
  max-width: 400px;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  position: relative;
  font-family: 'Segoe UI', sans-serif;
  margin: auto;
  box-sizing: border-box;
}

.modal-content h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--brand);
  text-align: center;
}

.modal-content label {
  display: block;
  margin-bottom: 6px;
  margin-top: 16px;
  font-weight: 500;
  color: var(--text);
}

.modal-content input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

.modal-content button {
  background-color: #045D56;
  color: #EAEAEA;
  padding: 12px;
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.modal-content button:hover {
  background-color: #033c3a;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 26px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
}

.success-message {
  text-align: center;
  padding: 40px 20px;
  color: #045D56;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  background-color: #f0f9f8;
  border-radius: 12px;
  margin-top: 20px;
  border: 2px solid #045d56;
}

.success-message.hidden {
  display: none;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
  .modal-content {
    width: 90%;
    max-width: 320px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin: 0 auto !important;
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
  }

  /* Ensure modal stays within viewport */
  .modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    padding: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6); /* backdrop */
  }

  .modal-content input,
  .modal-content button {
    width: 100%;
    box-sizing: border-box;
  }
}

