html {
  box-sizing: border-box;
  overflow-x: hidden;
}

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

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  margin: 0;
  width: 100%;
}

.header {
  background: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.header__container {
  max-width: 1150px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


.header__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
}

.header__nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header_sub_nav {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--color-primary-dark);
  padding: 1.5rem 1.5rem;
}

.header__link {
  color: var(--color-white);
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.header__link:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.header__search-btn {
  padding: 0.4rem;
  min-width: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.header__search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.header__search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: currentColor;
  right: -6px;
  bottom: -6px;
  transform: rotate(45deg);
  border-radius: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hamburger button - hidden on desktop */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 900px;
  width: 100%;
  margin: 2rem auto;
  padding: 2.5rem 1.5rem;
}

.code-section p {
  font-size: 1.1rem;
  text-align: center;  
}


.card h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.small {
  color: #666;
  font-size: 0.95rem;
}

.status {
  min-height: 1.5rem;
  margin-bottom: 1rem;
}

input,
button {
  width: 100%;
  font: inherit;
}

input {
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

button {
  padding: 0.85rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

button:hover {
  background: var(--color-primary-light);
}

.hidden {
  display: none !important;
}



.footer_credencial img{
  display: block;
  margin: 0 auto;
}

/* FOOTER */


.footer {
  background-color: var(--color-primary-dark);   /* Azul oscuro institucional */
  color: var(--color-white);
  padding: 2rem 1rem;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.footer-logo{
  display: block;
  margin: 0;
  width: 170px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  align-items: start;
}

.footer-col h3 {
  font-size: 1.5rem;
  color: var(--color-white);
  margin-bottom: 1rem;
}

.footer-col h4 {
  font-size: 1.1rem;
  color: var(--color-white);
  margin: 0 0 1rem 0;
  font-weight: 700;
  border-left: none;
  padding-left: 0;
}

/* Ajuste para el segundo título en la misma columna */
.footer-col h4:not(:first-of-type) {
  margin-top: 1.5rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-white);
}

.footer-col a {
  color: var(--color-white);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--color-gold);
  text-decoration: underline;
}

/* Redes sociales en línea */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.social-links li {
  margin-bottom: 0;
}

/* Fila Síguenos en + iconos */
.social-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.social-row span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
}

/* Iconos sociales con SVG inline en CSS */
.social-icon {
  display: block;
  width: 32px;
  height: 32px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.social-icon:hover {
  opacity: 1;
}

.social-icon--facebook {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z'/%3E%3C/svg%3E");
}

.social-icon--twitter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E");
}

.social-icon--youtube {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E");
}

.social-icon--instagram {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z'/%3E%3C/svg%3E");
}

.footer-079 {
  display: block;
  margin: 1.5rem auto 0;
}




.credencial {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}



/* HEADER */
.credencial__header {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  font-weight: bold;
  font-size: 0.8rem;
}

/* BODY */
.credencial__body {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  align-items: center;
}

.credencial__foto {

  height: 100px;
  object-fit: cover;
  background: #ccc;
}

.credencial__info h3 {
  font-size: 1rem;
  margin: 0;
}

.credencial__info p {
  font-size: 0.8rem;
  margin: 0;
}

/* AREA */
.credencial__area {
  padding: .2rem 1rem;
  line-height: 1;
}

.credencial__area small {
  color: green;
  font-size: 0.7rem;
}

/* TIPO */
.credencial__tipo {
  position: relative;
  margin-top: auto;

  background: #8bd100;
  color: white;
  text-align: center;

  font-size: 2rem;
  font-weight: bold;
  overflow: hidden;
  line-height: 1;
}

.credencial__tipo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 100%;
  background:#004668;

}

/* REVERSO */
.reverso {
  background: #fff;
  background: var(--color-white);
  transform: rotateY(180deg);
}

.credencial__top {
  background: #8bd100;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.credencial__top span {
  text-transform: uppercase;
  font-weight: 700;
}

.reverso__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.8rem 0.85rem;
  flex: 1;
}

.reverso__section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reverso__label_titulo{
  color: #8bd100;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reverso__label {
  color: gray;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reverso__signature-box {
  min-height: 44px;
  background: #f1f1f1;
  border: 1px solid #dcdcdc;
  border-radius: 0.6rem;
}

.reverso__signature-box--large {
  min-height: 64px;
}

.reverso__footer {
  background: #003146;
  padding: 0.75rem 0.85rem 0.9rem;
}

.credencial__barcode-footer {
  background: #004668;

  padding: .8rem 1rem;

  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.barcode {
  width: 95px;
  height: auto;

  background: white;

  padding: .2rem;
}

/* CONTENEDOR CON PERSPECTIVA */
.credencial__wrapper {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  padding-bottom: 1rem;
  transform-style: preserve-3d;
}

/* TARJETA */
.credencial__card {
  position: relative;
  width: 320px;
  height: 480px;

  transform-style: preserve-3d;

  transition: transform 0.8s ease;

  will-change: transform;

  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ESTADO VOLTEADO */
.credencial__card.is-flipped {
  transform: rotateY(180deg);
}

.credencial__card.is-flipped .frente {
  pointer-events: none;
}

/* CARAS */
.credencial__lado {
  position: absolute;

  inset: 0;

  display: flex;
  flex-direction: column;

  width: 100%;
  height: 100%;

  background: var(--color-white);

  border-radius: 10px;
  border: 1px solid #ccc;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  transform-style: preserve-3d;
}

/* FRENTE */
.frente {
  background:var(--color-white);
}

/* REVERSO */
.reverso {
  background: var(--color-white);
  transform: rotateY(180deg);
}



/* ==================== RESPONSIVE ==================== */

/* Responsive: ajustar para móviles */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .footer {
    text-align: left;
  }

  .footer-logo {
    margin-bottom: 1.5rem;
  }

  /* colapso */
  .footer-col--collapsible {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
  }

  .footer-col--collapsible h4 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin: 0;
    text-align: left;
  }

  .footer-col--collapsible h4::after {
    content: "v"; /* Flecha hacia abajo */
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    transform: rotate(90deg);
  }

  .footer-col--collapsible.is-open h4::after {
    transform: rotate(180deg);
  }

  .footer-col--collapsible ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .footer-col--collapsible.is-open ul {
    max-height: 500px;
    padding-bottom: 1rem;
  }

  /* Columna social */
  .footer-col--social {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.5rem;
    margin-top: 0;
  }

  .footer-col--social h4 {
    text-align: left;
    margin-bottom: 1.5rem;
  }

  .social-row {
    margin-bottom: 1rem;
  }
  
  .footer-col h4 {
    text-align: left;
  }
  
  .social-links {
    justify-content: flex-start;
  }
}


/* Móviles (hasta 480px) */
@media screen and (max-width: 480px) {
    .footer {
        padding: 1.2rem 0.8rem;
    }
    
    .footer p {
        font-size: 0.8rem;
    } 
    .credencial__card {
      width: min(90vw, 320px);
    }
  .card {
    padding: 1rem;
  }

  .credencial__body {
    gap: .6rem;
    padding: .8rem;
  }

  .credencial__foto {
    width: 75px;
    height: 90px;
  }

  .credencial__info h3 {
    font-size: .9rem;
  }

  .credencial__info p {
    font-size: .7rem;
  }

  .credencial__tipo {
    padding: .6rem 0;
  }

  .credencial__area {
    padding: .2rem .7rem;
  }

  .credencial__area p {
    font-size: 1rem;
  }

  .credencial__top {
    font-size: .7rem;
  }

  .firma {
    height: 30px;
    margin: .8rem;
  }

  .barcode {
    height: 40px;
  }

  .header__container {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .header__hamburger {
    display: flex;
  }

  .header__nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.75rem;
  }

  .header__nav.is-open {
    display: flex;
  }

  .header__nav .header__link {
    padding: 0.6rem 0.6rem;
    width: 100%;
  }

}

/* Móviles pequeños (hasta 380px) */
@media screen and (max-width: 390px) {
    .footer {
        padding: 1rem 0.6rem;
    }
    
    .footer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
}
@media screen and (max-width: 380px) and (orientation: portrait) {
    .footer {
        padding: 1rem 0.6rem;
    }
    
    .footer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    .credencial__tipo {
      font-size: 1.5rem;
    }

}
@media screen and (max-width: 370px) and (orientation: portrait) {
    .footer {
        padding: 1rem 0.6rem;
    }
    
    .footer p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    .credencial__tipo {
      font-size: .5rem;
    }

}
/* Landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .footer {
        padding: 0.6rem 1.5rem;
    }
}

/* ==================== SWEETALERT2 CUSTOM ==================== */

.swal2-popup {
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border-top: 4px solid var(--color-primary);
}

.swal2-title {
  color: var(--color-primary);
  font-size: 1.3rem;
  font-weight: 700;
}

.swal2-html-container {
  color: var(--color-text);
  font-size: 0.95rem;
}

.swal2-confirm.swal2-styled {
  background: var(--color-primary) !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: 0.65rem 2rem;
  box-shadow: none !important;
}

.swal2-confirm.swal2-styled:hover {
  background: var(--color-primary-light) !important;
}

.swal2-confirm.swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(97, 18, 50, 0.3) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: var(--color-success);
}

.swal2-icon.swal2-success [class^="swal2-success-line"] {
  background-color: var(--color-success);
}

.swal2-icon.swal2-error {
  border-color: var(--color-error);
}

.swal2-icon.swal2-error .swal2-x-mark-line-left,
.swal2-icon.swal2-error .swal2-x-mark-line-right {
  background-color: var(--color-error);
}

.swal2-icon.swal2-info {
  border-color: var(--color-primary);
  color: var(--color-primary);
}