/* =========================
   MAO PAYMENT MODAL — MONOCHROME LUXE
   ========================= */

#mao-payment-modal {
  --mao-bg0: #0a0a0a;
  --mao-bg1: #111111;
  --mao-bg2: #0d0d0d;
  --mao-surface: rgba(24, 24, 24, 0.88);
  --mao-surface-2: rgba(34, 34, 34, 0.80);
  --mao-glass: rgba(255, 255, 255, 0.04);
  --mao-glass-strong: rgba(255, 255, 255, 0.08);
  --mao-border: rgba(255, 255, 255, 0.09);
  --mao-border-strong: rgba(255, 255, 255, 0.15);
  --mao-border-glow: rgba(255, 255, 255, 0.18);

  --mao-text: #f5f5f5;
  --mao-muted: rgba(245, 245, 245, 0.68);
  --mao-dim: rgba(245, 245, 245, 0.43);

  --mao-accent: #ffffff;
  --mao-accent-2: #d4d4d4;
  --mao-accent-soft: rgba(255, 255, 255, 0.08);

  --mao-success: #ffffff;
  --mao-warning: #cfcfcf;
  --mao-danger: #ffffff;

  --mao-radius: 18px;
  --mao-radius-sm: 12px;

  --mao-font: "Sora", "DM Sans", system-ui, sans-serif;
  --mao-mono: "JetBrains Mono", ui-monospace, monospace;

  --mao-shadow:
    0 24px 80px rgba(0, 0, 0, 0.70),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);

  --mao-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  font-family: var(--mao-font);
}

#mao-payment-modal *,
#mao-payment-modal *::before,
#mao-payment-modal *::after {
  box-sizing: border-box;
}


/* =========================
   BACKDROP
   ========================= */

#mao-payment-modal .mao-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      900px 500px at 50% -10%,
      rgba(255, 255, 255, 0.055),
      transparent 65%
    ),
    rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


/* =========================
   MODAL PANEL
   ========================= */

#mao-payment-modal .mao-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(90vh, 640px);
  display: flex;
  flex-direction: column;
  margin: 0;
  animation: mao-modal-in 0.22s var(--mao-ease);
}

#mao-payment-modal .mao-modal__panel--wide {
  max-width: 520px;
}


/* =========================
   GLASS CARD
   ========================= */

#mao-payment-modal .glass {
  position: relative;
  border-radius: var(--mao-radius);
  background:
    linear-gradient(
      155deg,
      var(--mao-surface) 0%,
      var(--mao-surface-2) 100%
    );
  border: 1px solid var(--mao-border);
  box-shadow: var(--mao-shadow);
  overflow: hidden;
  transform: translateZ(0);
}

#mao-payment-modal .glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.075) 0%,
      transparent 42%,
      transparent 100%
    );
  opacity: 0.5;
}

#mao-payment-modal .glass > * {
  position: relative;
  z-index: 1;
}

#mao-payment-modal .glass-pad {
  padding: 1.35rem 1.5rem;
}

@keyframes mao-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* =========================
   HEADER
   ========================= */

#mao-payment-modal .mao-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

#mao-payment-modal .mao-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--mao-text);
}

#mao-payment-modal .mao-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--mao-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

#mao-payment-modal .mao-modal__close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  transform: rotate(90deg);
}

#mao-payment-modal .mao-hint {
  font-size: 0.78rem;
  color: var(--mao-dim);
  margin-top: 0.35rem;
}


/* =========================
   INPUT
   ========================= */

#mao-payment-modal .mao-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 11px;
  border: 1px solid var(--mao-border);
  background: rgba(0, 0, 0, 0.34);
  color: var(--mao-text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

#mao-payment-modal .mao-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.44);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.06),
    0 0 22px rgba(255, 255, 255, 0.025);
}


/* =========================
   BUTTONS
   ========================= */

#mao-payment-modal .mao-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    transform 0.18s var(--mao-ease),
    box-shadow 0.2s,
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

#mao-payment-modal .mao-btn:active {
  transform: translateY(1px);
}


/* Primary */

#mao-payment-modal .mao-btn-primary {
  color: #050505;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #d0d0d0 100%
  );
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 6px 20px rgba(255, 255, 255, 0.08);
}

#mao-payment-modal .mao-btn-primary:hover {
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    #e3e3e3 100%
  );
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 25px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}


/* Ghost */

#mao-payment-modal .mao-btn-ghost {
  color: var(--mao-text);
  background: var(--mao-glass-strong);
  border-color: var(--mao-border);
}

#mao-payment-modal .mao-btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

#mao-payment-modal .mao-btn-block {
  width: 100%;
}


/* =========================
   PAYMENT METHODS
   ========================= */

#mao-payment-modal .mao-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

#mao-payment-modal .mao-payment-method {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 11px;
  border: 1px solid var(--mao-border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--mao-text);
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.18s var(--mao-ease),
    box-shadow 0.2s;
}

#mao-payment-modal .mao-payment-method:hover {
  border-color: rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

#mao-payment-modal .mao-payment-method:active {
  transform: translateY(1px);
}

#mao-payment-modal .mao-payment-method__icon {
  font-size: 1.35rem;
  width: 2rem;
  text-align: center;
  color: #ffffff;
}

#mao-payment-modal .mao-payment-method__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#mao-payment-modal .mao-payment-method__name {
  font-weight: 650;
  font-size: 0.92rem;
}

#mao-payment-modal .mao-payment-method__desc {
  font-size: 0.78rem;
  color: var(--mao-muted);
  line-height: 1.35;
}

#mao-payment-modal .mao-payment-method__arrow {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--mao-dim);
}


/* =========================
   BACK LINK
   ========================= */

#mao-payment-modal .mao-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--mao-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0 0 0.5rem;
  transition: color 0.2s, transform 0.2s;
}

#mao-payment-modal .mao-back:hover {
  color: var(--mao-text);
  transform: translateX(-2px);
}


/* =========================
   COIN LIST
   ========================= */

#mao-payment-modal .mao-coin-list {
  flex: 1;
  min-height: 120px;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.2rem;
}

#mao-payment-modal .mao-coin-list.is-loading,
#mao-payment-modal .mao-coin-list.is-empty {
  align-items: center;
  justify-content: center;
  color: var(--mao-muted);
  font-size: 0.88rem;
}

#mao-payment-modal .mao-coin-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--mao-border);
  background: rgba(0, 0, 0, 0.18);
  color: var(--mao-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.18s;
}

#mao-payment-modal .mao-coin-item:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(2px);
}

#mao-payment-modal .mao-coin-item img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  object-fit: contain;
  filter: grayscale(100%);
}

#mao-payment-modal .mao-coin-item span {
  font-weight: 600;
  font-size: 0.88rem;
}

#mao-payment-modal .mao-coin-item .mao-coin-code {
  margin-left: auto;
  color: var(--mao-dim);
  font-size: 0.75rem;
  font-weight: 600;
}


/* =========================
   PAYMENT DETAILS
   ========================= */

#mao-payment-modal .mao-pay-coin-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.85rem;
  display: block;
  object-fit: contain;
  filter: grayscale(100%) brightness(1.08);
}

#mao-payment-modal .mao-pd-row {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--mao-border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
}

#mao-payment-modal .mao-pd-row:last-of-type {
  margin-bottom: 0;
}

#mao-payment-modal .mao-pd-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--mao-muted);
  margin-bottom: 0.35rem;
}

#mao-payment-modal .mao-pd-title span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#mao-payment-modal .mao-pd-copy {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--mao-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.18s;
}

#mao-payment-modal .mao-pd-copy:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-1px);
}

#mao-payment-modal .mao-pd-value {
  font-family: var(--mao-mono, ui-monospace, monospace);
  font-size: 0.88rem;
  color: var(--mao-text);
  word-break: break-all;
  line-height: 1.45;
}


/* =========================
   PAYMENT TIMER / STATUS
   ========================= */

#mao-payment-modal .mao-pay-timer {
  margin-left: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

#mao-payment-modal .mao-pay-status {
  font-size: 0.82rem;
  color: var(--mao-muted);
  margin-top: 0.6rem;
}

#mao-payment-modal .mao-pay-status .mao-ok {
  color: #ffffff;
  font-weight: 600;
}

#mao-payment-modal .mao-pay-status .mao-err {
  color: #ffffff;
  font-weight: 600;
}


/* =========================
   QR CODE
   ========================= */

#mao-payment-modal .mao-qr {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 0.85rem;
  position: relative;
}

#mao-payment-modal .mao-qr::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 24px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.055),
    transparent 70%
  );
  pointer-events: none;
}

#mao-payment-modal .mao-qr .mao-qr-frame {
  position: relative;
  z-index: 1;
  padding: 8px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

#mao-payment-modal .mao-qr img {
  image-rendering: pixelated;
  border-radius: 6px;
}


/* =========================
   SUMMARY
   ========================= */

#mao-payment-modal .mao-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

#mao-payment-modal .mao-summary .mao-summary-plan {
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--mao-text);
}

#mao-payment-modal .mao-summary .mao-summary-price {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.11),
      rgba(255, 255, 255, 0.045)
    );
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.7rem;
  border-radius: 9px;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.035);
}


/* =========================
   REUSE NOTE
   ========================= */

#mao-payment-modal .mao-note-reuse {
  font-size: 0.78rem;
  color: #dddddd;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.65rem;
}


/* =========================
   SCROLLBARS
   ========================= */

#mao-payment-modal .mao-coin-list::-webkit-scrollbar {
  width: 6px;
}

#mao-payment-modal .mao-coin-list::-webkit-scrollbar-track {
  background: transparent;
}

#mao-payment-modal .mao-coin-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

#mao-payment-modal .mao-coin-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}


/* =========================
   HIDDEN ELEMENTS
   ========================= */

#mao-payment-modal [hidden] {
  display: none !important;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 520px) {
  #mao-payment-modal .glass-pad {
    padding: 1.1rem 1.1rem;
  }

  #mao-payment-modal .mao-modal__panel {
    max-width: 100%;
  }

  #mao-payment-modal .mao-modal__head h2 {
    font-size: 1rem;
  }

  #mao-payment-modal .mao-payment-method {
    padding: 0.8rem 0.9rem;
  }

  #mao-payment-modal .mao-pay-coin-logo {
    width: 64px;
    height: 64px;
  }
}