/* QR Loyalty System theme: shared by every page */
:root {
  --accent: #2d6cdf;
  --accent-dark: #1d4ed8;
  --bg1: #1e3a8a;
  --bg2: #2d6cdf;
  --bg3: #38bdf8;
}
/* staff and admin pages use a green theme */
:root:has(form[action^="/staff"]) {
  --accent: #1b7f3b;
  --accent-dark: #166534;
  --bg1: #052e16;
  --bg2: #166534;
  --bg3: #14b8a6;
}

body {
  margin: 0;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 40px 16px;
  align-items: flex-start;
  background-color: var(--bg2);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='white' stroke-opacity='0.2' stroke-width='2'%3E%3Ccircle cx='140' cy='50' r='16'/%3E%3Ccircle cx='140' cy='50' r='10'/%3E%3Ccircle cx='40' cy='160' r='16'/%3E%3Ccircle cx='40' cy='160' r='10'/%3E%3C/g%3E%3Cg fill='white' fill-opacity='0.17'%3E%3Cpolygon points='46,18 50,30 63,30 53,38 57,51 46,43 35,51 39,38 29,30 42,30'/%3E%3Cpolygon points='150,128 153,137 163,137 155,143 158,153 150,147 142,153 145,143 137,137 147,137'/%3E%3Crect x='80' y='110' width='10' height='10'/%3E%3Crect x='93' y='110' width='10' height='10'/%3E%3Crect x='80' y='123' width='10' height='10'/%3E%3Crect x='106' y='136' width='10' height='10'/%3E%3Crect x='93' y='149' width='10' height='10'/%3E%3Crect x='100' y='22' width='10' height='10'/%3E%3Crect x='113' y='35' width='10' height='10'/%3E%3Crect x='100' y='48' width='10' height='10'/%3E%3Crect x='14' y='98' width='10' height='10'/%3E%3Crect x='27' y='85' width='10' height='10'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%);
  background-attachment: fixed;
}
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
body::before {
  width: 460px; height: 460px; top: -140px; left: -120px;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 65%);
}
body::after {
  width: 560px; height: 560px; bottom: -200px; right: -160px;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 65%);
}

.card {
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  border-top: 6px solid var(--accent);
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  animation: rise 0.5s ease both;
}
.card::before {
  content: "\2605  QR LOYALTY";
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--accent);
}
:root:has(form[action^="/staff"]) .card::before {
  content: "\2605  QR LOYALTY  \00B7  STAFF";
}

input {
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,108,223,0.18);
}
:root:has(form[action^="/staff"]) input:focus {
  box-shadow: 0 0 0 3px rgba(27,127,59,0.2);
}

button {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  transition: transform 0.15s, box-shadow 0.15s;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
}
button:active {
  transform: translateY(0);
}

.points::before {
  content: "\2605 ";
  color: #f5b301;
}
.result, .note {
  border-left: 4px solid var(--accent);
}
tr:nth-child(even) td {
  background: #f8fafc;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  button { transition: none; }
}
@media (max-width: 560px) {
  body { padding: 20px 10px; }
  .card { width: 100% !important; }
  .two { flex-direction: column; }
}