.rasa-paygate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(8, 12, 28, 0);
  backdrop-filter: blur(0);
  transition: background 0.32s ease, backdrop-filter 0.32s ease;
}
.rasa-paygate-overlay.is-open {
  background: rgba(8, 12, 28, 0.55);
  backdrop-filter: blur(8px);
}
html.rasa-paygate-open,
html.rasa-paygate-open body {
  overflow: hidden;
}

.rasa-paygate {
  position: relative;
  width: 100%;
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(8, 12, 28, 0.28);
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  font-family: inherit;
}
.rasa-paygate-overlay.is-open .rasa-paygate {
  transform: translateY(0);
}

.rasa-paygate-handle {
  display: block;
  width: 42px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.18);
  flex-shrink: 0;
}
.rasa-paygate-x {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.rasa-paygate-sum {
  background: linear-gradient(165deg, #141c38 0%, #1a2748 55%, #0f172a 100%);
  color: #f8f5ee;
  padding: 18px 20px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}
.rasa-paygate-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #d4af37;
  font-weight: 700;
}
.rasa-paygate-sum h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.rasa-paygate-sub {
  margin: 6px 0 0;
  opacity: 0.78;
  font-size: 13px;
}
.rasa-paygate-rows {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.rasa-paygate-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  opacity: 0.9;
}
.rasa-paygate-rows b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rasa-paygate-rows .is-list {
  opacity: 0.72;
}
.rasa-paygate-rows .is-off,
.rasa-paygate-rows .is-save {
  color: #86efac;
  opacity: 1;
  text-decoration: none;
}
.rasa-paygate-rows .is-net {
  opacity: 1;
}
.rasa-paygate-rows .is-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.28);
  font-size: 15px;
  opacity: 1;
  color: #f3e6b8;
}

.rasa-paygate-main {
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.rasa-paygate-stage[data-stage='otp'] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.rasa-paygate-head h4,
.rasa-paygate-stage h4 {
  margin: 8px 0 4px;
  font-size: 18px;
}
.rasa-paygate-head p,
.rasa-paygate-stage p {
  margin: 0;
  color: #475569;
  font-size: 13.5px;
  line-height: 1.7;
}
.rasa-paygate-label {
  margin: 8px 0 4px;
  font-weight: 700;
}
.rasa-paygate-phone {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #0f172a !important;
  font-size: 18px !important;
  direction: ltr;
  text-align: center;
}
.rasa-paygate-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.rasa-paygate-badge.is-in {
  background: #ecfdf5;
  color: #047857;
}
.rasa-paygate-badge.is-new {
  background: #fff7ed;
  color: #c2410c;
}

.rasa-paygate-otp {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
  gap: 8px;
  direction: ltr;
}
.rasa-paygate-digit {
  width: 100%;
  min-height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border: 1.5px solid #dbe3f0;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.rasa-paygate-digit:focus {
  outline: none;
  border-color: #d4af37;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
  animation: rasa-paygate-pulse 1.4s ease-in-out infinite;
}
.rasa-paygate-otp.is-shake {
  animation: rasa-paygate-shake 0.38s ease;
}

.rasa-paygate-alert {
  min-height: 1.2em;
  color: #b91c1c;
  font-size: 13px;
}
.rasa-paygate-go {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #c9a227, #9a7514);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(154, 117, 20, 0.28);
}
.rasa-paygate-go:disabled {
  opacity: 0.65;
  cursor: wait;
}
.rasa-paygate-resend {
  border: 0;
  background: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}
.rasa-paygate-resend:disabled {
  cursor: default;
  opacity: 0.8;
}

.rasa-paygate-skel {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.rasa-paygate-skel i {
  display: block;
  height: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, #eef2f7, #e2e8f0, #eef2f7);
  background-size: 200% 100%;
  animation: rasa-paygate-shimmer 1.1s linear infinite;
}
.rasa-paygate-skel i:first-child {
  width: 72%;
}
.rasa-paygate-ok {
  width: 64px;
  height: 64px;
  margin: 24px auto 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ecfdf5;
  color: #059669;
  font-size: 32px;
  font-weight: 800;
}

@keyframes rasa-paygate-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}
@keyframes rasa-paygate-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
@keyframes rasa-paygate-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (min-width: 720px) {
  .rasa-paygate-overlay {
    align-items: center;
    padding: 24px;
  }
  .rasa-paygate {
    width: min(860px, 100%);
    max-height: min(88vh, 640px);
    flex-direction: row-reverse;
    border-radius: 22px;
    transform: scale(0.96);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
  }
  .rasa-paygate-overlay.is-open .rasa-paygate {
    transform: scale(1);
    opacity: 1;
  }
  .rasa-paygate-handle {
    display: none;
  }
  .rasa-paygate-x {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    top: 14px;
    left: 14px;
  }
  .rasa-paygate-sum {
    width: 42%;
    min-width: 280px;
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .rasa-paygate-sum h3 {
    font-size: 24px;
  }
  .rasa-paygate-main {
    width: 58%;
    padding: 40px 36px 32px;
    justify-content: center;
  }
  .rasa-paygate-go {
    position: static;
    margin-top: 8px;
  }
  .rasa-paygate-digit {
    min-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rasa-paygate-overlay,
  .rasa-paygate,
  .rasa-paygate-digit,
  .rasa-paygate-skel i {
    transition: none !important;
    animation: none !important;
  }
  .rasa-paygate {
    transform: none;
    opacity: 1;
  }
}
