/* Paleta da Clube VFit: verde-escuro da marca, dourado e cobre, fundo creme. */
:root {
  --bg: #faf6ee;
  --card: #ffffff;
  --text: #1d2b26;
  --muted: #5c6b64;
  --primary: #0d4d40;
  --primary-text: #fbf6ea;
  --accent: #b8862b;
  --danger: #b42318;
  --ok: #0d7a4f;
  --line: #e4dccb;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1a17;
    --card: #17251f;
    --text: #f3eee2;
    --muted: #aab7ae;
    --primary: #2e9c82;
    --primary-text: #0b1210;
    --accent: #d4a24a;
    --danger: #ff8a80;
    --ok: #5fd39a;
    --line: #2b3d35;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1a17;
  --card: #17251f;
  --text: #f3eee2;
  --muted: #aab7ae;
  --primary: #2e9c82;
  --primary-text: #0b1210;
  --accent: #d4a24a;
  --danger: #ff8a80;
  --ok: #5fd39a;
  --line: #2b3d35;
}

/* Marca */
.brand { background: #000; border-radius: var(--radius); overflow: hidden; margin: 12px 0 16px; }
.brand img { display: block; width: 100%; height: auto; }
.brand.compacto img { max-height: 160px; width: auto; margin: 0 auto; }
.hero { width: 100%; height: auto; border-radius: var(--radius); display: block; margin: 12px 0 18px; box-shadow: 0 6px 20px rgba(13, 77, 64, 0.12); }
h1 { color: var(--primary); }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
p.muted, .muted { color: var(--muted); margin: 4px 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.hidden { display: none !important; }

label { display: block; font-size: 0.9rem; color: var(--muted); margin: 10px 0 4px; }
input, select {
  width: 100%;
  font: inherit;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
button {
  font: inherit;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
button.primary { background: var(--primary); color: var(--primary-text); border-color: transparent; width: 100%; margin-top: 14px; }
button.small { padding: 8px 12px; font-size: 0.9rem; }
button:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 140px; }

.event-option { display: block; cursor: pointer; }
.event-option input { width: auto; margin-right: 8px; }
.event-option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.lots { font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.lot-line.esgotado { text-decoration: line-through; opacity: 0.6; }

.person { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.person:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.person-head { display: flex; justify-content: space-between; align-items: center; }

.error { color: var(--danger); font-weight: 600; margin: 10px 0 0; }
.ok { color: var(--ok); font-weight: 600; }
.total { font-size: 1.3rem; font-weight: 700; margin: 12px 0 0; }

.pix-box { text-align: center; }
.pix-box img { width: 240px; max-width: 80%; height: auto; border-radius: 8px; background: #fff; padding: 8px; }
textarea {
  width: 100%;
  font: 0.85rem ui-monospace, Menlo, monospace;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  min-height: 84px;
  word-break: break-all;
}
.ticket-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 10px 0; flex-wrap: wrap; }
.ticket-item:first-of-type { border-top: 0; }
a.btn { display: inline-block; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
a.btn.primary { background: var(--primary); color: var(--primary-text); border-color: transparent; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: var(--ok); }
.pill.warn { color: var(--danger); border-color: var(--danger); }

/* Check-in */
.scan-area { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.scan-area video { width: 100%; height: 100%; object-fit: cover; }
.scan-area canvas { display: none; }
.result { border-radius: var(--radius); padding: 18px; text-align: center; margin: 12px 0; font-size: 1.1rem; }
.result.ok-bg { background: var(--ok); color: #fff; }
.result.fail-bg { background: var(--danger); color: #fff; }
.result strong { display: block; font-size: 1.4rem; margin-bottom: 4px; }
