/* ==========================================================================
   July CONTROL — Mua Code (checkout) — Dark Mode Neon Blue Theme
   Nền #080D19 · Card #111827 · Chủ đạo #3B82F6 · Radius 16px · Font Inter
   Mobile First · Gọn gàng · Không khoảng trắng thừa
   ========================================================================== */

/* ---------- Khung trang ---------- */
.checkout-page {
  max-width: 1040px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #F1F5F9;
  min-height: auto;
  flex: 1 0 auto;
  width: 100%;
}
.checkout-page[data-state="payment"] {
  min-height: auto !important;
}
body.muamon-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0 !important;
}
.checkout-state { display: block; }
.checkout-state.hidden { display: none !important; }
.checkout-body {
  padding: 20px 16px 80px;
  display: grid;
  gap: 16px;
  box-sizing: border-box;
}
#state-create .checkout-body {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}
.checkout-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.checkout-right {
  min-width: 0;
}

/* ---------- Banner giới thiệu dịch vụ Mon Facebook (Neon Blue) ---------- */
.checkout-hero {
  padding: 22px 16px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(59, 130, 246, 0.16);
  background:
    radial-gradient(ellipse 700px 140px at 50% 0%, rgba(59, 130, 246, 0.18), transparent 75%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.8) 0%, rgba(8, 13, 25, 0.98) 100%);
}
.checkout-hero-inner {
  max-width: 660px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-neon-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.22);
}
.neon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3B82F6;
  box-shadow: 0 0 8px #3B82F6, 0 0 14px #3B82F6;
  animation: neonPulse 2s infinite ease-in-out;
}
@keyframes neonPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.checkout-hero-title {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #F8FAFC;
  margin: 0;
}
.neon-text {
  color: #60A5FA;
  text-shadow: 0 0 14px rgba(59, 130, 246, 0.6), 0 0 24px rgba(59, 130, 246, 0.35);
}
.checkout-hero-desc {
  font-size: 13.5px;
  color: #94A3B8;
  line-height: 1.5;
  margin: 0;
  max-width: 580px;
}

/* ---------- Stepper ---------- */
.checkout-stepper-wrap {
  padding: 14px 16px 0;
}
.checkout-stepper {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
}
.step-label {
  font-size: 12px;
  color: #94A3B8;
  white-space: nowrap;
}
.step-line {
  flex: 0 1 44px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.step-current .step-num {
  background: #3B82F6;
  border-color: #3B82F6;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.55);
}
.step-current .step-label {
  color: #F8FAFC;
  font-weight: 600;
}
.step-done .step-num {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60A5FA;
}
.step-done .step-label {
  color: #F8FAFC;
}

/* ---------- Card chung ---------- */
.ck-card {
  background: #111827;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 18px;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.05),
    0 10px 28px -4px rgba(0, 0, 0, 0.45),
    0 0 24px -4px rgba(59, 130, 246, 0.08);
  box-sizing: border-box;
}
.ck-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #F1F5F9;
}
.ck-card-head i {
  font-size: 17px;
  color: #3B82F6;
  flex-shrink: 0;
}
.head-badge-opt {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Chọn Gói Mon: 3 cột Desktop / 2 cột Mobile ---------- */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pkg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(8, 13, 25, 0.65);
  border: 1.5px solid rgba(59, 130, 246, 0.16);
  color: #F1F5F9;
  cursor: pointer;
  text-align: left;
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  box-sizing: border-box;
  width: 100%;
  outline: none;
}
.pkg-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 16px rgba(59, 130, 246, 0.15);
}
.pkg-card:active {
  transform: scale(0.98);
}
.pkg-card.selected {
  border-color: #3B82F6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16) 0%, rgba(17, 24, 39, 0.95) 100%);
  box-shadow:
    0 0 0 1px #3B82F6,
    0 8px 24px -2px rgba(59, 130, 246, 0.35);
}
.pkg-card:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
}

/* Dấu tích khi gói được chọn */
.pkg-check {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3B82F6;
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  animation: checkPop .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pkg-card.selected .pkg-check {
  display: flex;
}
@keyframes checkPop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pkg-tag {
  position: absolute;
  top: -8px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.pkg-tag.popular {
  background: #1D4ED8;
  border: 1px solid #3B82F6;
  color: #EFF6FF;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.pkg-tag.vip {
  background: #854D0E;
  border: 1px solid #F59E0B;
  color: #FEF3C7;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.pkg-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60A5FA;
  font-size: 18px;
}
.pkg-val {
  font-size: 14px;
  font-weight: 700;
  color: #F8FAFC;
}
.pkg-price {
  font-size: 13px;
  font-weight: 700;
  color: #3B82F6;
  font-variant-numeric: tabular-nums;
}

/* Gói tùy chỉnh */
.custom-card-wrap {
  margin-top: 10px;
}
.pkg-card.is-custom {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  width: 100%;
}
.custom-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pkg-icon.custom {
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
}
.custom-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.custom-card-info .pkg-val {
  font-size: 13.5px;
}
.pkg-price-hint {
  font-size: 11.5px;
  color: #94A3B8;
}
.pkg-card.is-custom .pkg-check {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
}

.custom-input-box {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(8, 13, 25, 0.6);
  border: 1px dashed rgba(59, 130, 246, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease-in-out;
}
.custom-input-box.hidden {
  display: none !important;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.custom-label {
  font-size: 12px;
  font-weight: 600;
  color: #94A3B8;
}
.custom-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.custom-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #111827;
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #F8FAFC;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
.custom-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.custom-unit {
  font-size: 13px;
  font-weight: 700;
  color: #60A5FA;
  padding: 0 4px;
}
.custom-calc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  margin-top: 2px;
}
.calc-label {
  color: #94A3B8;
}
.calc-val {
  font-weight: 700;
  color: #3B82F6;
  font-variant-numeric: tabular-nums;
}
.calc-rate {
  font-size: 11.5px;
  color: #64748B;
  margin-left: auto;
}

/* ---------- UID Facebook ---------- */
.uid-card {
  margin-top: 4px;
}
.uid-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.uid-desc {
  font-size: 12.5px;
  color: #94A3B8;
  margin: 0;
  line-height: 1.5;
}
.uid-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.uid-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.uid-prefix-icon {
  position: absolute;
  left: 12px;
  color: #64748B;
  font-size: 15px;
  pointer-events: none;
}
.uid-input {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 36px;
  border-radius: 10px;
  background: #080D19;
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #F8FAFC;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
  box-sizing: border-box;
}
.uid-input.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.uid-input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.uid-clear {
  position: absolute;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748B;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease;
}
.uid-clear:hover {
  color: #F8FAFC;
}
.uid-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s ease;
}
.uid-link-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.22);
  border-color: #3B82F6;
  color: #93C5FD;
}
.uid-link-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.uid-hint {
  font-size: 11.5px;
  color: #64748B;
  margin: 0;
  line-height: 1.45;
}

/* ---------- Tóm tắt đơn hàng (Cột phải) ---------- */
.order-summary {
  position: sticky;
  top: 76px;
}
.os-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.os-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.os-head-left i {
  font-size: 16px;
  color: #3B82F6;
}
.os-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #F1F5F9;
  margin: 0;
}
.os-edit {
  border: none;
  background: transparent;
  color: #60A5FA;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease;
}
.os-edit:hover {
  color: #93C5FD;
  text-decoration: underline;
}
.os-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.os-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.os-label {
  color: #94A3B8;
  font-size: 12.5px;
}
.os-value {
  color: #F8FAFC;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.os-value-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  color: #60A5FA;
}
.os-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 12px 0;
}
.os-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.os-total-label {
  font-size: 13px;
  color: #F8FAFC;
  font-weight: 600;
}
.os-total-value {
  font-size: 22px;
  font-weight: 800;
  color: #3B82F6;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

/* ---------- Nút tạo đơn hàng: Gradient Xanh + Icon QR ---------- */
.cta-wrap {
  margin-top: 16px;
}
.cta-btn {
  position: relative;
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 20px -2px rgba(59, 130, 246, 0.45);
  transition: all .2s cubic-bezier(.16, 1, .3, 1);
  outline: none;
  box-sizing: border-box;
}
.cta-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cta-qr-icon {
  font-size: 18px;
  color: #FFFFFF;
}
.cta-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}
.cta-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -2px rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
}
.cta-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 4px 14px -2px rgba(59, 130, 246, 0.4);
}
.cta-btn:disabled {
  background: #1E293B;
  color: #64748B;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.65;
}
.cta-btn:disabled .cta-qr-icon {
  color: #64748B;
}
.cta-note {
  margin-top: 8px;
  text-align: center;
  font-size: 11.5px;
  color: #64748B;
}

/* Chip trạng thái (JS setStatus() giữ nguyên class pending/expired/success) */
.ps-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.ps-status.pending { background: var(--warning-bg, rgba(245,158,11,.14)); color: var(--warning, #F59E0B); }
.ps-status.expired { background: var(--danger-bg, rgba(239,68,68,.14)); color: var(--danger, #EF4444); }
.ps-status.success { background: var(--success-bg, rgba(34,197,94,.14)); color: var(--success, #22C55E); }

/* ---------- Trạng thái 2: Thanh toán — Compact Mobile UI ---------- */
/* Bảng màu spec: nền #080D19, card #111827, chủ đạo #3B82F6, radius 16px, font Inter */

body[data-checkout-state="payment"],
.checkout-page[data-state="payment"] {
  background-color: #080D19 !important;
}

.checkout-page[data-state="payment"] .checkout-hero,
.checkout-page[data-state="payment"] .checkout-stepper-wrap {
  display: none !important;
}

#state-payment {
  background-color: #080D19;
  min-height: auto !important;
  padding: 16px 0 24px !important;
}

.pm-body {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 14px 0 !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-content: start;
  box-sizing: border-box;
}

/* ---------- Card thông tin đơn hàng (Order Summary) ---------- */
.pay-summary {
  background: #111827;
  border: 1px solid #25334A;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.08),
    0 8px 24px -4px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.ps-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pm-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  min-width: 0;
}

.pm-timer i {
  font-size: 15px;
  color: #3B82F6;
  flex-shrink: 0;
}

.pm-timer-label {
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
  white-space: nowrap;
}

.pm-timer-count {
  font-size: 14.5px;
  font-weight: 750;
  color: #60A5FA;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.pm-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
  padding: 0;
}

.pm-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #F87171;
  transform: scale(1.05);
}

.ps-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ps-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ps-pkg {
  font-size: 15.5px;
  font-weight: 750;
  color: #F8FAFC;
  letter-spacing: -0.01em;
}

.ps-code {
  font-size: 12.5px;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ps-code-val {
  color: #CBD5E1;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ps-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  text-align: right;
}

.ps-price,
#payAmount {
  font-size: 22px;
  font-weight: 800;
  color: #3B82F6; /* Số tiền màu xanh dương */
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.ps-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ps-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ps-status.pending {
  background: rgba(245, 158, 11, 0.14);
  color: #FBBF24; /* Trạng thái chờ thanh toán màu vàng */
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.ps-status.pending::before {
  background: #F59E0B;
  box-shadow: 0 0 0 2.5px rgba(245, 158, 11, 0.22);
  animation: pulseDot 2s infinite ease-in-out;
}

.ps-status.paid,
.ps-status.success {
  background: rgba(34, 197, 94, 0.14);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.ps-status.paid::before,
.ps-status.success::before {
  background: #22C55E;
  box-shadow: 0 0 0 2.5px rgba(34, 197, 94, 0.22);
}

.ps-status.expired {
  background: rgba(239, 68, 68, 0.14);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.ps-status.expired::before {
  background: #EF4444;
  box-shadow: 0 0 0 2.5px rgba(239, 68, 68, 0.22);
}

/* ============================================================
   2. CARD CHÍNH THANH TOÁN (VIETQR + THÔNG TIN CHUYỂN KHOẢN)
   ============================================================ */
.pm-card {
  background: #111827;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.06),
    0 12px 32px -4px rgba(0, 0, 0, 0.55),
    0 0 28px -4px rgba(59, 130, 246, 0.12);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-width: 0;
  box-sizing: border-box;
  color: #F1F5F9;
}

.pm-card-main {
  position: relative;
}

/* TIÊU ĐỀ QR: chính giữa, chữ in hoa thanh lịch */
.pm-qr-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 16px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #F1F5F9;
  text-transform: uppercase;
  text-align: center;
}

.pm-qr-title i {
  font-size: 18px;
  color: #3B82F6;
  flex-shrink: 0;
}

/* KHUNG QR CODE: căn giữa, mobile 75–80% card, max-width 420px, tỷ lệ 1:1 */
.pm-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  width: 100%;
  box-sizing: border-box;
}

.pm-qr-frame {
  position: relative;
  width: 82%; /* Khoảng 76–78% card width, đúng chuẩn 75–80% */
  max-width: 420px; /* Không vượt quá 420px */
  aspect-ratio: 1 / 1; /* Chuẩn tỷ lệ 1:1 */
  padding: 12px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 auto;
}

.pm-qr-frame img,
#qrImg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain; /* Giữ nguyên tỷ lệ, không crop, không blur hoặc méo */
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

#qrImg[hidden],
.pm-qr-frame img[hidden] {
  display: none !important;
}

.pm-qr-frame .qr-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  color: #475569;
  background: #FFFFFF;
  box-sizing: border-box;
  z-index: 2;
}

.pm-qr-frame .qr-placeholder[hidden],
.qr-placeholder[hidden],
.qr-placeholder.hidden {
  display: none !important;
}

/* CHIP TÊN NGÂN HÀNG DƯỚI QR */
.pm-bank-chip {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93C5FD;
  font-size: 12.5px;
  font-weight: 600;
  max-width: 100%;
  box-sizing: border-box;
}

.pm-bank-chip i {
  font-size: 14px;
  color: #3B82F6;
  flex-shrink: 0;
}

.pm-bank-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   3. THÔNG TIN CHUYỂN KHOẢN (TRANSFER INFORMATION)
   ============================================================ */
.pm-info-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #F1F5F9;
  text-transform: uppercase;
}

.pm-info-title i {
  font-size: 16px;
  color: #3B82F6;
  flex-shrink: 0;
}

.pm-info-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pm-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
  box-sizing: border-box;
}

.pm-info-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.pm-info-label {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: #94A3B8;
  white-space: nowrap;
  text-align: left;
}

.pm-info-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

.pm-info-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #F1F5F9;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.pm-info-value.pm-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

/* Nổi bật số tiền */
.pm-amount-highlight {
  color: #3B82F6 !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  letter-spacing: -0.01em;
}

/* DÒNG NỘI DUNG CHUYỂN KHOẢN (ĐẶC BIỆT QUAN TRỌNG) */
.pm-info-row-code {
  background: rgba(59, 130, 246, 0.08);
  margin: 6px -8px 2px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(59, 130, 246, 0.38);
}

.pm-info-row-code .pm-info-label {
  color: #93C5FD;
  font-weight: 650;
}

.pm-code-val {
  color: #60A5FA !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  background: rgba(15, 23, 42, 0.7);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  letter-spacing: 0.05em;
}

/* NÚT SAO CHÉP (COMPACT & TOAST-ENABLED) */
.pm-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
  min-height: 28px;
  box-sizing: border-box;
  outline: none;
}

.pm-copy:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
  color: #93C5FD;
}

.pm-copy:active {
  transform: scale(0.96);
}

.pm-copy.copied {
  background: rgba(34, 197, 94, 0.16) !important;
  border-color: rgba(34, 197, 94, 0.5) !important;
  color: #4ADE80 !important;
}

.pm-copy i {
  font-size: 13px;
  flex-shrink: 0;
}

/* Nút copy riêng cho mã nội dung chuyển khoản */
.pm-copy-code {
  background: #2563EB;
  border-color: #3B82F6;
  color: #FFFFFF;
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pm-copy-code:hover {
  background: #1D4ED8;
  border-color: #60A5FA;
  color: #FFFFFF;
}

.pm-copy-code.copied {
  background: #16A34A !important;
  border-color: #22C55E !important;
  color: #FFFFFF !important;
}

/* ============================================================
   4. CARD LƯU Ý THANH TOÁN (PAYMENT NOTICE CARD)
   ============================================================ */
.pm-card-note {
  background: #111827;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow:
    0 6px 24px -2px rgba(0, 0, 0, 0.4),
    0 0 20px -2px rgba(59, 130, 246, 0.08);
}

.pm-note-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #60A5FA;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}

.pm-note-head i {
  font-size: 17px;
  color: #3B82F6;
  flex-shrink: 0;
}

.pm-note-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm-note-list li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #94A3B8;
  text-align: left;
}

.pm-note-list li::before {
  display: none; /* Bỏ dot cũ vì đã dùng icon riêng */
}

.pm-note-list li > i {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.note-icon-accent {
  color: #3B82F6;
}

.note-icon-amber {
  color: #F59E0B;
}

.note-icon-green {
  color: #10B981;
}

.pm-note-em {
  color: #F1F5F9;
  font-weight: 650;
}

.pm-note-code {
  color: #60A5FA;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ============================================================
   5. RESPONSIVE MEDIA QUERIES (360px - 1440px)
   ============================================================ */

/* Mobile tiêu chuẩn: <= 430px (iPhone 14/15 Pro Max, v.v.) */
@media (max-width: 430px) {
  .pm-body {
    padding: 0 10px !important;
    gap: 12px;
  }
  .pm-card {
    padding: 14px;
    border-radius: 14px;
  }
  .pay-summary {
    padding: 12px 14px;
    border-radius: 14px;
  }
  .pm-qr-frame {
    width: 82%;
    max-width: 320px;
  }
  .pm-info-label {
    font-size: 12px;
  }
  .pm-info-value {
    font-size: 13px;
  }
  .pm-copy {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 26px;
  }
}

/* Mobile nhỏ: <= 375px (iPhone SE, iPhone 12/13 Mini) */
@media (max-width: 375px) {
  .pm-body {
    padding: 0 8px !important;
    gap: 10px;
  }
  .pm-card {
    padding: 12px 10px;
    border-radius: 12px;
  }
  .pay-summary {
    padding: 10px 12px;
    border-radius: 12px;
  }
  .pm-qr-frame {
    width: 82%;
    max-width: 280px;
    padding: 10px;
  }
  .pm-info-row {
    gap: 6px;
    padding: 8px 0;
  }
  .pm-info-label {
    font-size: 11.5px;
  }
  .pm-info-value {
    font-size: 12.5px;
  }
  .pm-copy {
    padding: 3px 6px;
    font-size: 10.5px;
    min-height: 24px;
    border-radius: 6px;
  }
  .pm-info-row-code {
    margin: 4px -4px 0;
    padding: 8px 6px;
  }
  .pm-code-val {
    font-size: 13px !important;
    padding: 2px 6px;
  }
}

/* Mobile rất hẹp: <= 360px (Samsung Galaxy S, màn hình cũ) */
@media (max-width: 360px) {
  .app-header {
    padding: 0 8px !important;
    gap: 6px !important;
  }
  .app-header .brand {
    font-size: 13.5px !important;
  }
  .app-header .header-right {
    gap: 4px !important;
  }
  #headerAuthWrap .btn-sm {
    padding: 5px 8px !important;
    font-size: 12px !important;
  }
  .pm-body {
    padding: 0 6px !important;
    gap: 8px;
  }
  .pm-card {
    padding: 10px 8px;
    border-radius: 12px;
  }
  .pay-summary {
    padding: 10px 8px;
    border-radius: 12px;
  }
  .pm-qr-frame {
    width: 82%;
    max-width: 250px;
    padding: 8px;
  }
  .pm-timer-label {
    display: none;
  }
  .pm-info-row {
    gap: 4px;
  }
  .pm-copy {
    padding: 3px 5px;
    font-size: 10px;
    gap: 2px;
  }
}

/* Tablet & Desktop: >= 641px (Gọn gàng, bóng đổ sâu, QR chuẩn tỷ lệ) */
@media (min-width: 641px) {
  #state-payment {
    padding-top: 24px;
  }
  .pm-card-main {
    box-shadow:
      0 0 0 1px rgba(59, 130, 246, 0.08),
      0 18px 44px rgba(0, 0, 0, 0.5),
      0 0 34px rgba(59, 130, 246, 0.12);
  }
}

.reset-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer;
}
.reset-btn:hover { color: var(--text); border-color: var(--text-muted); background: var(--surface-hover); }

/* ---------- Trạng thái 3: Thành công ---------- */
.success-card { max-width: 520px; margin: 0 auto; text-align: center; }
.success-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--success-bg); color: var(--success);
}
.success-icon i { font-size: 30px; }
.success-title { font-size: 22px; font-weight: 750; letter-spacing: -.015em; color: var(--text); margin: 0 0 4px; }
.success-desc { font-size: 13.5px; color: var(--text-muted); margin: 0 0 18px; }
.success-detail { text-align: left; padding: 4px 0; }
.success-item {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.success-item:last-child { border-bottom: none; }
.success-label { color: var(--text-muted); }
.success-value { color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.success-value.mono { font-family: ui-monospace, monospace; font-weight: 500; }
.success-status { color: var(--success); }
.success-instruction { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); text-align: left; }
.success-instruct-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); margin: 0 0 6px; }
.success-instruct-desc { font-size: 12.5px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.55; }
.redeem-box {
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px dashed color-mix(in srgb, var(--primary) 35%, transparent);
  color: var(--primary); font-family: ui-monospace, monospace; font-size: 13.5px;
  overflow-wrap: anywhere; text-align: center;
}
.redeem-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 650;
}
.redeem-btn:hover { opacity: .92; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  #state-create .checkout-body { grid-template-columns: 1fr; }
  .order-summary { position: static; order: 2; }
  .pay-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #state-create .checkout-body { padding: 18px 14px 80px; }
  #state-payment .checkout-body { padding: 0 14px !important; }
  .pkg-grid { grid-template-columns: repeat(2, 1fr); }
  .step-label { display: none; }
  .step-line { flex-basis: 32px; }
  .checkout-stepper-wrap { padding: 14px 14px 0; }
}
