/* Terms of Use / Disclosures popups - Figma nodes 2502:9011 (Terms of Use), 2502:12426 (Disclosures) */

.ib-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.55);
  padding: 24px;
}

.ib-modal-overlay.is-open {
  display: flex;
}

.ib-modal {
  position: relative;
  width: 904px;
  max-width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--grey-pure-white);
  border-radius: 24px;
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ib-modal__title {
  font-size: 32px;
  font-weight: 600;
  color: var(--primary-blue);
  padding-right: 40px;
}

.ib-modal__divider {
  height: 1px;
  background: var(--grey-lightest-grey);
  margin-top: 20px;
}

.ib-modal__body,
.ib-modal__body--static {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  margin-top: 13px;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 60vh;
}

.ib-modal__body p,
.ib-modal__body--static p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--grey-darkest-grey);
}

.ib-modal__body strong,
.ib-modal__body--static strong {
  font-weight: 500;
}

.ib-modal__accept {
  align-self: flex-end;
  margin-top: 24px;
  background: #ebf2f7;
  border: 1px solid var(--primary-blue);
  border-radius: 12px;
  padding: 12px 29px;
  font-size: 18px;
  font-weight: 500;
  color: var(--primary-blue);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.ib-modal__accept:hover {
  background: var(--primary-blue);
  color: var(--grey-pure-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 89, 154, 0.24);
}

.ib-modal__accept:active {
  transform: translateY(0);
  filter: brightness(0.92);
  box-shadow: none;
}

.ib-modal__accept:focus-visible,
.ib-modal__close:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.ib-modal__close {
  position: absolute;
  top: 24px;
  right: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ebf2f7;
  border: 1px solid var(--primary-blue);
  border-radius: 12px;
  padding: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.ib-modal__close:hover {
  background: var(--primary-blue);
  transform: rotate(90deg);
}

.ib-modal__close:hover img {
  filter: brightness(0) invert(1);
}

.ib-modal__close:active {
  transform: rotate(90deg) scale(0.92);
}

.ib-modal__close img {
  width: 24px;
  height: 24px;
  transition: filter 0.15s ease;
}

.ib-modal--compact {
  padding-top: 28px;
}

@media (max-width: 639px) {
  .ib-modal-overlay {
    padding: 12px;
  }

  .ib-modal {
    padding: 20px 16px 20px;
    border-radius: 16px;
    max-height: 90vh;
    max-height: 90dvh;
  }

  .ib-modal__title {
    font-size: 20px;
    line-height: 1.3;
    padding-right: 36px;
  }

  .ib-modal__body,
  .ib-modal__body--static {
    max-height: 65vh !important;
    max-height: 65dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  .ib-modal__close {
    top: 16px;
    right: 16px;
    padding: 6px;
  }

  .ib-modal__accept {
    align-self: stretch;
    text-align: center;
  }
}
