/* ============================================
   PAYMENT MODAL — Full-Screen Overlay
   ============================================ */

/* --- Backdrop --- */
.pay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pay-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* Close button */
.pay-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10002;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.pay-close.active {
  opacity: 1;
  pointer-events: all;
}

.pay-close:hover {
  color: var(--offwhite);
  transform: scale(1.15);
}

/* --- Modal Card --- */
.pay-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10001;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: translate(-50%, calc(-50% + 40px));
  opacity: 0;
  pointer-events: none;
  background: rgba(26, 26, 26, 0.85);
  border: 1.5px solid rgba(245, 200, 0, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7),
              -4px -4px 10px rgba(255, 255, 255, 0.03),
               4px 4px 10px rgba(0, 0, 0, 0.6);
  padding: 2.5rem;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pay-modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%);
}

/* --- Screen containers --- */
.pay-screen {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pay-screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* --- Shared elements --- */
.pay-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pay-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--yellow);
}

.pay-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.pay-status .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--yellow);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.pay-status span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
}

.pay-heading {
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 0.95;
  color: var(--offwhite);
  text-align: center;
  margin-bottom: 12px;
}

.pay-heading span {
  color: var(--yellow);
}

.pay-sub {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: rgba(247, 243, 232, 0.55);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 28px;
  font-style: italic;
}

.pay-bottom-note {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  margin-top: 24px;
}

/* Back button */
.pay-back {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  margin-bottom: 20px;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pay-back:hover {
  color: var(--offwhite);
}

/* ---- Screen 1: Device Choices ---- */
.pay-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.pay-choice {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(245, 200, 0, 0.12);
  padding: 1.8rem;
  text-align: center;
  transition: all 0.2s ease;
}

.pay-choice:hover {
  border-color: rgba(245, 200, 0, 0.4);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
}

.pay-choice.selected {
  background: var(--yellow);
  border-color: rgba(245, 200, 0, 0.8);
  color: var(--black);
}

.pay-choice.selected .pay-choice__title,
.pay-choice.selected .pay-choice__sub {
  color: var(--black);
}

.pay-choice__icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.pay-choice__icon svg {
  width: 2rem;
  height: 2rem;
  color: var(--yellow);
}

.pay-choice.selected .pay-choice__icon svg {
  color: var(--black);
}

.pay-choice__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--offwhite);
  margin-bottom: 4px;
}

.pay-choice__sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---- Screen 2A: QR Code ---- */
.pay-qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.pay-qr {
  width: 220px;
  height: 220px;
  background: #ffffff;
  border: 1.5px solid rgba(245, 200, 0, 0.3);
  box-shadow: -6px -6px 14px rgba(255, 255, 255, 0.04),
               6px 6px 14px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: breathe 2.5s ease-in-out infinite;
}

.pay-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes breathe {
  0%, 100% {
    box-shadow: -6px -6px 14px rgba(255, 255, 255, 0.04),
                 6px 6px 14px rgba(0, 0, 0, 0.7),
                 0 0 0 0 rgba(245, 200, 0, 0);
  }
  50% {
    box-shadow: -6px -6px 14px rgba(255, 255, 255, 0.04),
                 6px 6px 14px rgba(0, 0, 0, 0.7),
                 0 0 20px 4px rgba(245, 200, 0, 0.12);
  }
}

.pay-amount {
  text-align: center;
  margin-bottom: 20px;
}

.pay-amount__value {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--yellow);
  line-height: 1;
}

.pay-amount__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.pay-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pay-steps span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.pay-steps .arrow {
  color: var(--yellow);
}

/* ---- Screen 2B: UPI Link ---- */
.pay-upi-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 64px;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  box-shadow: var(--neu-shadow);
  transition: all 0.2s ease;
  margin-bottom: 24px;
  text-decoration: none;
}

.pay-upi-btn:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

.pay-upi-btn:active {
  box-shadow: var(--neu-inset);
  transform: translateY(0);
}

/* Phone preview mockup */
.pay-phone-preview {
  max-width: 200px;
  margin: 0 auto 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.pay-phone-preview__row {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pay-phone-preview__row:last-child {
  border-bottom: none;
}

.pay-phone-preview__row.highlight {
  color: var(--yellow);
  font-weight: 500;
}

/* ---- Screen 3: Confirmation ---- */
.pay-check-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pay-check-icon svg {
  width: 3rem;
  height: 3rem;
}

.pay-check-icon circle {
  stroke: var(--yellow);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: drawCircle 0.4s ease forwards;
}

.pay-check-icon path {
  stroke: var(--yellow);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.3s ease forwards 0.3s;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.pay-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  background: transparent;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid var(--yellow);
  transition: all 0.2s ease;
  margin-bottom: 8px;
  text-decoration: none;
}

.pay-email-btn:hover {
  background: var(--yellow);
  color: var(--black);
}

/* ---- Country Selector (Left Sidebar) ---- */
.country-selector {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
}

.country-selector__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: none;
  border: 1.5px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.country-selector__btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 200, 0, 0.2);
}

.country-selector__btn.active {
  border-color: var(--yellow);
  background: rgba(245, 200, 0, 0.08);
}

.country-selector__btn::after {
  content: attr(data-label);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: var(--offwhite);
  background: rgba(26, 26, 26, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.country-selector__btn:hover::after {
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .pay-modal {
    padding: 1.8rem;
  }

  .pay-heading {
    font-size: 2.2rem;
  }

  .pay-choices {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pay-qr {
    width: 180px;
    height: 180px;
  }

  .country-selector {
    position: fixed;
    left: 8px;
    top: auto;
    bottom: 16px;
    transform: none;
    flex-direction: row;
    padding: 6px;
  }

  .country-selector__btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .country-selector__btn::after {
    left: 50%;
    top: auto;
    bottom: 100%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-bottom: 6px;
  }
}
