/* Thundercloud Subs punch card: shared styles */
:root {
  --blue: #0c14e0;
  --blue-deep: #070c9e;
  --blue-soft: #2832e8;
  --yellow: #ffdc24;
  --red: #e13237;
  --ink: #12142b;
  --muted: #5d6178;
  --paper: #fffaf0;
  --card: #ffffff;
  --line: #e7e2d6;
  --ok: #138a4b;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, .display { font-family: "Alfa Slab One", Georgia, serif; font-weight: 400; letter-spacing: .01em; }
a { color: var(--blue); }

/* Rainbow stripe from the logo */
.stripe { height: 10px; background: linear-gradient(var(--red) 0 33%, var(--yellow) 33% 66%, var(--blue) 66% 100%); }

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap.wide { max-width: 1040px; }

.logo { display: block; width: 220px; max-width: 70%; margin: 8px auto 4px; }
.lead { text-align: center; color: var(--muted); margin: 0 0 20px; line-height: 1.45; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 10px 30px -20px rgba(12,20,224,.35);
}

label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input[type=text], input[type=password], input[type=tel], select {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: 0; cursor: pointer; text-decoration: none;
  font: 600 18px/1.1 "Archivo", system-ui, sans-serif;
  padding: 16px 18px; border-radius: 14px;
  background: var(--blue); color: #fff;
  transition: transform .05s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn.dark { background: #111; color: #fff; }
.btn.small { width: auto; font-size: 14px; padding: 9px 14px; border-radius: 10px; }
.stack > * + * { margin-top: 12px; }

.note { font-size: 14px; color: var(--muted); line-height: 1.45; }
.error { background: #fdecec; color: #8e1b1f; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.warn { background: #fff6d6; color: #6b5300; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.hidden { display: none !important; }

/* ---------- The punch card itself ---------- */
.tc-card {
  background: var(--blue);
  color: #fff;
  border-radius: 22px;
  padding: 18px 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(7,12,158,.7);
}
.tc-card .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tc-card .head img { height: 64px; }
.tc-card .count { text-align: right; }
.tc-card .count b { font-family: "Alfa Slab One", serif; font-weight: 400; font-size: 30px; display: block; line-height: 1; }
.tc-card .count span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.tc-card .who { margin: 12px 0 12px; font-size: 14px; opacity: .9; }
.tc-card .status { font-weight: 700; margin-top: 14px; font-size: 16px; }
.tc-card.ready { background: linear-gradient(160deg, var(--blue) 55%, var(--blue-deep)); }

.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stamp {
  aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-soft); border: 2px solid rgba(170,178,255,.75);
  color: rgba(190,196,255,.95); font-weight: 700; font-size: 15px;
}
.stamp.free { border-color: var(--yellow); color: var(--yellow); font-size: 11px; letter-spacing: .04em; }
.stamp.on { background: #fff; border-color: #fff; }
.stamp.on svg { width: 62%; height: 62%; }
.stamp.on.free { box-shadow: 0 0 0 3px var(--blue), 0 0 0 6px var(--yellow); }
.stamp.pop { animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

.qr-box { background: #fff; border-radius: 14px; padding: 14px; display: grid; place-items: center; margin-top: 16px; }
.qr-box canvas, .qr-box img { width: 190px !important; height: 190px !important; image-rendering: pixelated; }
.qr-box small { color: var(--ink); font-family: ui-monospace, Menlo, monospace; margin-top: 8px; font-size: 13px; letter-spacing: .05em; }

/* Google Wallet style button */
.gw-btn { background: #000; color: #fff; border-radius: 999px; padding: 14px 22px; font-size: 17px; }
.gw-btn svg { width: 26px; height: 26px; }

/* ---------- Staff screen ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--blue); color: #fff; }
.topbar .title { font-family: "Alfa Slab One", serif; font-size: 18px; }
.topbar .where { font-size: 13px; opacity: .85; }
.topbar .btn.small { background: rgba(255,255,255,.15); color: #fff; }

#reader { width: 100%; border-radius: 16px; overflow: hidden; background: #000; min-height: 240px; }
#reader video { border-radius: 16px; }

.result-big { text-align: center; padding: 8px 0 4px; }
.result-big .display { font-size: 30px; margin: 4px 0; color: var(--blue); }
.result-big.good .display { color: var(--ok); }
.result-big.party .display { color: var(--red); }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi b { font-family: "Alfa Slab One", serif; font-weight: 400; font-size: 30px; color: var(--blue); display: block; }
.kpi span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag.t-stamp { background: #e6e8ff; color: var(--blue); }
.tag.t-redeem { background: #ffe9ea; color: #a1191e; }
.tag.t-signup { background: #fff4c2; color: #6b5300; }
.tag.t-undo { background: #eee; color: #555; }

/* ---------- Printable counter sign ---------- */
.sign { text-align: center; }
.sign .display { font-size: 34px; color: var(--blue); margin: 10px 0 4px; }
.sign #signQr { display: inline-block; padding: 16px; background: #fff; border: 6px solid var(--blue); border-radius: 22px; margin: 18px 0 10px; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
