/* Receipt (TransactionReceiptView.swift): a paper slip. Its colours are fixed, like printed paper, so it reads the same
   in dark mode and when printed. */

.page.receipt {
  min-height: 100vh;
  background: var(--rc-backdrop);
}
.rc-content {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.rc-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

/* The slip: the top half has rounded corners, both halves have round notches where they meet, the bottom a torn edge */
.rc-slip {
  width: 100%;
  color: #16171b;
  filter: drop-shadow(0 10px 18px rgba(23, 32, 51, 0.1));
}
.rc-top,
.rc-bottom {
  position: relative;
  background: #fff;
  -webkit-mask: radial-gradient(circle 11px at 0 var(--notch-y), transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 11px at 100% var(--notch-y), transparent 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 11px at 0 var(--notch-y), transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 11px at 100% var(--notch-y), transparent 98%, #000) right / 51% 100% no-repeat;
}
.rc-top {
  --notch-y: 100%;
  padding: 22px 22px 24px;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.rc-bottom {
  --notch-y: 0%;
  padding: 0 0 22px;
}
.rc-bottom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 6px;
  background: linear-gradient(45deg, #fff 50%, transparent 50%) 0 0 / 12px 12px,
    linear-gradient(-45deg, #fff 50%, transparent 50%) 0 0 / 12px 12px;
  background-position: 0 -6px;
}
.rc-brand {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rc-brand img {
  height: 22px;
  width: auto;
}
.rc-word {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #6f7480;
}
.rc-outcome {
  width: 60px;
  height: 60px;
  margin-top: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.rc-outcome.is-successful,
.rc-status.is-successful {
  color: #16824f;
  background: #e4f7ec;
}
.rc-outcome.is-pending,
.rc-status.is-pending {
  color: #a86a06;
  background: #fff4dc;
}
.rc-outcome.is-failed,
.rc-status.is-failed {
  color: #c2364d;
  background: #ffe9ec;
}
.rc-title {
  padding-top: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
}
.rc-amount {
  padding-top: 4px;
  max-width: 100%;
  font-family: 'Outfit', sans-serif;
  font-size: clamp(22px, 8vw, 32px);
  font-weight: 600;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-amount.is-failed {
  color: #6f7480;
  text-decoration: line-through;
}
.rc-status {
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}
.rc-date {
  padding-top: 10px;
  font-size: 13px;
  color: #6f7480;
}
.rc-perforation {
  margin: 0 15px;
  height: 1.5px;
  background: repeating-linear-gradient(90deg, #e3e6ec 0 5px, transparent 5px 9px);
}
.rc-lines {
  padding: 8px 22px 0;
}
.rc-line {
  padding: 12px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.rc-line + .rc-line {
  border-top: 1px solid #e3e6ec;
}
.rc-line dt {
  flex: none;
  color: #6f7480;
}
.rc-line dd {
  min-width: 0;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}
.rc-line dd.is-copyable {
  user-select: all;
  -webkit-user-select: all;
}
.rc-note {
  margin: 8px 22px 0;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.5;
  color: #6f7480;
  background: #f5f6f9;
}
.rc-foot {
  padding: 20px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  font-size: 11px;
  color: #6f7480;
}
.rc-foot .rc-thanks {
  font-size: 12px;
  font-weight: 600;
  color: #16171b;
}

/* Buttons under the slip */
.rc-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rc-primary,
.rc-secondary {
  min-height: 52px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}
.rc-primary {
  color: #fff;
  background: var(--auth-button);
}
.rc-secondary {
  color: var(--text);
  border: 1px solid var(--rc-button-line);
}
.rc-help {
  max-width: 300px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--act-muted);
}

/* Printing / Save as PDF: just the slip */
@media print {
  @page {
    margin: 16mm;
  }
  body {
    background: #fff !important;
  }
  .side-nav,
  .bottom-nav,
  .page-header,
  .rc-actions,
  .rc-help,
  .toast {
    display: none !important;
  }
  .shell,
  .app {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .page.receipt {
    min-height: 0;
    background: #fff;
  }
  .rc-content {
    padding: 0;
  }
  .rc-slip {
    filter: none;
    border: 1px solid #e3e6ec;
    border-radius: 20px;
  }
  .rc-top,
  .rc-bottom {
    -webkit-mask: none;
    mask: none;
  }
  .rc-bottom::after {
    display: none;
  }
}
