/**
 * ============================================================================
 * YouPI-PG — Modal & Checkout Stylesheet (Strict Box-Aligned & Responsive)
 * ============================================================================
 */

#youpi-modal,
#youpi-modal * {
  box-sizing: border-box !important;
}

#youpi-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.youpi-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 2, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
}

.youpi-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: #090a10;
  border: 1px solid rgba(124, 58, 237, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(124, 58, 237, 0.15);
  border-radius: 18px;
  padding: clamp(16px, 3.5vw, 24px);
  color: #f1f3f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: youpiFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden;
  margin: auto;
}

@keyframes youpiFadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.youpi-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
  z-index: 2;
}
.youpi-close-btn:hover { color: #fff; }

.youpi-header {
  text-align: center;
  margin-bottom: 16px;
  padding-right: 20px;
}

.youpi-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #c4b5fd;
  margin-bottom: 8px;
  text-transform: uppercase;
  max-width: 100%;
}

.youpi-brand-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youpi-title {
  font-size: clamp(17px, 3.5vw, 20px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  word-break: break-word;
}

.youpi-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  word-break: break-word;
}

/* Tabs */
.youpi-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
  width: 100%;
}

.youpi-tab {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youpi-tab.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(6, 182, 212, 0.25));
  color: #fff;
  border: 1px solid rgba(124, 58, 237, 0.5);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

@media (max-width: 520px) {
  .youpi-tab-extra {
    display: none !important;
  }
}

/* Order summary bar */
.youpi-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  width: 100%;
}

.youpi-order-summary > div:first-child {
  min-width: 0;
  flex: 1;
}

.youpi-plan-name {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  word-break: break-word;
}

.youpi-plan-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  word-break: break-word;
  line-height: 1.35;
}

.youpi-amount-box {
  flex-shrink: 0;
  text-align: right;
}

.youpi-curr {
  font-size: 15px;
  font-weight: 700;
  color: #22d3ee;
}

.youpi-val {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.5px;
}

/* Layout Grid */
.youpi-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
}

@media (max-width: 620px) {
  .youpi-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* QR Box */
.youpi-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  width: 100%;
}

.youpi-qr-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  background: #0a0b10;
  border-radius: 12px;
  border: 2px solid rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

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

.youpi-timer-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.youpi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
}

.youpi-dot.pulse {
  animation: youpiPulse 1.5s infinite;
}

@keyframes youpiPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.youpi-qr-note {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.35;
  word-break: break-word;
}

/* Details Column */
.youpi-details-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

/* VPA Card */
.youpi-vpa-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  width: 100%;
}

.youpi-vpa-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 3px;
}

.youpi-vpa-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.youpi-vpa-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #22d3ee;
  word-break: break-all;
  min-width: 0;
  flex: 1;
}

.youpi-copy-btn {
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #c4b5fd;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.youpi-copy-btn:hover {
  background: rgba(124, 58, 237, 0.4);
  color: #fff;
}

/* Apps Grid */
.youpi-apps-label {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.youpi-apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.youpi-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.youpi-app-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.youpi-app-btn.gpay:hover { border-color: #4285F4; color: #93c5fd; }
.youpi-app-btn.phonepe:hover { border-color: #5f259f; color: #c4b5fd; }
.youpi-app-btn.paytm:hover { border-color: #00b9f1; color: #67e8f9; }

/* UTR Section */
.youpi-utr-section {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 12px;
  padding: 12px;
  width: 100%;
}

.youpi-step-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fb7185;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  word-break: break-word;
}

.youpi-utr-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}

.youpi-utr-input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.youpi-utr-input {
  width: 100%;
  background: #05050a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.youpi-utr-input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

.youpi-verify-btn {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.15s;
}
.youpi-verify-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.youpi-verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Status message */
.youpi-status-msg {
  width: 100%;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 8px;
  word-break: break-word;
}
.youpi-status-msg.hidden { display: none; }
.youpi-status-msg.info {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: #67e8f9;
}
.youpi-status-msg.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
}
.youpi-status-msg.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Razorpay Fallback View */
.youpi-card-fallback-box {
  text-align: center;
  padding: 20px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 100%;
}

.youpi-card-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.youpi-card-fallback-box h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  word-break: break-word;
}

.youpi-card-fallback-box p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
  line-height: 1.4;
  word-break: break-word;
}

.youpi-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  max-width: 100%;
  word-break: break-word;
}
.youpi-btn-primary:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* Footer note */
.youpi-footer-note {
  text-align: center;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  width: 100%;
  word-break: break-word;
}
