/* ==============================================================================
   Priyo SMP — Automated Checkout Modal Styles
   Cyber / Minecraft Glassmorphism Theme (Purple & Midnight Blue)
   ============================================================================== */

.co-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 6, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}

.co-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.co-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(160deg, rgba(26, 22, 60, 0.94) 0%, rgba(13, 14, 38, 0.98) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 60px -12px rgba(2, 4, 18, 0.85),
              0 0 38px -8px rgba(168, 85, 247, 0.32),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: scale(0.92) translateY(14px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  color: #fff;
  font-family: inherit;
  box-sizing: border-box;
}

.co-modal-backdrop.is-open .co-modal-dialog {
  transform: scale(1) translateY(0);
}

/* Close Button */
.co-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.co-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  transform: rotate(90deg);
}

/* Header & Item Banner */
.co-modal-head {
  text-align: center;
  margin-bottom: 20px;
}

.co-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.3);
  margin-bottom: 10px;
}

.co-modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.co-modal-subtitle {
  font-size: 13px;
  color: #a5b4fc;
  margin: 0;
  line-height: 1.4;
}

/* Product Summary Card */
.co-prod-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.co-prod-name {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
}

.co-prod-price {
  font-size: 18px;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: -0.3px;
}

/* Avatar Preview & IGN Input Area */
.co-ign-group {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(11, 12, 30, 0.7);
  border: 1.5px solid rgba(168, 85, 247, 0.28);
  border-radius: 16px;
  padding: 10px 14px;
  transition: all 0.25s ease;
  margin-bottom: 8px;
}

.co-ign-group:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.22);
  background: rgba(15, 17, 42, 0.9);
}

.co-ign-group.is-valid {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.co-ign-group.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.co-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.co-avatar-img {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  border-radius: 6px;
}

.co-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.co-input-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 2px;
}

.co-ign-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  padding: 2px 0;
}

.co-ign-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

/* Fix: Kill browser autofill white/yellow background injection */
.co-ign-input:-webkit-autofill,
.co-ign-input:-webkit-autofill:hover,
.co-ign-input:-webkit-autofill:focus,
.co-ign-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0px 1000px rgba(11, 12, 38, 0.98) inset !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: #ffffff;
  border: none !important;
  outline: none !important;
}

/* Extra Fields for Checkout (Email & Phone) */
.co-extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

@media (max-width: 480px) {
  .co-extra-row {
    grid-template-columns: 1fr;
  }
}

.co-field-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(11, 12, 30, 0.7);
  border: 1.5px solid rgba(168, 85, 247, 0.28);
  border-radius: 14px;
  padding: 8px 12px;
  transition: all 0.25s ease;
}

.co-field-group:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.22);
  background: rgba(15, 17, 42, 0.9);
}

.co-field-icon {
  width: 18px;
  height: 18px;
  color: #a855f7;
  flex-shrink: 0;
}

/* Feedback messages */
.co-feedback {
  min-height: 20px;
  font-size: 12px;
  line-height: 1.3;
  margin-bottom: 18px;
  padding: 0 4px;
}

.co-feedback.is-error {
  color: #f87171;
}

.co-feedback.is-success {
  color: #4ade80;
}

/* Terms note */
.co-note {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 20px;
  text-align: center;
}

.co-note a {
  color: #c084fc;
  text-decoration: underline;
}

/* Submit Action Button */
.co-submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(120deg, #8b5cf6 0%, #3b82f6 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(139, 92, 246, 0.65),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.co-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -6px rgba(139, 92, 246, 0.8),
              0 0 20px rgba(168, 85, 247, 0.4);
}

.co-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Spinner */
.co-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: co-spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes co-spin {
  to { transform: rotate(360deg); }
}

/* Mobile responsive */
@media (max-width: 520px) {
  .co-modal-dialog {
    padding: 24px 18px 20px;
    border-radius: 18px;
  }
  .co-modal-title {
    font-size: 20px;
  }
}

/* ==============================================================================
   Celebration & Failure Post-Payment Popups
   ============================================================================== */

.co-celebrate-dialog {
  text-align: center;
  max-width: 460px;
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 28px 70px -10px rgba(0, 0, 0, 0.9),
              0 0 50px rgba(168, 85, 247, 0.35);
  position: relative;
  overflow: hidden;
}

.co-celebrate-dialog::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

/* Avatar showcase */
.co-celebrate-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
}

.co-celebrate-avatar {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  border: 3px solid #a855f7;
  background: #141332;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 30px rgba(168, 85, 247, 0.5);
  image-rendering: pixelated;
  animation: co-float 3s ease-in-out infinite;
}

.co-celebrate-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2px solid #0d0e26;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

.co-celebrate-badge.is-failed {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

@keyframes co-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.co-celebrate-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.co-celebrate-title.is-success {
  background: linear-gradient(135deg, #ffffff 0%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.co-celebrate-title.is-failed {
  color: #fca5a5;
}

.co-celebrate-sub {
  font-size: 13px;
  color: #c4b5fd;
  margin: 0 0 18px;
  line-height: 1.5;
}

/* Product Info Card */
.co-celebrate-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.co-celebrate-item-left {
  text-align: left;
}

.co-celebrate-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.co-celebrate-item-player {
  font-size: 12px;
  color: #a78bfa;
}

.co-celebrate-item-price {
  font-size: 18px;
  font-weight: 800;
  color: #34d399;
}

/* Delivery notice box */
.co-delivery-notice {
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(52, 211, 153, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.co-delivery-notice.is-failed {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}

.co-delivery-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.co-delivery-notice-text {
  font-size: 12.5px;
  color: #d1fae5;
  line-height: 1.5;
}

.co-delivery-notice.is-failed .co-delivery-notice-text {
  color: #fecaca;
}

.co-delivery-notice-text b {
  color: #ffffff;
}

.co-celebrate-btn {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px -4px rgba(139, 92, 246, 0.5);
}

.co-celebrate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -4px rgba(139, 92, 246, 0.75);
}
