/* Marca IVBSA: Rockwell para textos y datos. El frente es una imagen exportada del PSD.
   Rockwell no se distribuye (falta la licencia web): se usa si el dispositivo la tiene; si no, Rokkitt (OFL). */
@font-face {
  font-family: "Rokkitt";
  src: url("/assets/rokkitt.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --noche: #04070c;
  --panel: #10131a;
  --panel-alto: #23273a;
  --linea: rgb(255 255 255 / 0.1);
  --texto: #ffffff;
  --suave: rgb(255 255 255 / 0.7);
  --cobalto: #016ce1;
  --azul-claro: #5aa2ff;
  --vb-claro: #3b8bff;
  --vb-oscuro: #0a3d9c;
  --franja-a: #00367a;
  --franja-b: #0060c3;
  --datos: "Rockwell", "Rockwell Nova", "Rokkitt", Georgia, serif;
  --curva: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--noche); }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--datos);
  color: var(--texto);
  background:
    radial-gradient(85% 380px at 50% 110px, rgb(1 108 225 / 0.24), transparent 72%),
    var(--noche);
  -webkit-font-smoothing: antialiased;
}

h1, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--azul-claro);
  outline-offset: 3px;
  border-radius: 6px;
}

.tarjeta {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
}

.aviso-ejemplo {
  justify-self: center;
  padding: 0.3rem 0.75rem;
  border: 1px solid #8a6d1f;
  border-radius: 999px;
  background: #2a2210;
  color: #f4d77e;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Frente: el de la tarjeta impresa, exportado del PSD */
.frente {
  overflow: hidden;
  border: 1px solid var(--linea);
  border-radius: 1rem;
  background: var(--panel);
}

.frente a, .frente img { display: block; }
.frente img { width: 100%; height: auto; }

/* Persona */
.persona {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding-top: 0.25rem;
  text-align: center;
}

h1 {
  font-size: clamp(1.75rem, 8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

.puesto {
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--azul-claro);
  text-wrap: balance;
}

.filo {
  width: 4rem;
  height: 3px;
  margin-top: 0.45rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--franja-a), var(--cobalto));
}

/* Acciones */
.acciones { display: flex; gap: 0.7rem; }

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.2rem;
  padding: 0 0.7rem;
  border-radius: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms var(--curva), background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.boton:active { transform: scale(0.97); }
.boton[hidden] { display: none; }

.boton-primario {
  flex: 2 1 auto;
  border: 1px solid var(--vb-claro);
  background: linear-gradient(100deg, var(--franja-a), var(--franja-b));
  color: #fff;
  box-shadow: 0 10px 26px -12px rgb(1 108 225 / 0.9);
}

.boton-secundario {
  flex: 1 1 auto;
  border: 1px solid var(--linea);
  background: var(--panel);
}

.icono { flex: none; width: 1.1rem; height: 1.1rem; }

/* Datos */
.datos {
  overflow: hidden;
  border: 1px solid var(--linea);
  border-radius: 1rem;
  background: var(--panel);
}

.datos li + li { border-top: 1px solid var(--linea); }

.datos a {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.6rem 1rem;
  transition: background-color 200ms ease;
}

.datos .icono { color: var(--azul-claro); }

.rotulo {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--azul-claro);
}

.valor {
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.con-copia { display: flex; align-items: stretch; }
.con-copia a { flex: 1; min-width: 0; grid-template-columns: 4.6rem minmax(0, 1fr); padding-right: 0.25rem; }

.copiar {
  flex: none;
  width: 2.75rem;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--azul-claro);
  cursor: pointer;
}

.copiar[hidden] { display: none; }

/* QR: oscuro sobre blanco, con zona de silencio */
.qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--linea);
  border-radius: 1rem;
  background: var(--panel);
}

.qr-marco {
  width: 7.5rem;
  padding: 0.7rem;
  border-radius: 0.5rem;
  background: #fff;
}

.qr-marco svg { display: block; width: 100%; height: auto; }

.qr p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--suave);
}

.qr strong { display: block; font-weight: 700; color: var(--texto); }

/* Pie: la franja cobalto de la marca */
.pie {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.75rem 1rem 0.6rem;
  border-radius: 0.8rem;
  background: linear-gradient(90deg, var(--franja-a), var(--franja-b));
  color: #fff;
  font-size: 0.86rem;
  text-align: center;
  text-wrap: balance;
}

.pie a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding-inline: 0.5rem;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.estado {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  padding: 0.6rem 1rem;
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: var(--panel-alto);
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms var(--curva);
}

.estado.visible { opacity: 1; transform: translate(-50%, 0); }

.tarjeta-vacia { align-content: center; min-height: 100dvh; }

.sin-corte { display: inline-block; }

@media (max-width: 379px) {
  .boton { gap: 0.35rem; padding: 0 0.45rem; font-size: 0.92rem; }
  .punto { display: none; }
}

@media (hover: hover) {
  .boton-primario:hover { box-shadow: 0 12px 30px -10px rgb(1 108 225 / 1); }
  .boton-secundario:hover { border-color: var(--cobalto); }
  .datos a:hover { background: #171b28; }
  .copiar:hover { background: #171b28; }
}
