/* Paying in crypto inside MiTi (crypto-h2h.js): the coin list and the payment window.
   Colours come from the active theme (--card-bg, --card-border, --accent-neon, --text-main, --text-muted), so every
   design — dark, light and the seasonal ones — repaints these screens like the rest of the site. The QR code stays
   black on white and the Trybit mark on its light chip: scanners and Trybit's brand guide need them as they are. */

.crypto-h2h {
  --h2h-line: var(--card-border, rgba(190, 160, 255, 0.3));
  --h2h-accent: var(--accent-neon, #c084fc);
  --h2h-text: var(--text-main, #f3e8ff);
  --h2h-dim: var(--text-muted, #a855f7);
  --h2h-surface: rgba(255, 255, 255, 0.05);
  --h2h-surface-hover: rgba(190, 160, 255, 0.12);
  --h2h-ok: #8fe3b0;
  --h2h-warn: #ffd27a;
  --h2h-error: #ff8fa3;
}

@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .crypto-h2h {
    --h2h-surface: color-mix(in srgb, var(--h2h-text) 6%, transparent);
    --h2h-surface-hover: color-mix(in srgb, var(--h2h-accent) 16%, transparent);
  }
}

body.theme-light .crypto-h2h {
  --h2h-ok: #18794e;
  --h2h-warn: #9a5b00;
  --h2h-error: #b4233c;
}

.crypto-h2h .miti-confirm-card {
  max-width: 560px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  color: var(--h2h-text);
}

.crypto-h2h-coins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.crypto-h2h .crypto-h2h-coin {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--h2h-line);
  background: var(--h2h-surface);
  color: var(--h2h-text);
  font: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.crypto-h2h .crypto-h2h-coin:hover,
.crypto-h2h .crypto-h2h-coin:focus-visible {
  border-color: var(--h2h-accent);
  background: var(--h2h-surface-hover);
  outline: none;
}

.crypto-h2h-coin-icon {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.crypto-h2h-coin-icon img {
  width: 32px;
  height: 32px;
  display: block;
}

.crypto-h2h-coin-icon .crypto-h2h-coin-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--h2h-line);
}

.crypto-h2h-coin-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.crypto-h2h-coin-text b {
  color: var(--h2h-text);
}

.crypto-h2h-coin-text small {
  color: var(--h2h-dim);
  font-size: 12px;
}

.crypto-h2h-resume {
  width: 100%;
  margin: 6px 0 2px;
}

.crypto-h2h-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 10px 0 4px;
}

.crypto-h2h-brand small {
  flex: 1 1 200px;
  color: var(--h2h-dim);
  font-size: 12px;
  line-height: 1.5;
}

.crypto-h2h-brand a {
  color: var(--h2h-accent);
}

.crypto-h2h-brand .trybit-mark {
  margin: 0;
}

.crypto-h2h-pay {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  align-items: start;
  margin: 10px 0;
}

/* Always black on white: a themed QR code may not scan. */
.crypto-h2h-qr {
  width: 170px;
  height: 170px;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--h2h-line);
}

.crypto-h2h-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.crypto-h2h-pay-noaddress {
  grid-template-columns: 1fr;
}

.crypto-h2h-fields {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.crypto-h2h-field > span {
  display: block;
  font-size: 12px;
  color: var(--h2h-dim);
  margin-bottom: 3px;
}

.crypto-h2h-field > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  color: var(--h2h-text);
}

.crypto-h2h-field small {
  color: var(--h2h-dim);
}

.crypto-h2h .crypto-h2h-field button {
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
  flex: 0 0 auto;
}

.crypto-h2h-amount {
  font-size: 20px;
  color: var(--h2h-text);
}

.crypto-h2h-address {
  font-size: 13px;
  word-break: break-all;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--h2h-line);
  background: var(--h2h-surface);
  color: var(--h2h-text);
  user-select: all;
}

.crypto-h2h-inline-icon {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  margin-right: 6px;
}

.crypto-h2h-status {
  margin: 8px 0 2px;
  font-weight: 600;
  color: var(--h2h-text);
}

.crypto-h2h-status[data-kind="ok"] {
  color: var(--h2h-ok);
}

.crypto-h2h-status[data-kind="warn"] {
  color: var(--h2h-warn);
}

.crypto-h2h-status[data-kind="error"] {
  color: var(--h2h-error);
}

.crypto-h2h-timer {
  margin: 2px 0 6px;
  font-size: 14px;
  color: var(--h2h-text);
}

.crypto-h2h-timer b {
  color: var(--h2h-accent);
}

.crypto-h2h-rules {
  margin: 6px 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--h2h-text);
}

.crypto-h2h-rules b {
  color: var(--h2h-accent);
}

.crypto-h2h-test {
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid currentColor;
  color: var(--h2h-warn);
  font-size: 13px;
}

/* The donation amount field in tribute-pay.js. */
.crypto-donate-own {
  display: block;
  margin: 14px 0 4px;
  color: var(--text-main, inherit);
}

.crypto-donate-own input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border, rgba(160, 140, 220, 0.45));
  background: color-mix(in srgb, var(--text-main, #fff) 7%, transparent);
  color: var(--text-main, inherit);
  font: inherit;
}

.crypto-donate-own input:focus {
  outline: none;
  border-color: var(--accent-neon, #c084fc);
}

body.theme-light .crypto-donate-own input {
  background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 520px) {
  .crypto-h2h-pay {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .crypto-h2h-fields {
    width: 100%;
  }

  .crypto-h2h-coins {
    grid-template-columns: 1fr;
  }
}
