/* LanyardBadge — credencial colgando de una cinta. Ver assets/js/lanyard-badge.js.
   Paleta ISES: marino #12284a, azul #2f6bff, fondo #f5f8fc; Anton + Manrope. */

.lyd {
  --lyd-ancho: 220px;
  position: relative;
  height: 540px;
  /* un poco más ancho que la columna para que el vaivén no choque con el borde */
  margin: 0 -20px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.lyd-cinta {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  pointer-events: none;
  /* la cinta "baja de arriba": se desvanece en el borde superior */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 70px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 70px);
}

/* Sin JS la tarjeta queda quieta y centrada; con JS la coloca la física. */
.lyd-tarjeta {
  position: absolute;
  left: 50%;
  top: 70px;
  width: var(--lyd-ancho);
  height: calc(var(--lyd-ancho) * 1.5 + 30px);
  transform: translateX(-50%);
  transform-origin: 50% 0;
  cursor: grab;
  touch-action: none;
  outline: none;
  border-radius: 14px;
}
.lyd--vivo .lyd-tarjeta { left: 0; top: 0; will-change: transform; }
.lyd-tarjeta:focus-visible .lyd-cara { box-shadow: 0 0 0 3px #f5f8fc, 0 0 0 5px #2f6bff, 0 18px 40px -12px rgba(18,40,74,0.5); }

/* broche: engancha la argolla y muerde la tarjeta */
.lyd-broche {
  position: absolute;
  left: 50%;
  top: 0;
  width: calc(var(--lyd-ancho) * 0.075);
  height: calc(var(--lyd-ancho) * 0.15);
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(90deg, #f3f6fb, #9ba6b8 50%, #e9eef5);
  box-shadow: 0 1px 3px rgba(18,40,74,0.35);
  z-index: 2;
}

.lyd-giro {
  position: absolute;
  left: 0;
  right: 0;
  top: 21px;
  height: calc(var(--lyd-ancho) * 1.5);
  transform-style: preserve-3d;
}

.lyd-cara {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px -12px rgba(18,40,74,0.5), 0 2px 6px rgba(18,40,74,0.2);
  font-family: 'Manrope', sans-serif;
}
.lyd-reverso { transform: rotateY(180deg); }

/* ranura perforada del broche + brillo que corre al girar */
.lyd-cara::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 50%;
  width: 44px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
  z-index: 3;
}
.lyd-cara::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.22) 50%, transparent 65%) var(--lyd-shine, 50%) 0 / 250% 100% no-repeat,
    rgba(0,0,0,var(--lyd-dim, 0));
}

/* ---- Frente: credencial de acceso ---------------------------------------- */
.lyd-frente {
  color: #fff;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(47,107,255,0.45), transparent 60%),
    radial-gradient(80% 50% at 0% 100%, rgba(47,107,255,0.22), transparent 70%),
    linear-gradient(170deg, #173463 0%, #12284a 45%, #0b1a33 100%);
}
/* retícula técnica muy tenue */
.lyd-frente .lyd-reticula {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.lyd-cabecera {
  position: absolute;
  top: 28px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lyd-marca { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 12px; letter-spacing: 2.5px; }
.lyd-marca-icono {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f84ff, #2f6bff 55%, #1f4fd6);
  box-shadow: 0 4px 10px -3px rgba(47,107,255,0.8);
}
.lyd-marca-icono img { width: 15px; height: auto; display: block; }
.lyd-folio { font-size: 8px; letter-spacing: 1.5px; color: rgba(255,255,255,0.55); font-weight: 700; }

.lyd-foto {
  position: absolute;
  top: 64px;
  left: 50%;
  width: 124px;
  height: 146px;
  transform: translateX(-50%);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(143,176,255,0.35), 0 0 0 5px rgba(47,107,255,0.12), 0 14px 26px -10px rgba(0,0,0,0.7);
}
.lyd-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* esquinas de "encuadre de cámara" */
.lyd-foto::before, .lyd-foto::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #6f9bff;
  pointer-events: none;
}
.lyd-foto::before { top: 7px; left: 7px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.lyd-foto::after { bottom: 7px; right: 7px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }

.lyd-nombre {
  position: absolute;
  top: 222px;
  left: 12px;
  right: 12px;
  text-align: center;
}
.lyd-nombre strong {
  display: block;
  font-family: 'Anton', sans-serif;
  font-weight: 400;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.lyd-nombre span {
  display: block;
  margin-top: 7px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8fb0ff;
}

.lyd-franja {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #2f6bff, #1f4fd6);
}
.lyd-franja b { display: block; font-size: 9px; letter-spacing: 2px; font-weight: 800; }
.lyd-franja small { display: block; font-size: 7.5px; letter-spacing: 1px; color: rgba(255,255,255,0.75); font-weight: 600; margin-top: 2px; }
/* código de barras decorativo */
.lyd-barras {
  width: 70px;
  height: 20px;
  background: repeating-linear-gradient(90deg,
    #fff 0 2px, transparent 2px 3px, #fff 3px 4px, transparent 4px 7px,
    #fff 7px 10px, transparent 10px 11px, #fff 11px 12px, transparent 12px 14px);
  opacity: 0.9;
  border-radius: 1px;
}

/* ---- Reverso: ficha técnica ----------------------------------------------- */
.lyd-reverso { background: #f5f8fc; color: #12284a; }
.lyd-reverso-lente {
  position: absolute;
  width: 170px;
  right: -60px;
  top: 30px;
  color: #2f6bff;
  opacity: 0.1;
  max-width: none;
}
.lyd-reverso-cab { position: absolute; top: 32px; left: 16px; right: 16px; }
.lyd-reverso-cab b { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 20px; letter-spacing: 1px; line-height: 1; }
.lyd-reverso-cab span { display: block; margin-top: 5px; font-size: 7.5px; line-height: 1.45; letter-spacing: 0.6px; color: #6b7280; font-weight: 600; text-transform: uppercase; }
.lyd-cifras {
  position: absolute;
  top: 96px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lyd-cifras div {
  background: #fff;
  border: 1px solid #e6ebf3;
  border-radius: 10px;
  padding: 8px 10px 7px;
}
.lyd-cifras strong { display: block; font-family: 'Anton', sans-serif; font-weight: 400; font-size: 21px; line-height: 1; color: #12284a; }
.lyd-cifras span { display: block; margin-top: 3px; font-size: 7px; letter-spacing: 1px; text-transform: uppercase; color: #6b7280; font-weight: 700; }
.lyd-chips {
  position: absolute;
  top: 222px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.lyd-chips span {
  font-size: 7.5px;
  font-weight: 700;
  color: #2f6bff;
  background: rgba(47,107,255,0.08);
  border: 1px solid rgba(47,107,255,0.2);
  border-radius: 999px;
  padding: 3px 7px;
}
.lyd-reverso-pie {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #12284a;
  color: #fff;
  border-top-left-radius: 22px;
}
.lyd-reverso-pie b { font-size: 8.5px; letter-spacing: 1.2px; font-weight: 800; }
.lyd-reverso-pie span { font-size: 8px; color: #8fb0ff; font-weight: 700; letter-spacing: 0.5px; }

/* ---- Botón voltear (mismo lenguaje que los .chip de la página) ------------ */
.lyd-voltear {
  position: absolute;
  right: 26px;
  top: 10px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 12px 'Manrope', sans-serif;
  letter-spacing: 0.3px;
  color: #2f6bff;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(47,107,255,0.22);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px -14px rgba(18,40,74,0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .2s ease, color .2s ease;
}
.lyd-voltear:hover { background: #2f6bff; color: #fff; }
.lyd-voltear:focus-visible { outline: 2px solid #2f6bff; outline-offset: 2px; }
.lyd-voltear svg { transition: transform .5s ease; }
.lyd-voltear--atras svg { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .lyd-voltear svg { transition: none; } }
