/* Migo Acrylic dialogs — Windows 11 inspired surfaces for standard site modals. */
:root {
  --migo-modal-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(247, 249, 252, 0.74));
  --migo-modal-border: rgba(255, 255, 255, 0.78);
  --migo-modal-divider: rgba(82, 91, 108, 0.14);
  --migo-modal-control: rgba(255, 255, 255, 0.48);
  --migo-modal-control-hover: rgba(255, 255, 255, 0.7);
  --migo-modal-text: #20242c;
  --migo-modal-muted: #687180;
  --migo-modal-shadow: 0 32px 96px rgba(15, 23, 42, 0.28), 0 8px 28px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.modal.show,
.modal.in {
  background: transparent !important;
}

.modal-backdrop,
.modal-backdrop.fade,
.modal-backdrop.show,
.modal-backdrop.in {
  background: rgba(13, 18, 28, 0.44) !important;
  opacity: 1 !important;
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  backdrop-filter: blur(12px) saturate(112%);
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-dialog > .modal-content {
  overflow: hidden;
  border: 1px solid var(--migo-modal-border) !important;
  border-radius: 10px !important;
  background: var(--migo-modal-surface) !important;
  color: var(--migo-modal-text);
  box-shadow: var(--migo-modal-shadow) !important;
  -webkit-backdrop-filter: blur(34px) saturate(155%);
  backdrop-filter: blur(34px) saturate(155%);
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-header,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-footer {
  background: transparent !important;
  border-color: var(--migo-modal-divider) !important;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-title {
  color: var(--migo-modal-text);
  letter-spacing: -0.02em;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) button.close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin: -4px -4px -4px 8px;
  padding: 0 !important;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--migo-modal-muted);
  opacity: 1;
  text-shadow: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) button.close:hover,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) button.close:focus-visible {
  border-color: rgba(90, 99, 116, 0.14);
  background: rgba(255, 255, 255, 0.58);
  color: var(--migo-modal-text);
  outline: none;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) button.close svg {
  display: block;
  pointer-events: none;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .form-control,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) textarea,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) select {
  border-color: rgba(82, 91, 108, 0.2) !important;
  background-color: var(--migo-modal-control) !important;
  color: var(--migo-modal-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  backdrop-filter: blur(12px) saturate(125%);
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .form-control:focus,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) input:focus,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) textarea:focus,
.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) select:focus {
  border-color: color-mix(in srgb, var(--main-color, #cf4b54) 58%, transparent) !important;
  background-color: var(--migo-modal-control-hover) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--main-color, #cf4b54) 14%, transparent) !important;
  outline: none;
}

.modal:not(:where(#watchMovieBox, #calling-modal, #re-calling-modal, #video-calling-modal)) .btn-default {
  border-color: rgba(82, 91, 108, 0.14) !important;
  background: rgba(255, 255, 255, 0.48) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.modal:not(:where(#watchMovieBox, #calling-modal, #re-calling-modal, #video-calling-modal)) .btn-default:hover,
.modal:not(:where(#watchMovieBox, #calling-modal, #re-calling-modal, #video-calling-modal)) .btn-default:focus-visible {
  background: rgba(255, 255, 255, 0.72) !important;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 101, 118, 0.38) transparent;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(91, 101, 118, 0.38);
}

/* Donation dialog: preserve its hierarchy while letting the acrylic surface show through. */
#migo-profile-donation-modal .migo-donation-modal-content {
  padding: 0 !important;
  border-radius: 10px !important;
  max-height: calc(100vh - 96px);
}

#migo-profile-donation-modal.show,
#migo-profile-donation-modal.in {
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 76px 14px 16px !important;
  overflow: hidden;
}

#migo-profile-donation-modal .modal-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: 100%;
  margin: auto !important;
  transform: none !important;
}

#migo-profile-donation-modal form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#migo-profile-donation-modal .migo-donation-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start !important;
  gap: 12px;
  margin: 0 !important;
  padding: 14px 16px 12px !important;
  border-bottom: 1px solid var(--migo-modal-divider) !important;
}

#migo-profile-donation-modal .migo-donation-recipient {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start !important;
  gap: 12px !important;
  min-width: 0;
}

#migo-profile-donation-modal .migo-donation-recipient > div {
  min-width: 0;
}

#migo-profile-donation-modal .migo-donation-recipient img {
  width: 48px !important;
  height: 48px !important;
  margin-top: 1px;
}

#migo-profile-donation-modal .migo-donation-recipient h4 {
  margin: 0 0 3px !important;
  font-size: 18px !important;
  line-height: 1.25;
  text-wrap: balance;
}

#migo-profile-donation-modal .migo-donation-recipient p {
  max-width: 34rem;
  font-size: 13px;
  line-height: 1.38 !important;
}

#migo-profile-donation-modal .modal-body {
  min-height: 0;
  padding: 14px 16px 15px !important;
  overflow-y: auto;
}

#migo-profile-donation-modal .migo-donation-balance {
  margin-bottom: 12px !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
}

#migo-profile-donation-modal .migo-donation-label {
  margin: 12px 0 7px !important;
}

#migo-profile-donation-modal .migo-donation-presets {
  gap: 0 !important;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(82, 91, 108, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

#migo-profile-donation-modal .migo-donation-preset {
  min-height: 38px;
  padding: 8px 5px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--migo-modal-text) !important;
  font-weight: 600;
  box-shadow: none !important;
}

#migo-profile-donation-modal .migo-donation-preset + .migo-donation-preset {
  border-left: 1px solid var(--migo-modal-divider) !important;
}

#migo-profile-donation-modal .migo-donation-amount-wrap,
#migo-profile-donation-modal #migo-donation-message {
  border-radius: 9px !important;
}

#migo-profile-donation-modal .migo-donation-balance,
#migo-profile-donation-modal .migo-donation-preset,
#migo-profile-donation-modal .migo-donation-amount-wrap,
#migo-profile-donation-modal #migo-donation-message {
  border: 1px solid rgba(82, 91, 108, 0.14) !important;
  background: rgba(255, 255, 255, 0.42) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

#migo-profile-donation-modal .migo-donation-preset:hover {
  background: rgba(255, 255, 255, 0.58) !important;
}

#migo-profile-donation-modal .migo-donation-preset.active {
  border-left-color: transparent !important;
  background: rgba(198, 77, 83, 0.14) !important;
  color: #9f3036 !important;
  box-shadow: inset 0 -3px 0 #c64d53, inset 0 0 0 1px rgba(198, 77, 83, 0.2) !important;
}

#migo-profile-donation-modal .migo-donation-preset.active + .migo-donation-preset {
  border-left-color: transparent !important;
}

#migo-profile-donation-modal .migo-donation-recipient p,
#migo-profile-donation-modal .migo-donation-note {
  color: var(--migo-modal-muted) !important;
}

#migo-profile-donation-modal .migo-donation-note {
  margin-top: 12px !important;
}

#migo-profile-donation-modal .modal-footer {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px !important;
  margin: 0 !important;
  padding: 12px 16px 14px !important;
  border-top: 1px solid var(--migo-modal-divider) !important;
}

#migo-profile-donation-modal .modal-footer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin: 0 !important;
  padding: 0 16px !important;
  border-radius: 7px !important;
  font-weight: 600;
  gap: 8px;
  transition: background-color 140ms ease, border-color 140ms ease, transform 100ms ease;
}

#migo-profile-donation-modal .modal-footer .btn svg {
  flex: 0 0 auto;
  stroke: currentColor;
}

#migo-profile-donation-modal .migo-donation-topup {
  border: 1px solid rgba(82, 91, 108, 0.18) !important;
  background: var(--migo-modal-control) !important;
  color: var(--migo-modal-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

#migo-profile-donation-modal .migo-donation-submit {
  border: 1px solid rgba(82, 91, 108, 0.18) !important;
  background: var(--migo-modal-control) !important;
  color: var(--migo-modal-text) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

#migo-profile-donation-modal .migo-donation-topup svg {
  color: #3978a8;
}

#migo-profile-donation-modal .migo-donation-submit svg {
  color: #c64d53;
}

#migo-profile-donation-modal .migo-donation-topup:hover,
#migo-profile-donation-modal .migo-donation-topup:focus-visible,
#migo-profile-donation-modal .migo-donation-submit:hover,
#migo-profile-donation-modal .migo-donation-submit:focus-visible {
  border-color: rgba(82, 91, 108, 0.28) !important;
  background: var(--migo-modal-control-hover) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52) !important;
  outline: none;
}

#migo-profile-donation-modal .modal-footer .btn:active {
  transform: translateY(1px);
}

/* Dark theme is identified by the stylesheet dynamically added by Migo. */
html:has(#night-mode-css) {
  --migo-modal-surface: linear-gradient(145deg, rgba(38, 42, 50, 0.9), rgba(24, 27, 33, 0.82));
  --migo-modal-border: rgba(255, 255, 255, 0.16);
  --migo-modal-divider: rgba(255, 255, 255, 0.1);
  --migo-modal-control: rgba(255, 255, 255, 0.075);
  --migo-modal-control-hover: rgba(255, 255, 255, 0.12);
  --migo-modal-text: #f2f4f8;
  --migo-modal-muted: #aeb6c3;
  --migo-modal-shadow: 0 34px 110px rgba(0, 0, 0, 0.56), 0 8px 30px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html:has(#night-mode-css) .modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) button.close:hover,
html:has(#night-mode-css) .modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) button.close:focus-visible,
html:has(#night-mode-css) .modal:not(:where(#watchMovieBox, #calling-modal, #re-calling-modal, #video-calling-modal)) .btn-default:hover,
html:has(#night-mode-css) .modal:not(:where(#watchMovieBox, #calling-modal, #re-calling-modal, #video-calling-modal)) .btn-default:focus-visible {
  background: rgba(255, 255, 255, 0.12) !important;
}

html:has(#night-mode-css) #migo-profile-donation-modal .migo-donation-balance,
html:has(#night-mode-css) #migo-profile-donation-modal .migo-donation-preset,
html:has(#night-mode-css) #migo-profile-donation-modal .migo-donation-amount-wrap,
html:has(#night-mode-css) #migo-profile-donation-modal #migo-donation-message {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-dialog > .modal-content {
    background: rgba(250, 251, 253, 0.98) !important;
  }

  html:has(#night-mode-css) .modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-dialog > .modal-content {
    background: rgba(27, 30, 36, 0.98) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal .modal-dialog,
  .modal button,
  .modal input,
  .modal textarea,
  .modal select {
    transition: none !important;
  }
}

@media (max-width: 575px) {
  .modal:not(#watchMovieBox):not(#calling-modal):not(#re-calling-modal):not(#video-calling-modal) .modal-dialog > .modal-content {
    border-radius: 10px !important;
  }

  #migo-profile-donation-modal .migo-donation-header {
    padding: 13px 14px 10px !important;
  }

  #migo-profile-donation-modal .modal-body {
    padding: 12px 14px 13px !important;
  }

  #migo-profile-donation-modal .modal-footer {
    grid-template-columns: 1fr;
    padding: 10px 14px 13px !important;
  }
}

@media (max-height: 720px) {
  #migo-profile-donation-modal.show,
  #migo-profile-donation-modal.in {
    align-items: flex-start;
    padding-top: 68px !important;
    overflow-y: auto;
  }

  #migo-profile-donation-modal .migo-donation-modal-content {
    max-height: calc(100vh - 84px);
  }
}
