@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600;700&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --bg: #0C0C0E;
  --bg-card: rgba(255,255,255,0.04);
  --accent: #C9963A;
  --accent-glow: rgba(201,150,58,0.25);
  --text: #F0EDE6;
  --text-muted: rgba(240,237,230,0.5);
  --border: rgba(201,150,58,0.2);
  --error: #E74C3C;
  --success: #27AE60;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

body > * {
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

/* Glass Card */
.glass-card {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
}

/* Section Labels */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Amount Preset Grid */
.amount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.amount-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.amount-btn:hover {
  transform: scale(1.02);
  border-color: rgba(201,150,58,0.4);
  background: rgba(255,255,255,0.06);
}

.amount-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  background: rgba(201,150,58,0.08);
  color: var(--accent);
}

/* Custom Amount Input */
.custom-input-wrap {
  position: relative;
  margin-bottom: 1.5rem;
  display: none;
}

.custom-input-wrap.visible {
  display: block;
}

.custom-input-wrap .prefix {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  color: var(--accent);
  pointer-events: none;
}

.custom-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  color: var(--text);
  padding: 0.5rem 0 0.5rem 1.5rem;
  outline: none;
  transition: border-color 0.2s;
}

.custom-input:focus {
  border-bottom-color: var(--accent);
}

.custom-input::placeholder {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Note Textarea */
.note-textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.75rem 1rem;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.5rem;
}

.note-textarea:focus {
  border-color: var(--border);
}

.note-textarea::placeholder {
  color: var(--text-muted);
}

/* Pay Button */
.pay-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #C9963A, #A67828);
  color: #fff;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pay-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.pay-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.pay-btn.loading .spinner {
  display: inline-block;
}

.pay-btn.loading .btn-text {
  display: none;
}

.pay-btn.loading .btn-loading-text {
  display: inline;
}

.btn-loading-text {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Trust Line */
.trust {
  text-align: center;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

/* Error Message */
.error-msg {
  display: none;
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--error);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

.error-msg.visible {
  display: block;
}

/* Checkmark Animation */
.checkmark-svg {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  display: block;
}

.checkmark-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-linecap: round;
  animation: stroke 0.6s ease forwards;
}

.checkmark {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: stroke 0.3s ease 0.6s forwards;
}

@keyframes stroke {
  to { stroke-dashoffset: 0; }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 20px rgba(201,150,58,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,150,58,0); }
}

.check-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.check-circle-wrap {
  border-radius: 50%;
  animation: pulse-ring 2s ease infinite;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

/* Stagger Fade In */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.anim-d1 { animation-delay: 0s; }
.anim-d2 { animation-delay: 0.1s; }
.anim-d3 { animation-delay: 0.2s; }
.anim-d4 { animation-delay: 0.3s; }
.anim-d5 { animation-delay: 0.4s; }

/* Full-page center layout */
.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

/* Success page details */
.detail-row {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.detail-row span {
  color: var(--text);
}

/* Return Button (outlined) */
.return-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.return-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  opacity: 1;
}

/* Cancel page icon */
.cancel-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .glass-card {
    padding: 1.75rem;
  }

  h1 {
    font-size: 2.5rem !important;
  }
}
