.bb-modern-dialog {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(19, 21, 35, .42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.bb-modern-dialog.is-open {
  display: flex;
}

.bb-modern-dialog__card {
  position: relative;
  width: min(540px, calc(100vw - 48px));
  max-width: 540px;
  padding: 32px 28px 28px;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(38, 44, 71, .16);
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #131523;
  text-align: left;
  transform: translateY(10px) scale(.985);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.bb-modern-dialog.is-open .bb-modern-dialog__card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.bb-modern-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7E84A3;
  cursor: pointer;
}

.bb-modern-dialog__close::before,
.bb-modern-dialog__close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.bb-modern-dialog__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.bb-modern-dialog__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.bb-modern-dialog__close:hover {
  background: rgba(100, 82, 254, .08);
  color: #6452FE;
}

.bb-modern-dialog__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ECF2FF;
}

.bb-modern-dialog__icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.bb-modern-dialog--success .bb-modern-dialog__icon {
  width: 132px;
  height: 132px;
  margin-bottom: 20px;
  background: transparent;
}

.bb-modern-dialog--success .bb-modern-dialog__icon img {
  width: 124px;
  height: 124px;
}

.bb-modern-dialog--danger .bb-modern-dialog__icon {
  background: #FFF1F3;
}

.bb-modern-dialog--warning .bb-modern-dialog__icon {
  background: #FFF7E8;
}

.bb-modern-dialog__title {
  margin: 0 0 10px;
  color: #131523;
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.bb-modern-dialog__text {
  margin: 0;
  color: #5A607F;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  white-space: pre-line;
}

.bb-modern-dialog--message .bb-modern-dialog__card,
.bb-modern-dialog--success .bb-modern-dialog__card {
  text-align: center;
}

.bb-modern-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
}

.bb-modern-dialog--message .bb-modern-dialog__actions,
.bb-modern-dialog--success .bb-modern-dialog__actions {
  justify-content: center;
}

.bb-modern-dialog__btn {
  flex: 0 0 auto;
  min-width: 99px;
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  font: 600 14px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: none;
}

.bb-modern-dialog__btn--primary {
  background: #6452FE;
  color: #fff;
}

.bb-modern-dialog__btn--primary:hover {
  background: #5642F5;
}

.bb-modern-dialog__btn--danger {
  background: #F0142F;
  color: #fff;
}

.bb-modern-dialog__btn--danger:hover {
  background: #D90F28;
}

.bb-modern-dialog__btn--ghost {
  background: transparent;
  color: #6452FE;
}

.bb-modern-dialog__btn--ghost:hover {
  background: rgba(100, 82, 254, .08);
}

.bb-modern-dialog--danger .bb-modern-dialog__btn--ghost {
  color: #F0142F;
}

.bb-modern-dialog--danger .bb-modern-dialog__btn--ghost:hover {
  background: rgba(240, 20, 47, .08);
}

.avatar-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99990 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  background: rgba(19, 21, 35, .42) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.avatar-modal-backdrop:not([hidden]) {
  display: flex !important;
}

.avatar-modal-backdrop[style*="display: block"] {
  display: flex !important;
}

.avatar-modal,
.mi-page .avatar-modal {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: min(540px, calc(100vw - 48px)) !important;
  max-width: 540px !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 2px 10px rgba(38, 44, 71, .16) !important;
  border: 1px solid rgba(15, 23, 42, .06) !important;
  overflow: hidden !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.avatar-modal-content,
.mi-page .avatar-modal-content {
  display: grid !important;
  justify-items: center !important;
  gap: 18px !important;
  padding: 32px 28px 28px !important;
  background: #fff !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
}

.avatar-preview {
  width: 132px !important;
  height: 132px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  box-shadow: 0 16px 34px rgba(100, 82, 254, .18) !important;
}

.avatar-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
  width: auto !important;
}

.avatar-actions .btn-tertiary,
.avatar-actions .btn-primary {
  min-width: 99px !important;
  width: auto !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 6px !important;
  font: 600 14px/1 "Plus Jakarta Sans", system-ui, sans-serif !important;
  box-shadow: none !important;
}

.avatar-actions .btn-tertiary {
  background: transparent !important;
  color: #6452FE !important;
}

.avatar-actions .btn-tertiary:hover {
  background: rgba(100, 82, 254, .08) !important;
}

.avatar-actions .btn-primary {
  background: #6452FE !important;
  color: #fff !important;
}

.avatar-actions .btn-primary:hover {
  background: #5642F5 !important;
}

.bb-modal.is-open {
  display: flex !important;
  background: rgba(19, 21, 35, .42) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
}

.bb-modal__panel {
  width: min(540px, calc(100vw - 48px)) !important;
  max-width: 540px !important;
  margin: 0 !important;
  padding: 32px 28px 28px !important;
  border: 1px solid rgba(15, 23, 42, .06) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 2px 10px rgba(38, 44, 71, .16) !important;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif !important;
}

.bb-modal__backdrop {
  background: transparent !important;
}

.bb-modal__title {
  color: #131523 !important;
  font-size: 22px !important;
  line-height: 30px !important;
  font-weight: 800 !important;
  letter-spacing: -.01em !important;
}

.bb-modal__text,
.bb-modal__help {
  color: #5A607F !important;
  font: 500 14px/22px "Plus Jakarta Sans", system-ui, sans-serif !important;
}

.bb-modal__icon {
  min-height: 120px !important;
  margin: 0 auto 16px !important;
}

.bb-modal__icon img {
  width: 116px !important;
  max-height: 124px !important;
  object-fit: contain !important;
}

.bb-modal__actions,
.bb-form--modal {
  gap: 14px !important;
}

.bb-modal .bb-btn--xl {
  width: auto !important;
  min-width: 99px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 22px !important;
  border-radius: 6px !important;
  font: 600 14px/1 "Plus Jakarta Sans", system-ui, sans-serif !important;
}

@media (max-width: 480px) {
  .bb-modern-dialog,
  .avatar-modal-backdrop,
  .bb-modal.is-open {
    padding: 18px !important;
  }

  .bb-modern-dialog__card,
  .avatar-modal,
  .bb-modal__panel {
    width: min(540px, calc(100vw - 36px)) !important;
    padding: 28px 22px 24px !important;
  }
}
