/* --------------------------------------------------------------------------
 * Eagle Booking - popups
 * One design for every popup, in the admin, the Hotel Manager panel and on
 * the website - the date picker's look: white cards, #ebebeb lines, EB greys.
 * - .eb-modal: dialogs with a header (Import/Export, Calendar New Booking,
 *   plans, contact the guest, licenses)
 * - .eb-popup: confirmations and notices (delete, bulk actions, booking
 *   dates, booking nights, multiple rooms, sync logs, eb-popup.js)
 * - .eb-service-details-mfp: the booking page's service details (Magnific)
 * Loaded before the admin and website stylesheets, which only add what one
 * popup needs (its width, its content).
 * Since 1.4
 ---------------------------------------------------------------------------*/

body.eb-modal-open,
body.eb-help-popup-open,
body.eb-theme-plan-modal-open {
  overflow: hidden;
}

/* Containers
 ---------------------------------------------------------------------------*/
.eb-modal,
.eb-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

/* Above the admin bar (99999) and floating cards at 100000 (e.g. a theme's
   support notice); messages (.eb-notice) stay above popups */
.eb-modal {
  z-index: 100010;
}

/* Confirmations open over anything, a modal included */
.eb-popup {
  z-index: 100020;
  text-align: center;
}

.eb-modal.is-open,
.eb-popup.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .2s ease;
}

.eb-modal.is-closing {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transition: opacity .2s ease;
}

/* Backdrop
 ---------------------------------------------------------------------------*/
.eb-modal .eb-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.eb-modal .eb-modal__backdrop,
.eb-popup,
.mfp-bg.eb-service-details-mfp {
  background: rgba(0, 0, 0, .45);
}

.mfp-bg.mfp-fade.eb-service-details-mfp.mfp-ready {
  opacity: 1;
}

/* Card
 ---------------------------------------------------------------------------*/
.eb-modal .eb-modal__dialog,
.eb-popup .eb-popup-inner,
.eb-service-details-popup {
  position: relative;
  box-sizing: border-box;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  color: #5c5c5c;
}

.eb-modal .eb-modal__dialog {
  z-index: 2;
  width: min(860px, calc(100vw - 42px));
  max-height: calc(100vh - 48px);
  margin: 0;
  overflow-y: auto;
}

.eb-popup .eb-popup-inner {
  width: 100%;
  max-width: 440px;
  margin: 0;
  padding: 32px 28px 26px;
}

/* Opening: a short rise */
.eb-modal .eb-modal__dialog,
.eb-popup .eb-popup-inner {
  opacity: 0;
  transform: translateY(8px);
  transition: transform .2s ease, opacity .2s ease;
}

.eb-modal.is-open .eb-modal__dialog,
.eb-popup.open .eb-popup-inner {
  opacity: 1;
  transform: none;
}

.eb-modal.is-closing .eb-modal__dialog {
  opacity: 0;
  transform: translateY(8px);
}

/* Close button: a round x, as the date picker's arrows (drawn, so the admin
   and the website's icon fonts don't matter)
 ---------------------------------------------------------------------------*/
.eb-modal .eb-modal__close,
.eb-popup .eb-close-popup,
.mfp-wrap.eb-service-details-mfp button.mfp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #717171;
  font-size: 0;
  line-height: 0;
  opacity: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.eb-modal .eb-modal__close:hover,
.eb-modal .eb-modal__close:focus-visible,
.eb-popup .eb-close-popup:hover,
.eb-popup .eb-close-popup:focus-visible,
.mfp-wrap.eb-service-details-mfp button.mfp-close:hover,
.mfp-wrap.eb-service-details-mfp button.mfp-close:focus-visible {
  background: #f7f7f7;
  color: #404040;
  outline: none;
}

.eb-modal .eb-modal__close > *,
.eb-popup .eb-close-popup > * {
  display: none;
}

.eb-modal .eb-modal__close::before,
.eb-modal .eb-modal__close::after,
.eb-popup .eb-close-popup::before,
.eb-popup .eb-close-popup::after,
.mfp-wrap.eb-service-details-mfp button.mfp-close::before,
.mfp-wrap.eb-service-details-mfp button.mfp-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.5px;
  margin: -.75px 0 0 -7px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.eb-modal .eb-modal__close::after,
.eb-popup .eb-close-popup::after,
.mfp-wrap.eb-service-details-mfp button.mfp-close::after {
  transform: rotate(-45deg);
}

/* Header, title and text
 ---------------------------------------------------------------------------*/
.eb-modal .eb-modal__hero {
  padding: 22px 60px 18px 24px;
  border-bottom: 1px solid #ebebeb;
  background: #fff;
}

.eb-modal .eb-modal__hero h2,
.eb-popup .eb-popup-inner .title,
.eb-popup .eb-popup-inner h2,
.eb-service-details-popup h3 {
  margin: 0 0 6px;
  color: #404040;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.eb-modal .eb-modal__hero p,
.eb-popup .eb-popup-inner p {
  margin: 0;
  color: #717171;
  font-size: 14px;
  line-height: 1.6;
}

/* Icon: the notifications' colours (.eb-notice) */
.eb-popup .eb-popup-inner .eb-popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #f7f7f7;
  color: #717171;
}

.eb-popup .eb-popup-inner .eb-popup-icon i {
  font-size: 18px;
  line-height: 1;
}

.eb-popup .eb-popup-inner .eb-popup-icon.success {
  background: #eaf3f2;
  color: #26a39e;
}

.eb-popup .eb-popup-inner .eb-popup-icon.failed {
  background: #fae7e6;
  color: #ce0e02;
}

/* Facts under the text: label left, value right (a booking's new dates) */
.eb-popup .eb-popup-inner .eb-popup-summary {
  margin: 18px 0 0;
  padding: 2px 16px;
  border-radius: 10px;
  background: #f7f7f7;
  text-align: left;
}

.eb-popup .eb-popup-inner .eb-popup-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.4;
}

.eb-popup .eb-popup-inner .eb-popup-summary > div + div {
  border-top: 1px solid #ebebeb;
}

.eb-popup .eb-popup-inner .eb-popup-summary dt {
  margin: 0;
  color: #717171;
  font-weight: 400;
}

.eb-popup .eb-popup-inner .eb-popup-summary dd {
  margin: 0;
  color: #404040;
  font-weight: 600;
  text-align: right;
}

.eb-popup .eb-popup-inner .eb-popup-summary .is-new dd {
  color: #19a1f7;
}

/* Buttons: secondary by default, .btn-create the main action, .btn-delete a
   destructive one; next to each other, the main one last
 ---------------------------------------------------------------------------*/
.eb-popup .eb-popup-inner .eb-popup-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.eb-popup .eb-popup-inner .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  margin: 24px 4px 0;
  padding: 0 18px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  background: #fff;
  color: #404040;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.eb-popup .eb-popup-inner .eb-popup-buttons .btn {
  margin: 0;
}

.eb-popup .eb-popup-inner .btn:hover,
.eb-popup .eb-popup-inner .btn:focus-visible {
  border-color: #c4c4c4;
  background: #f7f7f7;
  color: #404040;
  outline: none;
}

.eb-popup .eb-popup-inner .btn.btn-create {
  border-color: #19a1f7;
  background: #19a1f7;
  color: #fff;
}

.eb-popup .eb-popup-inner .btn.btn-create:hover,
.eb-popup .eb-popup-inner .btn.btn-create:focus-visible {
  border-color: #2c88c0;
  background: #2c88c0;
  color: #fff;
}

.eb-popup .eb-popup-inner .btn.btn-delete,
.eb-popup .eb-popup-inner .btn.btn-delete.eb-btn-is-loading {
  border-color: #d82222;
  background: #d82222;
  color: #fff;
}

.eb-popup .eb-popup-inner .btn.btn-delete:hover,
.eb-popup .eb-popup-inner .btn.btn-delete:focus-visible {
  border-color: #b31d1d;
  background: #b31d1d;
  color: #fff;
}

/* Phones
 ---------------------------------------------------------------------------*/
@media (max-width: 782px) {
  .eb-modal,
  .eb-popup {
    padding: 12px;
  }

  .eb-modal .eb-modal__dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }

  .eb-modal .eb-modal__hero {
    padding: 18px 56px 14px 18px;
  }

  .eb-popup .eb-popup-inner {
    padding: 28px 20px 22px;
  }
}
