/* =========================================================
   Grownu Demo Modal - Fresh CSS
   For modal HTML:
   <div class="modal fade" id="modal-form">
   ========================================================= */

/* ---------- Modal base behavior ---------- */

#modal-form {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1055;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

#modal-form.show {
  display: block;
}

#modal-form.fade {
  opacity: 0;
  transition: opacity 0.15s linear;
}

#modal-form.fade.show {
  opacity: 1;
}

/* ---------- Dialog ---------- */

#modal-form .modal-dialog {
  position: relative;
  width: auto;
  max-width: 520px;
  margin: 28px auto;
  pointer-events: none;
}

#modal-form .modal-dialog-centered {
  min-height: calc(100% - 56px);
  display: flex;
  align-items: center;
}

/* ---------- Modal animation ---------- */

#modal-form.fade .modal-dialog {
  transform: translateY(-50px);
  transition: transform 0.3s ease-out;
}

#modal-form.show .modal-dialog {
  transform: none;
}

/* ---------- Modal box ---------- */

#modal-form .modal-content {
  width: 100%;
  position: relative;
  pointer-events: auto;
  background: #fff;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* ---------- Inner ---------- */

#modal-form .modal-inner {
  padding: 28px 38px 32px;
}

/* ---------- Header ---------- */

#modal-form .modal-header-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #e7e7e7;
}

#modal-form .modal-header-form .title {
  font-family: Poppins, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: #272d4e;
}

/* ---------- Close button ---------- */

#modal-form .close-modal-btn {
  width: 16px;
  height: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-form .close-modal-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.45;
}

/* ---------- Text ---------- */

#modal-form .form-title {
  margin: 12px 0 8px;
  font-family: Poppins, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: #272d4e;
}

#modal-form .subtitle {
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #5b6182;
}

/* ---------- Form ---------- */

#modal-form .form {
  padding-top: 24px;
}

/* Do not rely on Bootstrap row/col for this modal */
#modal-form .form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 16px;
  margin: 0 0 16px;
}

#modal-form .form .row > div {
  padding: 0;
  width: auto;
  max-width: none;
}

/* Textarea row full width */
#modal-form .form .row .col {
  grid-column: 1 / -1;
}

/* ---------- Inputs ---------- */

#modal-form .form-control {
  display: block;
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  box-sizing: border-box;

  background: #fff;
  border: 1px solid #c3c3c3;
  border-radius: 4px;
  box-shadow: none;
  outline: none;
  appearance: none;

  font-family: Poppins, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #272d4e;
}

#modal-form textarea.form-control {
  height: 56px;
  min-height: 56px;
  resize: vertical;
}

#modal-form .form-control::placeholder {
  color: #95989a;
  opacity: 1;
}

#modal-form .form-control:focus {
  border-color: #0085ff;
  box-shadow: 0 0 0 2px rgba(0, 133, 255, 0.12);
}

/* ---------- Errors ---------- */

#modal-form .form-control.has-error {
  border-color: #dc3545;
}

#modal-form .error-message {
  display: block;
  margin-top: 4px;
  color: #dc3545;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  line-height: 16px;
}

/* ---------- Submit button ---------- */

#modal-form .form-button {
  display: block;
  min-width: 164px;
  height: 42px;
  margin: 6px auto 0;
  padding: 0 28px;

  background: #0085ff;
  color: #fff;
  border: none;
  border-radius: 8px;

  font-family: Poppins, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 42px;
  text-align: center;

  cursor: pointer;
}

#modal-form .form-button:hover {
  filter: brightness(0.95);
}

#modal-form .form-button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* ---------- Backdrop ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 0.6;
}

body.modal-open {
  overflow: hidden;
}

/* ---------- Spinner ---------- */

#modal-form .spinner-border {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 6px;
  vertical-align: text-bottom;
  border: 0.15em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: demo-modal-spinner 0.75s linear infinite;
}

@keyframes demo-modal-spinner {
  100% {
    transform: rotate(360deg);
  }
}

/* ---------- Success state ---------- */

#modal-form .success-form {
  background: #fff;
}

#modal-form .success-tile {
  padding: 96px 32px;
}

#modal-form .success-tile .success-img {
  display: block;
  width: auto;
  height: 140px;
  margin: auto;
}

#modal-form .success-tile .success-text {
  margin-top: 20px;
  text-align: center;
  color: #0085ff;
  font-family: Poppins, sans-serif;
  font-size: 24px;
  font-weight: 700;
}

#modal-form .d-none {
  display: none !important;
}

/* ---------- Mobile ---------- */

@media (max-width: 767.98px) {
  #modal-form .modal-dialog {
    max-width: calc(100% - 24px);
    margin: 24px auto;
  }

  #modal-form .modal-dialog-centered {
    min-height: calc(100% - 48px);
  }

  #modal-form .modal-inner {
    padding: 24px 20px 28px;
  }

  #modal-form .form-title {
    font-size: 18px;
    line-height: 26px;
  }

  #modal-form .form .row {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  #modal-form .form-button {
    width: 100%;
  }

  #modal-form .success-tile {
    padding: 64px 20px;
  }

  #modal-form .success-tile .success-text {
    font-size: 22px;
  }
}