/* ChainerTX payment page white-label */

html[data-ctx-page="payments"] {
  --ctx-canvas: #f5f5ed;
  --ctx-paper: #fffef8;
  --ctx-ink: #11140f;
  --ctx-muted: #62675d;
  --ctx-line: #171a15;
  --ctx-green: #b7ff63;
  --ctx-green-soft: #e8fbd1;
  --ctx-forest: #153d2b;

  --pr-accent: var(--ctx-green) !important;
  --pr-accent-hover: #a5ed4d !important;
  --pr-accent-soft: #b7ff6329 !important;
  --pr-bg: var(--ctx-canvas) !important;
  --pr-bg-subtle: #f9f9f2 !important;
  --pr-border: var(--ctx-line) !important;
  --pr-border-strong: var(--ctx-line) !important;
  --pr-border-subtle: #171a1526 !important;
  --pr-primary: var(--ctx-forest) !important;
  --pr-primary-hover: #0e2f20 !important;
  --pr-primary-soft: #e8fbd1 !important;
  --pr-surface: var(--ctx-paper) !important;
  --pr-surface-raised: var(--ctx-paper) !important;
  --pr-surface-sunken: #f1f2e8 !important;
  --pr-text: var(--ctx-ink) !important;
  --pr-text-secondary: #3f453c !important;
  --pr-text-muted: var(--ctx-muted) !important;
  --pr-radius-2xl: 14px !important;
  --pr-radius-xl: 12px !important;
  --pr-radius-lg: 10px !important;
  --pr-radius-md: 8px !important;
}

html[data-ctx-page="payments"],
html[data-ctx-page="payments"] body,
html[data-ctx-page="payments"] .payments-surface {
  background-color: var(--ctx-canvas) !important;
  color: var(--ctx-ink) !important;
}

html[data-ctx-page="payments"],
html[data-ctx-page="payments"] body {
  overflow-x: hidden !important;
}

html[data-ctx-page="payments"] .payments-surface {
  background-image: radial-gradient(rgba(17, 20, 15, 0.1) 0.7px, transparent 0.7px) !important;
  background-size: 15px 15px !important;
  font-family: "Manrope", "Inter", Arial, sans-serif !important;
}

/* Keep uploaded merchant marks intact. */
img[src*="/uploads/"] {
  display: inline-block !important;
  height: auto !important;
  max-height: none;
  opacity: 1 !important;
  visibility: visible !important;
  width: auto !important;
}

/* Remove PayRam-owned marks while preserving project uploads. */
button.group.flex.items-center.gap-2:has(img[alt="PayRam"]),
a[href*="payram.com"],
img[alt="PayRam"]:not([src*="/uploads/"]) {
  display: none !important;
}

html[data-ctx-page="dashboard"] #chainertx-pay-footer,
html[data-ctx-page="dashboard"] .ctx-pay-footer,
html[data-ctx-page="dashboard"] .ctx-expire-timer {
  display: none !important;
}

html[data-ctx-page="payments"] img[src*="payram-p-icon"]:not([src*="/uploads/"]) {
  height: 0 !important;
  opacity: 0 !important;
  width: 0 !important;
}

/* Wider editorial canvas, still compact enough to keep payment information together. */
html[data-ctx-page="payments"] .w-full.max-w-\[480px\].lg\:max-w-\[860px\] {
  max-width: 940px !important;
}

/* Testnet notice */
html[data-ctx-page="payments"] .flex.items-center.gap-2\.5.bg-pr-warning-soft {
  background: #fff5d8 !important;
  border: 1.5px solid var(--ctx-line) !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 0 var(--ctx-line) !important;
  color: #5c4716 !important;
  margin-bottom: 18px !important;
}

html[data-ctx-page="payments"] .flex.items-center.gap-2\.5.bg-pr-warning-soft button {
  color: var(--ctx-ink) !important;
  font-weight: 750 !important;
  text-decoration-color: var(--ctx-ink) !important;
}

/* Main checkout columns */
html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] {
  gap: 26px !important;
  grid-template-columns: 380px minmax(0, 1fr) !important;
}

html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :first-child {
  background: var(--ctx-paper) !important;
  border: 1.5px solid var(--ctx-line) !important;
  border-radius: 14px !important;
  box-shadow: 0 5px 0 var(--ctx-line) !important;
}

html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :last-child {
  background: var(--ctx-green-soft) !important;
  border: 1.5px solid var(--ctx-line) !important;
  border-radius: 14px !important;
  box-shadow: 0 5px 0 var(--ctx-line) !important;
  padding: 12px !important;
}

/* Inner action cards */
html[data-ctx-page="payments"] .rounded-2xl.border.border-pr-border.bg-pr-surface {
  background: var(--ctx-paper) !important;
  border: 1.5px solid var(--ctx-line) !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 0 var(--ctx-line) !important;
}

html[data-ctx-page="payments"] .rounded-2xl.border.border-pr-border.bg-pr-surface h3 {
  color: var(--ctx-muted) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
}

html[data-ctx-page="payments"] .rounded-2xl.border.border-pr-border.bg-pr-surface button {
  min-height: 54px !important;
}

html[data-ctx-page="payments"] .rounded-2xl.border.border-pr-border.bg-pr-surface button:hover,
html[data-ctx-page="payments"] .rounded-2xl.border.border-pr-border.bg-pr-surface button:focus-visible {
  background: var(--ctx-green-soft) !important;
}

html[data-ctx-page="payments"] .rounded-2xl.border.border-pr-border.bg-pr-surface button:active {
  background: var(--ctx-green) !important;
}

html[data-ctx-page="payments"] .text-brand-purple {
  color: var(--ctx-forest) !important;
}

/* Merchant and amount card */
html[data-ctx-page="payments"] .text-\[28px\].font-black {
  color: var(--ctx-ink) !important;
  font-family: "Space Grotesk", "Manrope", Arial, sans-serif !important;
  font-size: 31px !important;
  letter-spacing: -0.045em !important;
}

html[data-ctx-page="payments"] .font-semibold.text-pr-text.truncate {
  color: var(--ctx-ink) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
}

html[data-ctx-page="payments"] .flex.flex-col.gap-2\.5.rounded-pr-md.bg-pr-primary-soft\/60 {
  background: var(--ctx-green-soft) !important;
  border: 1px solid #153d2b33 !important;
  border-radius: 8px !important;
  color: var(--ctx-forest) !important;
}

html[data-ctx-page="payments"] .border-dashed.border-pr-border {
  border-color: #171a1540 !important;
}

/* Expiry badge */
html[data-ctx-page="payments"] .ctx-expire-timer {
  align-items: center !important;
  background: var(--ctx-green) !important;
  border: 1px solid var(--ctx-line) !important;
  border-radius: 7px !important;
  box-shadow: 0 2px 0 var(--ctx-line) !important;
  color: var(--ctx-ink) !important;
  display: inline-flex !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  gap: 5px !important;
  justify-content: flex-end !important;
  line-height: 1 !important;
  margin: 0 0 9px auto !important;
  max-width: 100% !important;
  padding: 6px 9px !important;
  position: relative !important;
  width: fit-content !important;
}

html[data-ctx-page="payments"] .text-right.shrink-0 {
  align-items: flex-end !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

html[data-ctx-page="payments"] .ctx-expire-timer__label,
html[data-ctx-page="payments"] .ctx-expire-timer__value {
  color: var(--ctx-ink) !important;
  font-size: 11px !important;
}

html[data-ctx-page="payments"] .ctx-expire-timer__label {
  font-weight: 600 !important;
}

html[data-ctx-page="payments"] .ctx-expire-timer__value {
  font-variant-numeric: tabular-nums !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
}

html[data-ctx-page="payments"] .ctx-expire-timer.is-expired {
  background: #ffd9d5 !important;
}

/* Secondary actions */
html[data-ctx-page="payments"] button.w-full.text-center.text-\[12px\] {
  color: var(--ctx-forest) !important;
  font-weight: 750 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* Branded footer */
html[data-ctx-page="payments"] footer.ctx-pay-footer,
html[data-ctx-page="payments"] #chainertx-pay-footer {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  bottom: auto !important;
  box-shadow: none !important;
  display: block !important;
  left: auto !important;
  margin: 22px 16px 30px !important;
  max-width: none !important;
  padding: 5px 1px !important;
  pointer-events: auto !important;
  position: relative !important;
  right: auto !important;
  top: auto !important;
  width: auto !important;
  z-index: 1 !important;
}

.ctx-pay-footer__inner {
  align-items: center !important;
  display: flex !important;
  gap: 16px !important;
  justify-content: space-between !important;
  width: 100% !important;
}

.ctx-pay-footer__brand {
  align-items: center !important;
  display: inline-flex !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.ctx-pay-footer__powered {
  color: var(--ctx-muted) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
}

.ctx-pay-footer__mark {
  align-items: center !important;
  display: inline-flex !important;
  flex-shrink: 0 !important;
  height: 20px !important;
  justify-content: center !important;
  line-height: 0 !important;
  width: 20px !important;
}

.ctx-pay-footer__mark svg {
  height: 20px !important;
  width: 20px !important;
}

.ctx-pay-footer__name {
  color: var(--ctx-ink) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1 !important;
}

.ctx-pay-footer__agreement {
  background: transparent !important;
  border-radius: 0 !important;
  color: var(--ctx-forest) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  padding: 0 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  white-space: nowrap !important;
}

.ctx-pay-footer__agreement:hover {
  color: var(--ctx-ink) !important;
}

@media (min-width: 1024px) {
  html[data-ctx-page="payments"] footer.ctx-pay-footer,
  html[data-ctx-page="payments"] #chainertx-pay-footer {
    margin: 22px 0 34px !important;
    padding: 5px 0 !important;
  }
}

@media (max-width: 1023px) {
  html[data-ctx-page="payments"] .w-full.max-w-\[480px\].lg\:max-w-\[860px\] {
    max-width: 520px !important;
  }

  html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :first-child,
  html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :last-child {
    border-left: 1.5px solid var(--ctx-line) !important;
    border-right: 1.5px solid var(--ctx-line) !important;
  }

  html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :last-child {
    margin-top: 18px !important;
  }
}

@media (max-width: 540px) {
  html[data-ctx-page="payments"] .payments-surface {
    background-image: none !important;
  }

  html[data-ctx-page="payments"] .flex.items-center.gap-2\.5.bg-pr-warning-soft {
    margin-inline: 12px !important;
  }

  html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] {
    padding-inline: 12px !important;
  }

  html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :first-child,
  html[data-ctx-page="payments"] [class*="lg:grid-cols-[360px_1fr]"] > :last-child {
    box-shadow: 0 4px 0 var(--ctx-line) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-ctx-page="payments"] *,
  html[data-ctx-page="payments"] *::before,
  html[data-ctx-page="payments"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
