/* Merchant Hosted — shared UI (Pay + QR + Payment-info + Return) */
:root {
  --mh-accent: #0052cc;
  --mh-accent-dark: #003d99;
  --mh-accent-soft: #e8f0ff;
  --mh-success: #0f9d58;
  --mh-success-bg: #e6f4ea;
  --mh-danger: #d93025;
  --mh-danger-bg: #fde7e9;
  --mh-radius: 16px;
  --mh-radius-sm: 12px;
  --mh-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.mh-page-shell {
  max-width: 960px;
  margin: 0 auto;
}

.mh-page-shell > .demo-nav {
  margin-bottom: 0.75rem !important;
}

/* Một khối header duy nhất */
.mh-page-head {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e9ecef);
  border-radius: var(--mh-radius-sm);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  margin-bottom: 1rem;
  overflow: hidden;
}

/* Sub-navigation tabs */
.mh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border, #e9ecef);
  border-radius: 0;
  box-shadow: none;
}

.mh-tabs a {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: background 0.2s var(--mh-ease), color 0.2s var(--mh-ease);
}

.mh-tabs a:hover {
  color: var(--mh-accent);
  background: #f0f5ff;
}

.mh-tabs a.active {
  color: var(--mh-accent);
  background: var(--mh-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 82, 204, 0.15);
}

@media (max-width: 576px) {
  .mh-tabs a {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

/* Tiêu đề trang (trong page-head) */
.mh-page-title {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid transparent;
}

.mh-page-title h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  margin: 0 0 0.2rem;
  color: #0f172a;
}

.mh-page-title p {
  color: var(--muted, #6c757d);
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.mh-page-title code {
  font-size: 0.8em;
  color: #475569;
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Stepper — dùng div, không dùng ol để tránh số thừa */
.mh-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0.75rem 0.5rem 0.5rem;
  list-style: none;
  border-bottom: 1px solid #f1f5f9;
}

.mh-step {
  flex: 1;
  max-width: 120px;
  text-align: center;
  position: relative;
}

.mh-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 12px;
  left: calc(50% + 14px);
  width: calc(100% - 28px);
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

.mh-step.done:not(:last-child)::after {
  background: var(--mh-accent);
}

.mh-step-dot {
  width: 24px;
  height: 24px;
  margin: 0 auto 0.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #e2e8f0;
  position: relative;
  z-index: 1;
  transition: all 0.25s var(--mh-ease);
}

.mh-step.active .mh-step-dot {
  background: var(--mh-accent);
  color: #fff;
  border-color: var(--mh-accent);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.35);
}

.mh-step.done .mh-step-dot {
  background: var(--mh-accent-soft);
  color: var(--mh-accent);
  border-color: var(--mh-accent);
}

.mh-step-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.2;
}

.mh-step.active .mh-step-label,
.mh-step.done .mh-step-label {
  color: #475569;
}

@media (max-width: 520px) {
  .mh-step-label {
    font-size: 0.6rem;
  }
  .mh-step {
    max-width: 72px;
  }
}

/* Form */
.mh-form-section {
  font-weight: 600;
  color: var(--mh-accent);
  border-left: 3px solid var(--mh-accent);
  padding-left: 0.65rem;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.92rem;
}

.mh-form .form-control,
.mh-form .form-select {
  border-radius: 10px;
  padding: 0.62rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mh-form .form-control:focus,
.mh-form .form-select:focus {
  border-color: var(--mh-accent);
  box-shadow: 0 0 0 0.2rem rgba(0, 82, 204, 0.12);
}

.mh-form .form-text {
  font-size: 0.8rem;
  color: #6c757d;
}

.mh-form .input-group .form-control {
  border-radius: 10px 0 0 10px;
}

.mh-form .input-group .btn {
  border-radius: 0 10px 10px 0;
}

.mh-demo-bar {
  background: linear-gradient(135deg, #f0f5ff 0%, #f8fafc 100%);
  border: 1px solid #d0ddff;
  border-radius: var(--mh-radius-sm);
  padding: 0.85rem 1rem;
}

.mh-chip {
  border: 1px solid #c5d5f8;
  background: #fff;
  color: #2a4dbf;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.mh-chip:hover {
  background: var(--mh-accent-soft);
  border-color: var(--mh-accent);
  color: var(--mh-accent-dark);
}

.mh-chip:active {
  transform: scale(0.97);
}

.mh-quick-amount {
  min-width: 88px;
  border-radius: 999px !important;
  font-size: 0.82rem;
}

.mh-accordion .accordion-item {
  border: 1px solid var(--border, #e9ecef);
  border-radius: var(--mh-radius-sm) !important;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.mh-accordion .accordion-button {
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
  background: #f8fafc;
  box-shadow: none;
}

.mh-accordion .accordion-button:not(.collapsed) {
  color: var(--mh-accent);
  background: var(--mh-accent-soft);
}

.mh-accordion .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}

/* Result pages */
.mh-result-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.mh-result-icon.success {
  background: var(--mh-success-bg);
  color: var(--mh-success);
}

.mh-result-icon.fail {
  background: var(--mh-danger-bg);
  color: var(--mh-danger);
}

.mh-status-badge {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.mh-status-badge.ok {
  background: var(--mh-success-bg);
  color: var(--mh-success);
}

.mh-status-badge.fail {
  background: var(--mh-danger-bg);
  color: var(--mh-danger);
}

.mh-result-table th {
  width: 38%;
  background: #f7f9fc;
  font-weight: 600;
  color: #495057;
  font-size: 0.88rem;
}

.mh-result-table td {
  word-break: break-all;
  font-size: 0.9rem;
}

.mh-info-card {
  background: #f8fafc;
  border: 1px dashed #d7e3ff;
  border-radius: var(--mh-radius-sm);
  padding: 1rem;
}

.mh-cta-primary {
  border-radius: 12px;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
}

/* Animations */
@keyframes mhFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.mh-fade-in {
  animation: mhFadeUp 0.45s var(--mh-ease) both;
}

@keyframes mhPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 82, 204, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(0, 82, 204, 0); }
}

.mh-pulse-cta {
  animation: mhPulse 2s ease infinite;
}

/* QR-specific */
.mh-qr-pay-card { overflow: hidden; }

.mh-qr-pay-head {
  background: linear-gradient(135deg, #e8f0ff 0%, #f6f9ff 100%);
  border-bottom: 1px solid var(--border, #e9ecef);
  padding: 1rem 1rem 0.85rem;
}

.mh-qr-pay-head .mh-brand-logo {
  margin-bottom: 0;
}

.mh-qr-box {
  display: inline-block;
  padding: 14px;
  border: 2px solid #0b3d91;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(11, 61, 145, 0.1);
}

.mh-qr-box canvas,
.mh-qr-box img {
  display: block;
  border-radius: 4px;
}

.mh-scan-caption {
  color: #0b3d91;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-top: 0.6rem;
}

.mh-qr-expire {
  color: var(--mh-danger);
  font-weight: 600;
}

.mh-order-summary {
  border: 1px solid var(--border, #e9ecef);
  border-radius: var(--mh-radius-sm);
  padding: 0.9rem 1rem;
  background: #fbfcfe;
}

.mh-order-summary .row-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
}

.mh-order-summary .row-line + .row-line {
  border-top: 1px dashed #eef1f6;
}

.mh-order-summary .row-line span {
  color: var(--muted, #6c757d);
  font-size: 0.88rem;
}

.mh-order-summary .row-line strong {
  text-align: right;
  word-break: break-word;
  font-size: 0.9rem;
}

.mh-order-summary .amount-row strong {
  color: var(--mh-danger);
  font-size: 1.15rem;
}

.mh-bank-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 400px) {
  .mh-bank-grid { grid-template-columns: repeat(3, 1fr); }
}

.mh-bank-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--border, #e9ecef);
  border-radius: 10px;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.mh-bank-cell:hover {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
  border-color: #cdd9f0;
}

.mh-bank-cell img {
  max-height: 30px;
  max-width: 100%;
  object-fit: contain;
}

.mh-bank-chip {
  font-size: 0.7rem;
  color: #374151;
  text-align: center;
  line-height: 1.1;
}

.mh-bank-skeleton {
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f1f4f9 25%, #e7ecf4 37%, #f1f4f9 63%);
  background-size: 400% 100%;
  animation: mhShimmer 1.3s ease infinite;
}

@keyframes mhShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.mh-mono {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

/* Footer actions */
.mh-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.mh-footer-actions .btn {
  border-radius: 10px;
  min-width: 140px;
}

/* Payment-info picker */
.mh-config-picker {
  border: 1px solid var(--border, #e9ecef);
  border-radius: var(--mh-radius-sm);
  padding: 1rem;
  background: #fff;
}

.mh-config-picker .form-select {
  border-radius: 10px;
}

/* Brand logo */
.mh-brand-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.mh-brand-logo img {
  width: 90px;
  height: auto;
  display: inline-block;
}

.mh-brand-logo-sm img {
  width: 72px;
}


.mh-qr-success-wrap {
  max-width: 720px;
  margin: 0 auto;
}

/* QR form — full width, cân đối với trang Pay */
.mh-qr-form-card .mh-form-section {
  margin-top: 0.5rem;
}

.mh-qr-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

@media (min-width: 768px) {
  .mh-qr-body {
    padding: 1.5rem 2rem 2rem;
  }
}
