.payment-modal {
  padding: 16px;
  background: rgba(11, 8, 28, 0.78);
  backdrop-filter: blur(8px);
}

.payment-modal .modal-card {
  width: min(470px, 100%);
  max-height: 96vh;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 28px;
  background: #f7f8fc;
  box-shadow: 0 28px 90px rgba(9, 5, 28, 0.38);
}

.payment-modal .modal-head {
  padding: 14px 18px;
  border: 0;
  background: #fff;
}

.payment-modal .modal-head h3 {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.payment-modal .modal-head button {
  border-radius: 999px;
  padding: 8px 13px;
  background: #f1eff8;
  color: #514a65;
  font-size: 12px;
}

.payment-modal .modal-body {
  padding: 0 14px 14px;
}

.payment-card {
  overflow: hidden;
  border: 1px solid #e8e4f2;
  border-radius: 22px;
  background: #fff;
  text-align: center;
  box-shadow: 0 10px 35px rgba(46, 32, 86, 0.08);
}

.payment-brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  background: linear-gradient(135deg, #20134d, #6d28d9 62%, #0f9f74);
  color: #fff;
  text-align: left;
}

.payment-brand-id {
  display: flex;
  align-items: center;
  gap: 11px;
}

.payment-brand-id > span:last-child {
  display: grid;
  gap: 2px;
}

.payment-brand-id strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.payment-brand-id small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.payment-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-size: 22px;
  font-weight: 900;
}

.payment-logo img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

.payment-name-empty {
  min-width: 112px;
  min-height: 19px;
}

.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.payment-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.17);
}

.payment-status.success::before { background: #55e6ad; box-shadow: 0 0 0 4px rgba(85, 230, 173, 0.18); }
.payment-status.failed::before { background: #ff8c9d; box-shadow: 0 0 0 4px rgba(255, 140, 157, 0.18); }
.payment-status.review::before { background: #d3b5ff; box-shadow: 0 0 0 4px rgba(211, 181, 255, 0.18); }

.payment-amount {
  display: grid;
  gap: 3px;
  padding: 18px 18px 8px;
}

.payment-amount > span {
  color: #777086;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.payment-amount strong {
  color: #171126;
  font-size: clamp(31px, 7vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.payment-amount small {
  color: #159268;
  font-size: 11px;
  font-weight: 750;
}

.payment-scan-label {
  display: grid;
  gap: 2px;
  margin-top: 5px;
}

.payment-scan-label strong {
  color: #211a31;
  font-size: 18px;
}

.payment-scan-label span {
  color: #777086;
  font-size: 10px;
}

.qr-stage {
  display: grid;
  place-items: center;
  padding: 12px 18px 7px;
}

.qr-frame {
  position: relative;
  width: min(258px, 78vw);
  aspect-ratio: 1;
  padding: 13px;
  border: 1px solid #e8e4ef;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(34, 21, 72, 0.12);
}

.payment-card .qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  image-rendering: pixelated;
}

.merchant-name-slot {
  min-height: 25px;
  margin: 5px 18px 0;
  color: #211a31;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.merchant-name-slot.is-empty {
  color: transparent;
}

.qr-corner {
  position: absolute;
  width: 29px;
  height: 29px;
  z-index: 2;
  border-color: #6d28d9;
  border-style: solid;
}

.qr-corner.tl { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-radius: 10px 0 0; }
.qr-corner.tr { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-radius: 0 10px 0 0; }
.qr-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; border-radius: 0 0 0 10px; }
.qr-corner.br { right: -2px; bottom: -2px; border-width: 0 3px 3px 0; border-radius: 0 0 10px; }

.payment-scan-title {
  margin: 10px 18px 2px;
  color: #211a31;
  font-size: 17px;
}

.payment-scan-copy {
  margin: 0 22px 14px;
  color: #777086;
  font-size: 11px;
  line-height: 1.55;
}

.payment-countdown {
  margin: 12px 18px 0;
  text-align: left;
}

.payment-countdown-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #777086;
  font-size: 10px;
}

.payment-countdown-head strong { color: #4d256f; font-variant-numeric: tabular-nums; }
.payment-progress { height: 5px; overflow: hidden; border-radius: 999px; background: #ece7f5; }
.payment-progress span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d28d9, #16a36a); transition: width 1s linear; }

.payment-check-button {
  width: 100%;
  margin: 0;
  min-height: 44px;
}

.payment-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 18px 0;
}

.payment-actions button {
  min-height: 44px;
}

.payment-result {
  min-height: 42px;
  display: grid;
  place-items: center;
  margin: 8px 18px 0;
  color: #6f687d;
  font-size: 11px;
}

.payment-result p { margin: 4px 0; }
.payment-result .notice, .payment-result .form-error { width: 100%; margin: 4px 0; }

.payment-waiting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.payment-waiting::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d68a08;
  box-shadow: 0 0 0 0 rgba(214, 138, 8, 0.35);
  animation: payment-pulse 1.6s infinite;
}

.payment-security {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
  padding: 12px 18px 15px;
  border-top: 1px solid #f0edf5;
  background: #fcfcfe;
  text-align: left;
}

.payment-security > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 50%;
  background: #e8faf3;
  color: #11865f;
  font-weight: 900;
}

.payment-security div { display: grid; gap: 2px; }
.payment-security strong { color: #322a42; font-size: 10px; }
.payment-security small { color: #827b8d; font-size: 9px; line-height: 1.35; }

.payment-success-notification {
  position: fixed;
  z-index: 10000;
  top: 22px;
  right: 22px;
  display: grid;
  width: min(410px, calc(100vw - 32px));
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid #b9ead7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(14, 83, 60, 0.24);
  opacity: 0;
  transform: translateY(-16px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.payment-success-notification::after {
  position: absolute;
  right: -45px;
  bottom: -65px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background: rgba(32, 196, 139, 0.08);
  content: "";
}

.payment-success-notification.show {
  opacity: 1;
  transform: none;
}

.payment-success-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #0e9d6c, #28c991);
  box-shadow: 0 10px 24px rgba(17, 159, 109, 0.25);
  font-size: 28px;
  font-weight: 900;
}

.payment-success-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.payment-success-copy > span {
  color: #078156;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.payment-success-copy h3 {
  margin: 4px 26px 3px 0;
  color: #17372c;
  font-size: 19px;
  line-height: 1.2;
}

.payment-success-copy p {
  margin: 0 0 10px;
  color: #668077;
  font-size: 11px;
}

.payment-success-copy > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
}

.payment-success-copy small {
  display: flex;
  min-width: 0;
  color: #7b8d87;
  font-size: 9px;
  flex-direction: column;
}

.payment-success-copy small strong {
  overflow: hidden;
  max-width: 185px;
  margin-top: 2px;
  color: #29453b;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-success-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #789087;
  background: #eef9f5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

@keyframes payment-pulse {
  70% { box-shadow: 0 0 0 7px rgba(214, 138, 8, 0); }
  100% { box-shadow: 0 0 0 0 rgba(214, 138, 8, 0); }
}

@media (max-width: 520px) {
  .payment-modal { padding: 8px; align-items: end; }
  .payment-modal .modal-card { max-height: 98vh; border-radius: 24px 24px 16px 16px; }
  .payment-modal .modal-head { padding: 12px 15px; }
  .payment-modal .modal-body { padding: 0 8px 8px; }
  .payment-card { border-radius: 20px; }
  .payment-success-notification { top: 12px; right: 16px; left: 16px; width: auto; padding: 16px; grid-template-columns: 46px minmax(0, 1fr); }
  .payment-success-icon { width: 46px; height: 46px; font-size: 23px; }
  .payment-success-copy h3 { font-size: 17px; }
  .payment-brandbar { padding: 14px; }
  .qr-frame { width: min(235px, 72vw); }
  .payment-amount { padding-top: 14px; }
  .payment-scan-copy { margin-bottom: 11px; }
}

/* 3.12.1 Scan & Pay card */
.payment-modal .modal-card {
  width: min(455px, 100%);
  background: #0b0d13;
}

.payment-modal .modal-head {
  position: relative;
  z-index: 4;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.payment-modal .modal-head h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.payment-modal .modal-head button {
  position: absolute;
  z-index: 10;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  overflow: hidden;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  color: transparent;
  background: #102b75;
  box-shadow: 0 4px 15px rgba(5, 18, 59, .35);
}

.payment-modal .modal-head button::before,
.payment-modal .modal-head button::after {
  position: absolute;
  top: 16px;
  left: 8px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  content: "";
}

.payment-modal .modal-head button::before { transform: rotate(45deg); }
.payment-modal .modal-head button::after { transform: rotate(-45deg); }

.payment-modal .modal-body {
  padding: 8px;
  background: #0b0d13;
}

.payment-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 23px 14px 13px;
  border: 0;
  border-radius: 15px;
  background:
    radial-gradient(circle, rgba(24, 219, 255, .9) 1.25px, transparent 1.5px) 15px 10px / 8px 8px no-repeat,
    radial-gradient(circle, rgba(24, 219, 255, .9) 1.25px, transparent 1.5px) calc(100% - 16px) 10px / 8px 8px no-repeat,
    linear-gradient(180deg, #092670 0, #123890 62%, #06aef0 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
}

.payment-card::before {
  position: absolute;
  z-index: -1;
  inset: 20px 8px 58px;
  border-radius: 46% 46% 28px 28px / 7% 7% 22px 22px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #dce8ff;
  content: "";
}

.payment-brandbar {
  position: relative;
  justify-content: center;
  min-height: 52px;
  padding: 7px 42px 5px;
  color: #09266d;
  background: transparent;
  text-align: center;
}

.payment-brandbar::before,
.payment-brandbar::after {
  position: absolute;
  top: -9px;
  width: 42px;
  height: 32px;
  opacity: .95;
  background-image: radial-gradient(circle, #17d7f5 1.4px, transparent 1.8px);
  background-size: 8px 8px;
  content: "";
}

.payment-brandbar::before { left: -2px; }
.payment-brandbar::after { right: -2px; }

.payment-brand-id {
  justify-content: center;
  gap: 8px;
}

.payment-brand-id > span:last-child {
  text-align: left;
}

.payment-brand-id strong {
  color: #09266d;
  font-size: 13px;
  text-transform: uppercase;
}

.payment-brand-id small {
  color: #455276;
  font-size: 9px;
}

.payment-logo {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
  border-color: #d8e4fa;
  background: #fff;
  box-shadow: none;
}

.payment-status {
  position: absolute;
  top: 1px;
  right: 0;
  border-color: #d7e2f7;
  color: #0d377f;
  background: #eff7ff;
}

.payment-amount {
  gap: 1px;
  padding: 4px 18px 5px;
  background: transparent;
}

.payment-amount > span {
  color: #53617d;
  font-size: 8px;
}

.payment-amount strong {
  color: #09266d;
  font-size: 27px;
}

.payment-amount small {
  color: #128267;
  font-size: 9px;
}

.payment-scan-label {
  position: relative;
  margin: 4px 65px 5px;
}

.payment-scan-label::before,
.payment-scan-label::after {
  position: absolute;
  top: 15px;
  width: 39px;
  height: 2px;
  background: #173784;
  content: "";
}

.payment-scan-label::before { left: -46px; }
.payment-scan-label::after { right: -46px; }

.payment-scan-label strong {
  color: #0c2a71;
  font-size: 15px;
}

.payment-scan-label span {
  color: #151a29;
  font-size: 9px;
  font-weight: 750;
}

.qr-stage {
  padding: 2px 18px 3px;
}

.qr-frame {
  width: min(265px, 73vw);
  padding: 11px;
  border-color: #2e82fb;
  border-radius: 8px;
  box-shadow: none;
}

.payment-card .qr-frame img {
  border-radius: 0;
}

.qr-corner {
  display: none;
}

.merchant-name-slot {
  position: relative;
  min-height: 27px;
  margin-top: 2px;
  color: #0b2b73;
  font-size: 17px;
}

.merchant-name-slot:not(.is-empty)::after {
  display: block;
  width: 95px;
  height: 2px;
  margin: 2px auto 0;
  border-radius: 2px;
  background: #1685e9;
  content: "";
}

.payment-scan-copy {
  display: none;
}

.payment-countdown {
  margin: 9px 58px 0;
  padding: 7px 12px;
  border: 1px solid #1685e9;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.payment-countdown-head {
  display: grid;
  justify-content: center;
  margin: 0;
  gap: 0;
}

.payment-countdown-head span {
  color: #2584db;
  font-size: 7px;
}

.payment-countdown-head strong {
  color: #111827;
  font-size: 18px;
  letter-spacing: .08em;
}

.payment-progress {
  height: 3px;
  margin-top: 3px;
}

.payment-actions {
  position: relative;
  z-index: 2;
  margin: 13px 38px 0;
}

.payment-actions button {
  min-height: 38px;
  border: 1px dashed rgba(255, 255, 255, .8);
  color: #fff;
  background: rgba(0, 71, 151, .22);
  box-shadow: none;
  font-size: 9px;
}

.payment-actions .secondary {
  color: #eefbff;
}

.payment-result {
  position: relative;
  z-index: 2;
  min-height: 26px;
  margin-top: 4px;
  color: #effaff;
}

.payment-waiting::before {
  background: #65efff;
}

.payment-security {
  display: none;
}

@media (max-width: 520px) {
  .payment-modal {
    align-items: center;
    padding: 4px;
  }

  .payment-modal .modal-card {
    border-radius: 17px;
  }

  .payment-modal .modal-body {
    padding: 5px;
  }

  .payment-card {
    padding: 20px 9px 10px;
    border-radius: 14px;
  }

  .payment-card::before {
    inset: 17px 6px 53px;
  }

  .qr-frame {
    width: min(250px, 72vw);
  }

  .payment-countdown {
    margin-inline: 45px;
  }

  .payment-actions {
    margin-inline: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 3.20.1 minimal mobile QR modal */
.payment-card.qr-minimal { border-radius: 24px; border: 0; background: #fff; }
.payment-card.qr-minimal .payment-amount { padding: 15px 16px 4px; }
.payment-card.qr-minimal .payment-amount strong { color: #0a2f70; }
.payment-card.qr-minimal .qr-scan-heading { margin: 5px 0 3px; }
.payment-card.qr-minimal .qr-stage { padding: 8px 14px 6px; }
.payment-card.qr-minimal .qr-frame { width: min(310px, calc(100vw - 76px)); padding: 12px; border-color: #80b7e8; border-radius: 15px; box-shadow: 0 14px 36px rgba(6,48,106,.12); }
.payment-card.qr-minimal .qr-corner { display: none; }
.payment-card.qr-minimal .payment-scan-copy { margin: 4px 18px 10px; color: #0d3474; font-weight: 750; }
.payment-card.qr-minimal .payment-countdown { width: min(210px, calc(100% - 32px)); margin: 0 auto 12px; padding: 9px 13px; border: 1px solid #9ccbeb; border-radius: 11px; background: #f4fbff; }
.payment-card.qr-minimal .payment-countdown-head { align-items: center; margin: 0; }
.payment-card.qr-minimal .payment-countdown-head strong { color: #092d68; font-size: 21px; letter-spacing: .08em; }
.payment-card.qr-minimal .payment-progress { display: none; }
.payment-card.qr-minimal .qr-pay-strip { margin: 0 15px; }
.payment-card.qr-minimal .payment-actions { margin-top: 10px; }
.payment-card.qr-minimal .payment-result { min-height: 34px; margin-top: 4px; }
@media (max-width: 520px) {
  .payment-modal { padding: 0; }
  .payment-modal .modal-card { width: 100%; max-height: 100svh; min-height: 100svh; border: 0; border-radius: 0; }
  .payment-modal .modal-head { padding: 10px 14px; }
  .payment-modal .modal-body { padding: 0 10px 10px; }
  .payment-card.qr-minimal { min-height: calc(100svh - 64px); display: flex; flex-direction: column; justify-content: center; }
  .payment-card.qr-minimal .qr-frame { width: min(300px, calc(100vw - 54px)); }
}
@media (max-width: 360px) {
  .payment-card.qr-minimal .qr-frame { width: min(265px, calc(100vw - 44px)); padding: 9px; }
  .payment-card.qr-minimal .payment-actions { gap: 5px; margin-inline: 10px; }
  .payment-card.qr-minimal .payment-actions button { padding-inline: 5px; font-size: 10px; }
}
