/* Carnet RVN · estilos compartidos por el carnet, el panel y la verificación */
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700 800; font-display: swap; src: url(/assets/fonts/bricolage-grotesque-latin-1.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/montserrat-latin-3.woff2) format('woff2'); }

/* Pantalla tipo app: fondo azul noche de la marca, el carnet como único objeto con color fuerte */
:root {
  --night: #0d1536;
  --night-2: #131d47;
  --night-3: #1a2657;
  --blue: #22398D;
  --blue-deep: #182a6b;
  --red: #DB4A2B;
  --paper: #F5F3EE;
  --white: #FFFFFF;
  --muted: rgba(245, 243, 238, .68);
  --line: rgba(245, 243, 238, .14);
  --ok: #3fbf7f;
  --err: #ff9b85;

  --display: "Bricolage Grotesque", "Montserrat", system-ui, sans-serif;
  --body: "Montserrat", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.app {
  max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
}
.screen { display: flex; flex-direction: column; gap: 22px; flex: 1; animation: in .45s var(--ease); }
@keyframes in { from { opacity: .3; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.logo { width: 132px; height: auto; display: block; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.h1 { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
.h2 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
.lead { color: var(--muted); font-size: 15px; max-width: 34ch; }
.lead b { color: var(--white); }
.small { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.spacer { flex: 1; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px 20px; border-radius: 14px;
  background: var(--red); color: var(--white);
  font-family: var(--display); font-weight: 700; font-size: 17px;
  transition: transform .15s var(--ease), filter .15s, opacity .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn--ghost { background: transparent; color: var(--muted); font-family: var(--body); font-weight: 600; font-size: 14px; padding: 10px; }
a.btn { text-decoration: none; }
.btn--line { background: transparent; border: 1px solid var(--line); color: var(--paper); font-size: 15px; padding: 12px 16px; }
.btn-row { display: flex; flex-direction: column; gap: 6px; }

.field { display: grid; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--night-2);
  color: var(--white); font-size: 16px;
}
.input:focus { outline: none; border-color: var(--red); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.45; }
.error { font-size: 13px; color: var(--err); min-height: 20px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  background: var(--paper); color: var(--night); font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 12px;
  opacity: 0; transition: .3s var(--ease); pointer-events: none; max-width: calc(100% - 32px); z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip--on { color: var(--paper); }
.chip--on::before { background: var(--ok); }
.chip--warn::before { background: var(--red); }

/* ---------- Carnet ---------- */
.card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 22px;
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-deep) 70%);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255,255,255,.08);
  display: grid; gap: 18px;
}
.card__ball { position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; pointer-events: none; }
.card__top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card__top .logo { width: 96px; }
.card__tag { display: inline-block; margin-bottom: 6px; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--white); background: var(--red); padding: 4px 8px; border-radius: 6px; }
.card__who { position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 14px; align-items: center; }
.avatar {
  width: 74px; height: 74px; border-radius: 18px; object-fit: cover; border: 2px solid rgba(255,255,255,.85);
  background: var(--blue-deep); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--white);
}
.card__name { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.05; color: var(--white); text-wrap: balance; }
.card__disc { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.card__meta { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid rgba(255,255,255,.18); padding-top: 14px; margin: 0; }
.card__meta dt { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 700; }
.card__meta dd { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--white); font-variant-numeric: tabular-nums; }
.card__qr { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: var(--white); color: var(--night); border-radius: 16px; padding: 12px; }
.card__qr .qr { width: 96px; height: 96px; }
.card__qr .qr img, .card__qr .qr canvas { width: 96px !important; height: 96px !important; }
.card__qr p { font-size: 12px; line-height: 1.4; }
.card__qr b { display: block; font-family: var(--display); font-size: 15px; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
