:root {
  --bg-deep: #0b0d17;
  --card-top: #26224a;
  --card-bottom: #131522;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --text-main: #f3f4f8;
  --text-muted: #9ca3af;
  --accent-amber: #fbbf24;
  --accent-teal: #2dd4bf;
  --accent-green: #4ade80;
  --btn-gradient: linear-gradient(90deg, #b8f1e6 0%, #dcd0ff 100%);
}

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

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, var(--bg-deep) 70%);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.pay-shell {
  width: 100%;
  max-width: 400px;
  position: relative;
}

.pay-card {
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-bottom) 65%);
  border: 1px solid var(--border-subtle);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  position: relative;
}

.pay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.pay-header .label {
  color: var(--text-muted);
}

.pay-header .timer {
  color: var(--accent-amber);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.pay-header .status-paid {
  color: var(--accent-green);
  font-weight: 600;
}

.pay-body {
  padding: 26px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.payee-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 20px;
}

.amount-display {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}

.qr-frame {
  position: relative;
  padding: 14px;
  margin-bottom: 22px;
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent-teal);
  border-style: solid;
  pointer-events: none;
}

.corner-tl {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 10px;
}

.corner-tr {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 10px;
}

.corner-bl {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 10px;
}

.corner-br {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 10px;
}

.qr-box {
  width: 220px;
  height: 220px;
  background: #ffffff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-placeholder {
  color: #6b7280;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
  padding: 12px;
}

.scan-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-main);
  margin-bottom: 26px;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  background: var(--btn-gradient);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-primary:hover {
  opacity: 0.94;
}

.btn-primary:active {
  transform: scale(0.985);
}

/* Modal overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 16px;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  width: 100%;
  max-width: 400px;
  background: #1a1d2d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  padding: 32px 24px 28px;
  text-align: center;
  position: relative;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  animation: sheetUp 0.2s ease-out;
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.check-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--accent-green);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  font-size: 32px;
  font-weight: 700;
}

.stamp-badge {
  position: absolute;
  top: 46px;
  right: 28px;
  padding: 4px 12px;
  border: 2px solid #e19187;
  border-radius: 8px;
  color: #e19187;
  font-size: 14px;
  font-weight: 700;
  transform: rotate(-12deg);
  letter-spacing: 1px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.modal-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-qq {
  display: block;
  width: 100%;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-qq:hover {
  background: rgba(255, 255, 255, 0.14);
}

.modal-error {
  margin-top: 10px;
  font-size: 13px;
  color: #fca5a5;
}

/* Admin page styles */
.admin-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #1f2238 0%, #141624 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.admin-title {
  font-size: 20px;
  font-weight: 700;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 14px;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-teal);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.qr-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.qr-thumb {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  background: #ffffff;
  padding: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

.status-msg {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
}

.status-ok {
  color: var(--accent-green);
}

.status-err {
  color: #fca5a5;
}

.hidden {
  display: none !important;
}
