/* Digitis Llave · los colores y la letra de digitis.com (estilos.css) */
@font-face { font-family: "Suisse Intl"; font-style: normal; font-weight: 400; font-display: swap; src: url(fuentes/suisse-intl-400.woff2) format("woff2"); }
@font-face { font-family: "Suisse Intl"; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fuentes/suisse-intl-500.woff2) format("woff2"); }

:root {
  --negro: #0b0b0c;
  --papel: #f2f2ef;
  --tinta: #141415;
  --blanco: #f5f5f3;
  --acento: #d9302a;
  --tarjeta: #fbfbf9;
  --suave: #4a4a4c;
  --gris: #5a5a5c;
  --linea: rgba(20, 20, 21, .1);
  --linea-fuerte: rgba(20, 20, 21, .14);
  --verde: #1f6b45;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --curva: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: "Suisse Intl", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }

.pagina { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Cabecera */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) clamp(20px, 4vw, 48px) 24px;
}
.marca { display: flex; align-items: center; gap: 14px; color: var(--tinta); text-decoration: none; }
.logo { height: 22px; width: auto; display: block; }
.separador { width: 1px; height: 18px; background: rgba(20, 20, 21, .2); }
.producto { font-size: 15px; font-weight: 500; letter-spacing: .01em; }
.sello { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gris); }
.sello-corto { display: none; }

/* Tarjeta */
.centro { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 16px 20px 48px; }
.tarjeta {
  width: 100%; max-width: 520px;
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: 22px;
  padding: clamp(28px, 6vw, 44px);
  box-shadow: 0 1px 2px rgba(11, 11, 12, .04), 0 24px 48px -28px rgba(11, 11, 12, .22);
}
.estado { display: flex; flex-direction: column; gap: 28px; }
.estado.entra { animation: entra .42s var(--curva) both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.icono {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.icono--oscuro { background: var(--negro); color: var(--blanco); }
.icono--claro { background: #e8e8e4; color: var(--gris); }
.punto {
  position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--acento); border: 3px solid var(--tarjeta);
}
.cuerpo { display: flex; flex-direction: column; gap: 12px; }
.titulo { margin: 0; font-size: clamp(28px, 4vw, 36px); line-height: 1.08; font-weight: 500; letter-spacing: -.02em; text-wrap: balance; }
.titulo--abierta { font-size: clamp(24px, 3.4vw, 30px); line-height: 1.15; letter-spacing: -.015em; overflow-wrap: anywhere; }
.texto { margin: 0; font-size: 17px; line-height: 1.5; color: var(--suave); text-wrap: pretty; }
.pie-tarjeta { margin: 0; font-size: 13px; line-height: 1.5; color: var(--gris); }
.pie-tarjeta a { color: var(--tinta); }

/* Botón principal */
.boton {
  appearance: none; border: 0; cursor: pointer; position: relative;
  width: 100%; min-height: 58px; padding: 0 20px; border-radius: 14px;
  background: var(--negro); color: var(--blanco);
  font: inherit; font-size: 17px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background-color .18s var(--curva), transform .18s var(--curva);
  -webkit-tap-highlight-color: transparent;
}
.boton:hover { background: #2a2a2c; }
.boton:active { transform: scale(.985); }
.boton:focus-visible, .icono-boton:focus-visible, .marca:focus-visible, .pie a:focus-visible, .pie-tarjeta a:focus-visible {
  outline: 2px solid var(--acento); outline-offset: 3px;
}
.boton .giro { display: none; }
.boton.cargando { pointer-events: none; }
.boton.cargando .boton-flecha { display: none; }
.boton.cargando .giro {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(245, 245, 243, .3); border-top-color: var(--blanco);
  animation: gira .8s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }
.boton .i-hecho, .icono-boton .i-hecho { display: none; }
.copiado .i-copiar { display: none; }
.copiado .i-hecho { display: block; }
.boton.copiado, .boton.copiado:hover { background: var(--verde); }

/* Credencial abierta */
.cabeza { display: flex; flex-direction: column; gap: 10px; }
.etiqueta-seccion {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--gris); text-transform: uppercase; letter-spacing: .08em;
}
.punto-rojo { width: 7px; height: 7px; border-radius: 50%; background: var(--acento); }
.campos { display: flex; flex-direction: column; gap: 18px; }
.campo { display: flex; flex-direction: column; gap: 8px; }
.campo-etiqueta { font-size: 14px; font-weight: 500; }
.campo-caja {
  display: flex; align-items: center; gap: 4px;
  background: var(--papel); border: 1px solid var(--linea-fuerte); border-radius: 14px;
  padding: 6px 6px 6px 18px;
}
.campo-valor {
  flex-grow: 1; min-width: 0; color: var(--tinta);
  font-family: var(--mono); font-size: 16px; line-height: 1.45; letter-spacing: .01em; padding: 10px 0;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all;
  -webkit-user-select: all; user-select: all; cursor: text; border-radius: 6px;
}
.campo-valor:focus-visible { outline: 2px solid var(--acento); outline-offset: 4px; }
.campo-valor.oculto { letter-spacing: .14em; -webkit-user-select: none; user-select: none; color: var(--suave); }
.icono-boton {
  appearance: none; border: 0; background: transparent; cursor: pointer; flex-shrink: 0;
  color: var(--gris); width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: color .16s, background-color .16s;
  -webkit-tap-highlight-color: transparent;
}
.icono-boton:hover { color: var(--tinta); background: rgba(20, 20, 21, .06); }
.icono-boton.copiado { color: var(--verde); }
.ver .ojo-cerrado { display: none; }
.ver.mostrando .ojo-abierto { display: none; }
.ver.mostrando .ojo-cerrado { display: block; }
.nota {
  margin: 0; font-size: 15px; line-height: 1.5; color: var(--suave);
  padding: 14px 16px; border-radius: 12px; background: var(--papel); white-space: pre-line; overflow-wrap: anywhere;
}
.aviso { display: flex; gap: 12px; align-items: flex-start; padding-top: 20px; border-top: 1px solid var(--linea); color: var(--gris); }
.aviso svg { flex-shrink: 0; margin-top: 2px; }
.aviso p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--suave); }
.aviso strong { font-weight: 500; color: var(--tinta); }

/* Pie */
.pie {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 20px clamp(20px, 4vw, 48px) max(20px, env(safe-area-inset-bottom));
  font-size: 12px; color: var(--gris);
}
.pie a { color: var(--gris); text-decoration: none; }
.pie a:hover { color: var(--tinta); }

.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 520px) {
  .sello-largo { display: none; }
  .sello-corto { display: inline; }
  .centro { align-items: flex-start; padding: 4px 16px 32px; }
  .tarjeta { border-radius: 20px; }
  .estado { gap: 24px; }
  .campo-caja { padding-left: 14px; }
}
@media (max-height: 560px) { .centro { align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) {
  .estado.entra { animation: none; }
  .boton, .icono-boton { transition: none; }
  .boton.cargando .giro { animation-duration: 2s; }
}
