:root {
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #1a1d29;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #16a34a;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

[data-theme='dark'] {
  --bg: #0f1115;
  --card-bg: #1a1d29;
  --text: #f2f3f5;
  --muted: #9aa0ac;
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --success: #4ade80;
  --danger: #f87171;
  --border: #2a2e3a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
}

h1 {
  font-size: 22px;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

input[type='text'],
input[type='number'] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 18px;
  outline: none;
}

input:focus {
  border-color: var(--primary);
}

button.primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

button.primary:hover { background: var(--primary-hover); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin: -10px 0 14px;
  min-height: 16px;
}

/* ---- Payment page ---- */
.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 20px;
  position: relative;
}

.qr-wrap img {
  width: 220px;
  height: 220px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: white;
  padding: 10px;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.qr-wrap.expired img {
  filter: grayscale(1) blur(2px);
  opacity: 0.4;
}

.qr-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--danger);
  font-size: 18px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 16px;
}

.qr-wrap.expired .qr-overlay { display: flex; }

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.detail-row:last-of-type { border-bottom: none; }
.detail-row .label { color: var(--muted); }
.detail-row .value { font-weight: 600; }

.timer {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin: 18px 0 6px;
  letter-spacing: 1px;
}

.timer.warning { color: var(--danger); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin: 12px auto 4px;
  width: fit-content;
}

.status-badge.pending { background: rgba(234, 179, 8, 0.15); color: #b45309; }
.status-badge.paid { background: rgba(22, 163, 74, 0.15); color: var(--success); }
.status-badge.expired { background: rgba(220, 38, 38, 0.15); color: var(--danger); }

.status-wrap { display: flex; justify-content: center; }

.success-anim {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.success-anim.show { display: block; animation: pop 0.4s ease; }

.checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}
