:root {
  --bg: #10131a;
  --surface: #1a1f2b;
  --surface-2: #232937;
  --line: #2e3648;
  --text: #eef1f7;
  --muted: #98a2b8;
  --accent: #5b8cff;
  --accent-ink: #ffffff;
  --ok: #35c48b;
  --warn: #ffb020;
  --danger: #ff5c5c;
  --radius: 16px;
  /* Fijo a proposito: --accent lo pisa el color del comercio y un enlace no
     puede quedar del color del fondo. */
  --link: #8ab0ff;
}

* { box-sizing: border-box; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted a { text-underline-offset: 2px; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

main {
  width: 100%;
  max-width: 460px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
p  { margin: 0 0 12px; }

.muted { color: var(--muted); font-size: 0.9rem; }
.center { text-align: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 0 6px;
}

input, select {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

button, .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  margin-top: 12px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary, .btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }

.btn-apple { background: #000; color: #fff; border: 1px solid #3a3a3a; }
.btn-google { background: #fff; color: #202124; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.msg {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-top: 12px;
}
.msg.error { background: rgba(255, 92, 92, 0.12); color: #ffb1b1; }
.msg.ok    { background: rgba(53, 196, 139, 0.12); color: #93e8c4; }
.msg.info  { background: rgba(91, 140, 255, 0.12); color: #bcd0ff; }
.hidden { display: none !important; }

/* Sellos ------------------------------------------------------------------ */
.stamps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 18px 0 8px;
}
.stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.stamp.on {
  border: 2px solid transparent;
  background: var(--ok);
  color: #06231a;
  font-weight: 700;
}

.qr {
  display: block;
  width: 220px;
  max-width: 70%;
  margin: 8px auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.16em;
  text-align: center;
  margin: 6px 0 0;
}

/* Escaner ----------------------------------------------------------------- */
#video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.scan-frame { position: relative; }
.scan-frame::after {
  content: '';
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  pointer-events: none;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.topbar a { color: var(--muted); font-size: 0.9rem; }

/* Botones de marca de los wallets. El asset ya trae su forma y su color: aca
   solo se le da el aire que piden las reglas (8 dp en Google) y se centra. */
.btn-marca {
  display: block;
  margin: 8px auto;
  padding: 0;
  background: none;
  border: 0;
  line-height: 0;
  text-align: center;
}
.btn-marca img { max-width: 100%; height: 52px; width: auto; }
