/* W2 VietQR invoice modal — shared by Ready-made and Custom constructors */
.w2-vietqr-modal-sheet {
  max-width: 620px !important;
  width: min(620px, calc(100vw - 32px)) !important;
}

.w2-vietqr-invoice-step {
  font-family: 'DM Sans', Arial, sans-serif;
  color: #111;
}

.w2-vietqr-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.w2-vietqr-back {
  border: 0;
  background: transparent;
  color: #777;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 6px 4px 0 0;
}

.w2-vietqr-title {
  margin: 0;
}

.w2-vietqr-subtitle {
  margin-top: 4px;
}

.w2-vietqr-card {
  border: 1px solid #e5e5e5;
  border-radius: 22px;
  background: #fff;
  padding: 18px;
}

.w2-vietqr-qr-wrap {
  width: min(260px, 72vw);
  height: min(260px, 72vw);
  margin: 0 auto 14px;
  border: 1px solid #eee;
  border-radius: 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.w2-vietqr-qr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.w2-vietqr-amount {
  text-align: center;
  font-family: 'Syne', 'Montserrat', Arial, sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  color: #c5a059;
  margin: 2px 0 6px;
}

.w2-vietqr-ref {
  text-align: center;
  color: #555;
  font-size: 14px;
  margin-bottom: 16px;
}

.w2-vietqr-order-box,
.w2-vietqr-bank-box {
  background: #f7f7f7;
  border: 1px solid #efefef;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}

.w2-vietqr-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
  line-height: 1.35;
  padding: 5px 0;
}

.w2-vietqr-row span {
  color: #777;
  flex: 0 0 auto;
}

.w2-vietqr-row strong {
  text-align: right;
  word-break: break-word;
}

.w2-vietqr-copy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.w2-vietqr-copy,
.w2-vietqr-bottom-back {
  appearance: none;
}

.w2-vietqr-copy {
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  cursor: pointer;
  height: 44px;
  padding: 0 16px;
  font-weight: 800;
  font-size: 13px;
  font-family: 'DM Sans', Arial, sans-serif;
}

.w2-vietqr-copy-wide {
  grid-column: 1 / -1;
}

.w2-vietqr-note {
  background: #fff8ec;
  border: 1px solid #f1d79b;
  border-radius: 16px;
  color: #8a5a00;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}

.w2-vietqr-loading,
.w2-vietqr-error {
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  padding: 28px 18px;
  text-align: center;
  color: #555;
  background: #fff;
  margin-bottom: 16px;
}

.w2-vietqr-error {
  border-color: #f4b7b7;
  background: #fff1f0;
  color: #9f1b1b;
}

.w2-vietqr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 100000;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font: 700 13px/1.2 'DM Sans', Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.w2-vietqr-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .w2-vietqr-modal-sheet {
    width: 100% !important;
    max-width: none !important;
  }

  .w2-vietqr-card {
    border-radius: 20px;
    padding: 16px;
  }

  .w2-vietqr-amount {
    font-size: 28px;
  }

  .w2-vietqr-copy-grid {
    grid-template-columns: 1fr;
  }

  .w2-vietqr-copy-wide {
    grid-column: auto;
  }
}

.w2-vietqr-local-note {
  display: inline-block;
  margin-top: 6px;
  color: #8a6d2f;
  font-size: 11px;
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────────
   "I paid" block (Stage 8b)
   Temporary customer-confirmation surface. Sits below the copy grid
   and above the bottom Back button. Three states tracked via
   data-w2-paid-state on the wrapper:
       idle       → button visible, no message
       submitting → button disabled, "Submitting…" message
       success    → button hidden, full success message
       error      → button re-enabled, error message in red
   ───────────────────────────────────────────────────────────────── */

.w2-vietqr-paid-block {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.w2-vietqr-i-paid {
  appearance: none;
  border: 0;
  border-radius: 999px;
  /* Gold accent — distinct from the black Copy buttons so it's the
     obvious primary action, but the same shape so the panel reads
     as one family. */
  background: linear-gradient(180deg, #f7b733, #e07b1a);
  color: #fff;
  height: 48px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: 'DM Sans', Arial, sans-serif;
  box-shadow: 0 10px 22px rgba(224, 123, 26, 0.25);
  transition: filter 0.15s ease, transform 0.05s ease;
}

.w2-vietqr-i-paid:hover { filter: brightness(1.05); }
.w2-vietqr-i-paid:active { transform: translateY(1px); }

.w2-vietqr-i-paid:disabled {
  cursor: progress;
  opacity: 0.7;
  box-shadow: none;
}

.w2-vietqr-paid-message {
  font-size: 13px;
  line-height: 1.45;
  color: #555;
  font-family: 'DM Sans', Arial, sans-serif;
  min-height: 0;
}

.w2-vietqr-paid-block[data-w2-paid-state="success"] .w2-vietqr-i-paid {
  display: none;
}
.w2-vietqr-paid-block[data-w2-paid-state="success"] .w2-vietqr-paid-message {
  color: #1f6b3a;
  font-weight: 700;
}
.w2-vietqr-paid-block[data-w2-paid-state="error"] .w2-vietqr-paid-message {
  color: #9f1b1b;
  font-weight: 700;
}
.w2-vietqr-paid-block[data-w2-paid-state="submitting"] .w2-vietqr-paid-message {
  color: #555;
}


.w2-vietqr-paid-box {
  margin: 14px 0 12px;
  border: 1px solid #111;
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  text-align: center;
}

.w2-vietqr-paid-btn {
  appearance: none;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  font: 900 14px/1 'DM Sans', Arial, sans-serif;
  cursor: pointer;
}

.w2-vietqr-paid-btn:disabled {
  cursor: default;
  opacity: .78;
}

.w2-vietqr-paid-message {
  margin-top: 10px;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}

.w2-vietqr-paid-box.is-success {
  border-color: #1a7f37;
  background: #f0fff4;
}

.w2-vietqr-paid-box.is-success .w2-vietqr-paid-message {
  color: #176b2c;
  font-weight: 700;
}

.w2-vietqr-paid-box.is-error {
  border-color: #ef9a9a;
  background: #fff5f5;
}

.w2-vietqr-paid-box.is-error .w2-vietqr-paid-message {
  color: #9f1b1b;
  font-weight: 700;
}


/* W2_VIETQR_STAGE1F_SAFE_FRONTEND_SYNC */
.w2-vietqr-paid-box {
  margin: 16px 0 14px;
  padding: 18px;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 18px;
  text-align: center;
  background: #fff;
}
.w2-vietqr-paid-title {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 8px;
}
.w2-vietqr-paid-message {
  color: rgba(0,0,0,.64);
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 12px;
}
.w2-vietqr-i-paid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb02e 0%, #ff8718 100%);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255,135,24,.24);
}
.w2-vietqr-i-paid:disabled {
  cursor: default;
  opacity: .72;
}
.w2-vietqr-paid-box.is-success {
  border-color: rgba(28,160,85,.35);
  background: rgba(28,160,85,.06);
}
.w2-vietqr-paid-box.is-success .w2-vietqr-paid-message { color: #166534; }
.w2-vietqr-paid-box.is-error {
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.06);
}
.w2-vietqr-paid-box.is-error .w2-vietqr-paid-message { color: #b91c1c; }
