.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-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;
}

.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;
}

.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-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0 18px;
  overflow: hidden;
  border: 1px solid #ece9f3;
  border-radius: 13px;
  background: #faf9fd;
  text-align: left;
}

.payment-detail {
  min-width: 0;
  padding: 10px 12px;
}

.payment-detail + .payment-detail { border-left: 1px solid #ece9f3; }
.payment-detail span { display: block; margin-bottom: 3px; color: #8b8498; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.payment-detail code, .payment-detail strong { display: block; overflow: hidden; color: #2e263e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.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: calc(100% - 36px);
  margin: 14px 18px 0;
  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; }
}
