/* =========================
   LEGAL / GLOBAL MODALS
========================= */

html.bp-legal-open,
html.bp-legal-open body{
  overflow: hidden !important;
}

/* =========================
   MODAL STRUCTURE
========================= */

.bp-modal{
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none;
  padding: 24px;
}

.bp-modal.is-open{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.bp-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 21, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bp-modal__panel{
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  background: #ffffff;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bp-modal__head{
  flex: 0 0 auto;
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bp-modal__title{
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 900;
  color: #111827;
}

.bp-modal__close{
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bp-modal__close svg{
  width: 20px;
  height: 20px;
  stroke: #111827;
}

.bp-modal__body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  padding: 24px 28px 34px;
  -webkit-overflow-scrolling: touch;
}

/* =========================
   MODAL CONTENT
========================= */

.bp-modal__body h3{
  margin: 22px 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.bp-modal__body h3:first-child{
  margin-top: 0;
}

.bp-modal__body p{
  margin: 0 0 14px;
}

.bp-modal__body ul,
.bp-modal__body ol{
  margin: 0 0 16px 20px;
}

.bp-modal__body li{
  margin-bottom: 8px;
}

.bp-modal__form{
  margin-top: 24px;
}

/* =========================
   DESKTOP CENTER FIX
========================= */

@media (min-width: 768px) {
  .bp-modal.is-open {
    display: block !important;
    padding: 0 !important;
  }

  .bp-modal__panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;

    width: min(760px, calc(100vw - 64px)) !important;
    max-width: 760px !important;
    max-height: calc(100dvh - 48px) !important;
    margin: 0 !important;
  }
}

/* =========================
   MOBILE BOTTOM SHEET
========================= */

@media (max-width: 767px){
  .bp-modal{
    padding: 0 !important;
  }

  .bp-modal.is-open{
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  .bp-modal__panel{
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;

    width: 100% !important;
    max-width: none !important;
    max-height: 82dvh !important;
    margin: 0 !important;
    border-radius: 26px 26px 0 0 !important;
  }

  .bp-modal__head{
    padding: 20px 22px 14px;
  }

  .bp-modal__body{
    padding: 22px 22px 72px !important;
  }
}