/*
 * Public website modals - one consistent, professional look for the Bootstrap modals on the public pages,
 * in the site theme of css/style1.css (navy / blue). Loaded after style1.css from header.php.
 * The login / OTP / student popups (.popup_modal) keep their own "Upqor Login Modal Theme" in style1.css.
 * Only spacing / typography / colours - no markup or ids change, so the page scripts keep working.
 */

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

.modal:not(.popup_modal) .modal-content {
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 34px 90px rgba(7, 21, 45, 0.22);
  overflow: hidden;
}

.modal:not(.popup_modal) .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid #e7ecf4;
  background: linear-gradient(135deg, #fffaf0, #ffffff 55%, #eef3ff);
}

.modal:not(.popup_modal) .modal-header .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 26px;
  color: #07152d;
  word-break: break-word;
}

/* close button: Bootstrap 4 (.close) and Bootstrap 5 (.btn-close) look the same */
.modal:not(.popup_modal) .modal-header .close,
.modal:not(.popup_modal) .modal-header .btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background-color: #fff;
  color: #07152d;
  font-size: 22px;
  line-height: 1;
  opacity: 1;
  text-shadow: none;
  box-shadow: 0 8px 20px rgba(7, 21, 45, 0.12);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.modal:not(.popup_modal) .modal-header .btn-close {
  background-size: 12px;
  font-size: 0;
}

.modal:not(.popup_modal) .modal-header .close:hover,
.modal:not(.popup_modal) .modal-header .close:focus-visible {
  background-color: #1f5eff;
  color: #fff;
  outline: none;
}

.modal:not(.popup_modal) .modal-header .btn-close:hover,
.modal:not(.popup_modal) .modal-header .btn-close:focus-visible {
  background-color: #eef3ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.15);
}

.modal:not(.popup_modal) .modal-body {
  padding: 22px 24px;
  color: #14213d;
  font-size: 15px;
  line-height: 24px;
}

.modal:not(.popup_modal) .modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #e7ecf4;
}

.modal:not(.popup_modal) .modal-footer > * {
  margin: 0;
}

.modal:not(.popup_modal) .modal-footer .btn {
  width: auto;
  min-width: 100px;
  min-height: 42px;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.modal:not(.popup_modal) .modal-body .table {
  margin-bottom: 0;
}

/* popups: wider, and no fixed heights - content decides the height */
.popup_modal .modal-dialog {
  max-width: 540px;
}

.popup_modal .modal-content {
  height: auto;
  min-height: 0;
  padding: 38px 40px 30px;
}

/* 6-box student OTP */
.popup_modal #otp_verify .otp_val:focus {
  border-color: #1f5eff;
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
  outline: none;
}

@media (max-width: 767px) {
  .modal:not(.popup_modal) .modal-dialog {
    width: auto !important; /* some dialogs set a fixed % width inline */
    max-width: none;
    margin: 12px;
  }

  .modal:not(.popup_modal) .modal-dialog.modal-dialog-centered {
    min-height: calc(100% - 24px);
  }

  .modal:not(.popup_modal) .modal-header {
    padding: 14px 16px;
  }

  .modal:not(.popup_modal) .modal-header .modal-title {
    font-size: 16px;
    line-height: 24px;
  }

  .modal:not(.popup_modal) .modal-body {
    padding: 16px;
  }

  .modal:not(.popup_modal) .modal-footer {
    padding: 12px 16px;
  }

  .popup_modal .modal-content {
    padding: 30px 20px 24px;
  }

  .popup_modal .member-otp-actions {
    flex-direction: column;
  }

  .popup_modal .member-otp-actions .btn {
    width: 100%;
  }
}
