
/* [Object] Modal_custom
 * =============================== */
.modal_custom {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  text-align: left;
  background: rgba(0,0,0, .5);
  transition: opacity .25s ease;
}

.modal_custom_show {
    opacity: 0;
    visibility: visible !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    text-align: left;
    background: rgba(0,0,0, .5);
    transition: opacity .25s ease;
  }

.modal_custom__bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  cursor: pointer;
}

/* .modal_custom-state {
  display: none;
} */

.modal_custom-state:checked + .modal_custom {
  opacity: 1;
  visibility: visible;
}

.modal_custom-state:checked + .modal_custom .modal_custom__inner {
  top: 0;
}

.modal_custom__inner {
  transition: top .25s ease;
  position: absolute;
  top: -20%;
  right: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  margin: auto;
  overflow: auto;
  background: #fff;
  border-radius: 5px;
  padding: 1em 2em;
  height: 70%;
}

.modal_custom__close {
  position: absolute;
  right: 1em;
  top: 1em;
  width: 1.1em;
  height: 1.1em;
  cursor: pointer;
}

.modal_custom__close:after,
.modal_custom__close:before {
  content: '';
  position: absolute;
  width: 2px;
  height: 1.5em;
  background: #ccc;
  display: block;
  transform: rotate(45deg);
  left: 50%;
  margin: -3px 0 0 -1px;
  top: 0;
}

.modal_custom__close:hover:after,
.modal_custom__close:hover:before {
  background: #aaa;
}

.modal_custom__close:before {
  transform: rotate(-45deg);
}

@media screen and (max-width: 768px) {
	
  .modal_custom__inner {
    width: 90%;
    height: 90%;
    box-sizing: border-box;
  }
}


/* Other
 * =============================== */
body {
  padding: 1%;
  font: 1/1.5em sans-serif;
  text-align: center;
}

.btn {
  cursor: pointer;
  background: #27ae60;
  display: inline-block;
  padding: .5em 1em;
  color: #fff;
  border-radius: 3px;
}

.btn:hover,
.btn:focus {
  background: #2ecc71;
}

.btn:active {
  background: #27ae60;
  box-shadow: 0 1px 2px rgba(0,0,0, .2) inset;
}

.btn--blue {
  background: #2980b9;
}

.btn--blue:hover,
.btn--blue:focus {
  background: #3498db;
}

.btn--blue:active {
  background: #2980b9;
}


#videoElement {
  /* Estilo base del contenedor de video */
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: perspective(1000px) rotateY(0deg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Efecto de borde moderno */
  border: 4px solid #ffffff;
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: -8px;
  
  /* Filtros para mejorar la imagen */
  filter: 
    brightness(1.05) 
    contrast(1.1) 
    saturate(1.1);
  
  /* Efecto de reflejo (opcional) */
  position: relative;
  overflow: hidden;
}

#videoElement::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(
    to top, 
    rgba(255, 255, 255, 0.3) 0%, 
    rgba(255, 255, 255, 0) 100%
  );
  transform: scaleY(-1);
  opacity: 0.7;
  pointer-events: none;
}

/* Efecto hover interactivo */
#videoElement:hover {
  transform: perspective(1000px) rotateY(5deg) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Marco decorativo (opcional) */
.video-container {
  position: relative;
  padding: 12px;
  background: linear-gradient(145deg, #f0f0f0, #ffffff);
  border-radius: 24px;
  display: inline-block;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Indicador de reconocimiento activo */
.recognition-active {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.3);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}



/* Contenedor principal (fullscreen o tamaño fijo) */
.face-guide-container {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 380px;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}

/* Video ajustado al contenedor */
#videoElement {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(30%) contrast(1.1);
}

/* Marco de guía ovalado */
.guide-oval {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 300px;
  transform: translate(-50%, -50%);
  border: 3px dashed rgba(255, 255, 255, 0.7);
  border-radius: 50% 50% 45% 45%;
  pointer-events: none;
  box-shadow: 
    0 0 0 1000px rgba(0, 0, 0, 0.5), /* Sombra exterior */
    inset 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Instrucciones */
.instruction {
  position: absolute;
  bottom: 3%;
  left: 0;
  width: 100%;
  color: white;
  text-align: center;
  font-family: 'Arial', sans-serif;
  font-size: 1.2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  animation: blink 2s infinite;
}

/* Feedback dinámico */
.feedback-message {
  position: absolute;
  top: 20%;
  left: 0;
  width: 100%;
  color: #00ff88;
  text-align: center;
  font-weight: bold;
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Animaciones */
@keyframes blink {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Estado: Rostro detectado */
.face-detected .guide-oval {
  border-color: #00ff88;
  border-style: solid;
  box-shadow: 
    0 0 0 1000px rgba(0, 0, 0, 0.5),
    inset 0 0 30px rgba(0, 255, 136, 0.5);
}

.face-detected .feedback-message {
  content: "✓ Rostro detectado";
  opacity: 1;
}

/* Estado: Muy cerca/lejos */
.face-too-close .guide-oval {
  border-color: #ff5555;
  animation: pulse-alert 0.5s infinite;
}

.face-too-close .feedback-message {
  content: "¡Aléjate un poco!";
  color: #ff5555;
  opacity: 1;
}

@keyframes pulse-alert {
  0% { border-width: 3px; }
  50% { border-width: 5px; }
  100% { border-width: 3px; }
}



.countdown-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Arial', sans-serif;
}

.countdown-circle {
  position: relative;
  /* width: 90px;
  height: 90px;
  margin: 50px; */
}

.countdown-svg {
  transform: rotate(-90deg);
}

.countdown-circle-bg {
  fill: none;
  stroke: #f3f3f3;
  stroke-width: 6;
}

.countdown-circle-fill {
  fill: none;
  stroke: #4CAF50;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.292; /* 2πr (2 * 3.1416 * 54) */
  stroke-dashoffset: 0;
  animation: countdown 100s linear forwards;
}

.countdown-number {
  position: absolute;
  /* top: 50%;
  left: 50%; */
  top: 10%;
  left: 92%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
}

.countdown-text {
  font-size: 1.2rem;
  color: #666;
  margin-top: 15px;
  text-align: center;
}

@keyframes countdown {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 339.292;
  }
}





  

  .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
  }

  .modal-container {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(10px);
      border-radius: 20px;
      box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
      width: 600px;
      max-width: 95%;
      padding: 40px;
      animation: modalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes modalFadeIn {
      from { opacity: 0; transform: translateY(-30px) scale(0.95); }
      to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 10px;
  }
  
  .logo-container {
      flex: 1;
      display: flex;
      justify-content: center;
      padding-left: 24px; /* offset the close button width to keep logo centered */
  }

  .modal-logo {
      height: 75px;
      object-fit: contain;
  }

  .modal-text-section {
      text-align: center;
      margin-bottom: 40px;
  }

  .modal-title {
      font-size: 1.75rem;
      font-weight: 700;
      color: #2c3e50;
      margin-bottom: 10px;
  }
  
  .modal-subtitle {
      font-size: 1.05rem;
      color: #64748b;
      line-height: 1.5;
      margin: 0;
  }

  .close-btn {
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      color: #777;
      transition: color 0.2s;
  }

  .close-btn:hover {
      color: #333;
  }

  .code-input-container {
      display: flex;
      justify-content: space-between;
      margin-bottom: 25px;
  }

  .code-block {
      width: 22%;
      position: relative;
  }

  .code-input {
      width: 100%;
      height: 75px;
      text-align: center;
      font-size: 2rem;
      font-weight: bold;
      border: 2px solid #ddd;
      border-radius: 8px;
      outline: none;
      transition: all 0.3s;
  }

  .code-input:focus {
      border-color: #8e54e9;
      box-shadow: 0 0 0 4px rgba(102, 60, 193, 0.15);
  }

  .code-input.uppercase {
      text-transform: uppercase;
  }

  .dash {
      display: flex;
      align-items: center;
      font-size: 2.5rem;
      font-weight: bold;
      color: #999;
  }

  .modal-footer {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
  }

  .btn {
      padding: 10px 20px;
      border-radius: 5px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
  }

  .btn-cancel {
      background-color: #f0f0f0;
      color: #555;
      border: 1px solid #ddd;
  }

  .btn-cancel:hover {
      background-color: #e0e0e0;
  }

  .btn-submit {
      background: linear-gradient(135deg, #8e54e9 0%, #663cc1 100%);
      color: white;
      border: none;
      font-weight: 600;
      font-size: 1.25rem;
      padding: 16px 36px;
      letter-spacing: 0.5px;
      border-radius: 10px;
      box-shadow: 0 4px 15px rgba(102, 60, 193, 0.4);
      transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
      cursor: pointer;
      text-transform: uppercase;
      position: relative;
      overflow: hidden;
  }

  .btn-submit:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(102, 60, 193, 0.5);
      background: linear-gradient(135deg, #663cc1 0%, #8e54e9 100%);
  }
  
  .btn-submit:active:not(:disabled) {
      transform: translateY(1px);
      box-shadow: 0 2px 10px rgba(102, 60, 193, 0.4);
  }

  .btn-submit:disabled {
      background: #e0e0e0;
      color: #a0a0a0;
      box-shadow: none;
      cursor: not-allowed;
      transform: none;
  }
    


  

  .d-none-ct{
    display: none !important;
  }


  .body-code {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
  }

  /* Offline Mode Styling */
  body.offline-mode #isOnline {
      color: #e74c3c;
      font-weight: bold;
      animation: pulseOffline 2s infinite;
  }

  body.offline-mode .fa-wifi-slash {
      color: #e74c3c !important;
      animation: pulseOffline 2s infinite;
  }

  body.offline-mode::after {
      content: "Sin conexión a internet";
      position: fixed;
      bottom: 20px;
      right: 20px;
      background: #e74c3c;
      color: white;
      padding: 12px 24px;
      border-radius: 8px;
      font-weight: bold;
      box-shadow: 0 4px 15px rgba(231,76,60,0.4);
      z-index: 9999;
      animation: slideUpOffline 0.3s ease;
  }

  @keyframes pulseOffline {
      0% { opacity: 1; }
      50% { opacity: 0.5; }
      100% { opacity: 1; }
  }
  
  @keyframes slideUpOffline {
      from { transform: translateY(50px); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
  }

  .offline-sync-message {
      display: none;
      background-color: #f8d7da;
      color: #721c24;
      padding: 10px 0;
      font-size: 1rem;
      font-weight: 500;
      border-bottom: 1px solid #f5c6cb;
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  body.offline-mode .offline-sync-message {
      display: block;
      animation: slideDownSync 0.4s ease;
  }

  @keyframes slideDownSync {
      from { transform: translateY(-20px); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
  }