/* Wavy Receipt — Purple · Gold · Black */
:root {
  --receipt-bg: #050508;
  --receipt-card: #101018;
  --receipt-card-inner: #0a0a10;
  --receipt-accent: #d4af37;
  --receipt-accent-light: #f0c14b;
  --receipt-accent-dark: #b8941f;
  --receipt-purple: #7c3aed;
  --receipt-purple-dark: #5b21b6;
  --receipt-purple-light: #a78bfa;
  --receipt-text: #f5f5fa;
  --receipt-muted: #9494a8;
  --receipt-success: #4ade80;
  --receipt-danger: #f87171;
  --receipt-border: rgba(124, 58, 237, 0.28);
  --receipt-border-gold: rgba(212, 175, 55, 0.3);
  --receipt-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.receipt-page {
  min-height: 100vh;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(ellipse 90% 60% at 15% -15%, rgba(124, 58, 237, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 5%, rgba(212, 175, 55, 0.1), transparent 50%),
    var(--receipt-bg);
  background-attachment: fixed;
  color: var(--receipt-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  -webkit-font-smoothing: antialiased;
}

.receipt-wrap { width: min(440px, 100%); }

.receipt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  justify-content: center;
}

.receipt-brand img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(124, 58, 237, 0.35));
}

.receipt-brand span {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--receipt-accent-light), var(--receipt-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.06em;
}

.receipt {
  background: linear-gradient(165deg, var(--receipt-card) 0%, var(--receipt-card-inner) 100%);
  border: 1px solid var(--receipt-border-gold);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(124, 58, 237, 0.1);
  position: relative;
}

.receipt::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--receipt-purple), var(--receipt-accent), var(--receipt-purple-dark));
}

.receipt-icon.warning {
  background: rgba(212, 175, 55, 0.12);
  border: 2px solid var(--receipt-accent);
}

/* Success receipt page — gold/green accent */
body.receipt-page--success .receipt {
  border-color: var(--receipt-border-gold);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(74, 222, 128, 0.08);
}

body.receipt-page--success .receipt::before {
  background: linear-gradient(90deg, var(--receipt-success), var(--receipt-accent), var(--receipt-purple));
}

body.receipt-page--success .receipt-amount-block {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.08) 0%, rgba(212, 175, 55, 0.06) 100%);
}

body.receipt-page--success .receipt-status-bar h1 {
  color: var(--receipt-text);
}

/* Failed receipt page — red accent */
body.receipt-page--failed .receipt {
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(248, 113, 113, 0.1);
}

body.receipt-page--failed .receipt::before {
  background: linear-gradient(90deg, var(--receipt-danger), #991b1b, var(--receipt-purple-dark));
}

body.receipt-page--failed .receipt-amount-block {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.1) 0%, rgba(124, 58, 237, 0.04) 100%);
}

body.receipt-page--failed .receipt-status-bar h1 {
  color: #fca5a5;
}

body.receipt-page--failed .receipt-amount {
  background: linear-gradient(135deg, #fca5a5, var(--receipt-danger));
  -webkit-background-clip: text;
  background-clip: text;
}

.receipt-help-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--receipt-accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.receipt-help-link:hover { text-decoration: underline; }

.receipt-btn.danger {
  background: linear-gradient(135deg, #fca5a5, var(--receipt-danger));
  color: #1a0505;
  border: none;
}

.receipt-status-bar {
  padding: 32px 24px 22px;
  text-align: center;
  border-bottom: 1px dashed rgba(124, 58, 237, 0.18);
}

.receipt-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-size: 1.85rem;
  animation: receiptPop 0.5s var(--receipt-ease);
}

.receipt-icon.success {
  background: rgba(74, 222, 128, 0.12);
  border: 2px solid var(--receipt-success);
  box-shadow: 0 0 24px rgba(74, 222, 128, 0.15);
}

.receipt-icon.pending {
  background: rgba(124, 58, 237, 0.12);
  border: 2px solid var(--receipt-purple);
  animation: receiptPop 0.5s var(--receipt-ease), receiptPulse 2.2s ease infinite 0.5s;
}

.receipt-icon.failed {
  background: rgba(248, 113, 113, 0.12);
  border: 2px solid var(--receipt-danger);
}

@keyframes receiptPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes receiptPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.35); }
  50% { box-shadow: 0 0 0 14px rgba(124, 58, 237, 0); }
}

.receipt-status-bar h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.receipt-status-bar p {
  color: var(--receipt-muted);
  font-size: 0.875rem;
}

.receipt-amount-block {
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, rgba(212, 175, 55, 0.04) 100%);
}

.receipt-amount-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--receipt-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.receipt-amount {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--receipt-accent-light), var(--receipt-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.receipt-body { padding: 22px 24px; display: grid; gap: 0; }

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  font-size: 0.875rem;
  gap: 16px;
}

.receipt-row:last-child { border-bottom: none; }
.receipt-row .label { color: var(--receipt-muted); flex-shrink: 0; }
.receipt-row .value { font-weight: 600; text-align: right; word-break: break-all; color: var(--receipt-text); }
.receipt-row.highlight .value { color: var(--receipt-accent); }

.receipt-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.receipt-status-badge.success { background: rgba(74, 222, 128, 0.15); color: var(--receipt-success); }
.receipt-status-badge.pending { background: rgba(124, 58, 237, 0.18); color: var(--receipt-purple-light); }
.receipt-status-badge.failed { background: rgba(248, 113, 113, 0.15); color: var(--receipt-danger); }

.receipt-footer { padding: 22px 24px 26px; display: grid; gap: 10px; }

.receipt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.15s var(--receipt-ease), box-shadow 0.15s;
  font-family: inherit;
}

.receipt-btn:hover { transform: translateY(-1px); }
.receipt-btn:active { transform: scale(0.98); }

.receipt-btn.primary {
  background: linear-gradient(135deg, var(--receipt-accent-light), var(--receipt-accent));
  color: #050508;
  box-shadow: 0 8px 28px rgba(212, 175, 55, 0.28);
}

.receipt-btn.primary:hover { box-shadow: 0 12px 36px rgba(212, 175, 55, 0.38); }

.receipt-btn.ghost {
  background: rgba(124, 58, 237, 0.1);
  color: var(--receipt-text);
  border: 1px solid var(--receipt-border);
}

.receipt-btn.ghost:hover {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--receipt-purple-light);
}

.receipt-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--receipt-muted);
  margin-top: 16px;
  line-height: 1.55;
}

.receipt-watermark {
  text-align: center;
  padding: 14px;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 1px solid rgba(124, 58, 237, 0.08);
}

@media print {
  body.receipt-page { background: white; padding: 0; }
  .receipt { box-shadow: none; border: 1px solid #ddd; }
  .receipt-footer { display: none; }
  .receipt-note { display: none; }
  .receipt-amount {
    -webkit-text-fill-color: var(--receipt-accent);
    color: var(--receipt-accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt-icon { animation: none; }
}

/* Payment timeline */
.receipt-timeline {
  padding: 20px 24px 8px;
  border-top: 1px dashed rgba(124, 58, 237, 0.18);
}

.receipt-timeline h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  color: var(--receipt-accent-light);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 20px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--receipt-purple), var(--receipt-accent));
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  padding: 0 0 14px 16px;
  font-size: 0.8rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--receipt-card);
  border: 2px solid var(--receipt-purple-light);
}

.timeline-item.done::before {
  background: var(--receipt-accent);
  border-color: var(--receipt-accent);
}

.timeline-item.active::before {
  background: var(--receipt-purple);
  border-color: var(--receipt-purple-light);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
}

.timeline-item .tl-label {
  color: var(--receipt-text);
  font-weight: 600;
  display: block;
}

.timeline-item .tl-time {
  color: var(--receipt-muted);
  font-size: 0.72rem;
  margin-top: 2px;
}

.receipt-row .value.desc {
  font-size: 0.8rem;
  max-width: 200px;
}

.receipt-btn.saved,
.receipt-btn:disabled {
  opacity: 0.75;
  cursor: default;
  transform: none;
}

.receipt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.receipt-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--receipt-border);
  background: transparent;
  color: var(--receipt-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.receipt-tab.active {
  border-color: var(--receipt-accent);
  color: var(--receipt-accent);
  background: rgba(212, 175, 55, 0.08);
}

.receipt-list { display: grid; gap: 12px; }

.receipt-list-card {
  background: linear-gradient(165deg, var(--receipt-card) 0%, var(--receipt-card-inner) 100%);
  border: 1px solid var(--receipt-border-gold);
  border-radius: 16px;
  padding: 18px 20px;
}

.rl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rl-amount {
  font-weight: 700;
  color: var(--receipt-accent);
  font-size: 1.1rem;
}

.rl-desc { font-weight: 600; margin-bottom: 4px; }

.rl-meta {
  font-size: 0.8rem;
  color: var(--receipt-muted);
  margin-bottom: 12px;
}

.rl-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.rl-remove {
  color: var(--receipt-danger) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

.receipt-empty {
  text-align: center;
  color: var(--receipt-muted);
  padding: 32px 16px;
  font-size: 0.9rem;
}

.wavy-btn-sm {
  padding: 8px 14px !important;
  font-size: 0.8rem !important;
}
