/* Pay checkout modal — light DOM (Telegram Login Widget requires document context). */
.mbx-pay-modal-host {
  position: fixed;
  inset: 0;
  z-index: 300001;
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.mbx-pay-modal-host[hidden] {
  display: none !important;
}

.mbx-pay-modal-host,
.mbx-pay-modal-host *,
.mbx-pay-modal-host *::before,
.mbx-pay-modal-host *::after {
  box-sizing: border-box;
}

.mbx-pay-modal__scrim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 10, 10, 0.48);
}

.mbx-pay-modal {
  width: min(440px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  color: #17191a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 24px;
  text-align: left;
}

.mbx-pay-modal__title {
  margin: 0 0 8px;
  padding: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #17191a;
}

.mbx-pay-modal__subtitle {
  margin: 0 0 16px;
  padding: 0;
  font-size: 14px;
  line-height: 20px;
  color: #5f6368;
}

.mbx-pay-modal__banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f4f5;
  font-size: 14px;
  line-height: 20px;
  color: #17191a;
}

.mbx-pay-modal__banner strong {
  font-weight: 600;
}

.mbx-pay-modal__methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
}

.mbx-pay-modal__method {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-height: 48px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid #e4e4e7 !important;
  background: #fff !important;
  background-color: #fff !important;
  background-image: none !important;
  color: #17191a !important;
  -webkit-text-fill-color: #17191a !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  text-transform: none !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mbx-pay-modal__method:hover,
.mbx-pay-modal__method:focus,
.mbx-pay-modal__method:active,
.mbx-pay-modal button.mbx-pay-modal__method:hover,
.mbx-pay-modal button.mbx-pay-modal__method:focus,
.mbx-pay-modal button.mbx-pay-modal__method:active {
  background: #f7f9f8 !important;
  background-color: #f7f9f8 !important;
  background-image: none !important;
  border-color: #c9c5bc !important;
  color: #17191a !important;
  -webkit-text-fill-color: #17191a !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
  filter: none !important;
}

.mbx-pay-modal__method:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed;
}

.mbx-pay-modal__method-kind {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #71717a !important;
  -webkit-text-fill-color: #71717a !important;
  margin-left: 8px;
  flex-shrink: 0;
}

.mbx-pay-modal__method:hover .mbx-pay-modal__method-kind,
.mbx-pay-modal__method:focus .mbx-pay-modal__method-kind,
.mbx-pay-modal__method:active .mbx-pay-modal__method-kind,
.mbx-pay-modal__method.is-selected .mbx-pay-modal__method-kind {
  color: #71717a !important;
  -webkit-text-fill-color: #71717a !important;
}

.mbx-pay-modal__method.is-selected,
.mbx-pay-modal__method.is-selected:hover,
.mbx-pay-modal__method.is-selected:focus,
.mbx-pay-modal__method.is-selected:active {
  border-color: #00e599 !important;
  background: #ecfdf5 !important;
  background-color: #ecfdf5 !important;
  box-shadow: 0 0 0 1px #00e599 !important;
  color: #17191a !important;
  -webkit-text-fill-color: #17191a !important;
}

.mbx-pay-modal__panel {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 12px;
  background: #f4f4f5;
  font-size: 14px;
  line-height: 20px;
  color: #17191a;
}

.mbx-pay-modal__panel-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #17191a;
}

.mbx-pay-modal__instructions {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
  color: #52525b;
}

.mbx-pay-modal__code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e4e4e7;
}

.mbx-pay-modal__code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #17191a;
  word-break: break-all;
}

.mbx-pay-modal__code--address {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.mbx-pay-modal__method-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.mbx-pay-modal__method-sub {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: #71717a !important;
}

.mbx-pay-modal__method-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #00e599;
  color: #0a0a0a !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.mbx-pay-modal__network-groups {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  margin: 0;
  padding: 2px 4px 2px 0;
}

.mbx-pay-modal__network-section {
  margin: 14px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #71717a !important;
}

.mbx-pay-modal__network-section:first-child {
  margin-top: 0;
}

.mbx-pay-modal__network-groups .mbx-pay-modal__methods {
  margin-bottom: 0;
}

.mbx-pay-modal__qr-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.mbx-pay-modal__qr {
  width: 176px;
  height: 176px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: inset 0 0 0 1px #e4e4e7;
}

.mbx-pay-modal__ol {
  margin: 0 0 8px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #52525b;
}

.mbx-pay-modal__wait {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 13px;
  color: #71717a;
}

.mbx-pay-modal__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e4e4e7;
  border-top-color: #00e599;
  border-radius: 50%;
  animation: mbxPaySpin 0.8s linear infinite;
}

@keyframes mbxPaySpin {
  to {
    transform: rotate(360deg);
  }
}

.mbx-pay-modal__alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef3c7;
  color: #713f12;
  font-size: 13px;
  line-height: 1.45;
}

.mbx-pay-modal__file {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-size: 13px;
}

.mbx-pay-modal__muted {
  margin: 0;
  font-size: 13px;
  color: #71717a;
  line-height: 1.45;
}

.mbx-pay-modal__error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.45;
}

.mbx-pay-modal__success {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
}

.mbx-pay-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.mbx-pay-modal__btn,
.mbx-pay-modal__close {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a.mbx-pay-modal__btn,
a.mbx-pay-modal__btn:hover,
a.mbx-pay-modal__btn:focus,
a.mbx-pay-modal__btn:visited {
  text-decoration: none;
}

.mbx-pay-modal__btn--primary,
.mbx-pay-modal__btn--primary:hover,
.mbx-pay-modal__btn--primary:focus {
  background: #00e599;
  color: #0a0a0a !important;
}

.mbx-pay-modal__btn--secondary,
.mbx-pay-modal__btn--secondary:hover,
.mbx-pay-modal__btn--secondary:focus,
.mbx-pay-modal__btn--secondary:active,
.mbx-pay-modal button.mbx-pay-modal__btn--secondary:hover {
  background: #f2f2f2 !important;
  background-color: #f2f2f2 !important;
  color: #17191a !important;
  -webkit-text-fill-color: #17191a !important;
  box-shadow: none !important;
}

.mbx-pay-modal__btn--ghost,
.mbx-pay-modal__btn--ghost:hover,
.mbx-pay-modal__btn--ghost:focus {
  background: transparent;
  color: #5f6368 !important;
  min-height: 36px;
  font-weight: 500;
}

.mbx-pay-modal__login {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 0;
  overflow: visible;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.mbx-pay-modal__login iframe {
  pointer-events: auto !important;
  max-width: 100%;
}

.mbx-pay-modal__btn--telegram,
.mbx-pay-modal__btn--telegram:hover,
.mbx-pay-modal__btn--telegram:focus {
  background: #2aabee;
  color: #ffffff !important;
}

.mbx-pay-modal__login-hint {
  margin: 0;
  padding: 0 4px;
  color: #5f6368;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  font-weight: 400;
}

.mbx-pay-modal-host[data-step='login'] .mbx-pay-modal__panel,
.mbx-pay-modal-host[data-step='login'] .mbx-pay-modal__body {
  overflow: visible;
}

.mbx-pay-modal__footer {
  margin-top: 16px;
  padding-top: 4px;
}

.mbx-pay-modal-host [hidden] {
  display: none !important;
}
