/* ==========================================
   RESET Y ANIMACIÓN DE FONDO (PARTÍCULAS)
   ========================================== */
* {
  box-sizing: border-box;
}

body {
  position: relative;
  background-color: #f4f6f9;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ==========================================
   TARJETA DE LOGIN
   ========================================== */
.login-card {
  position: relative;
  z-index: 10;
  background-color: #ffffff !important;
  border: none !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.03) !important;
  border-radius: 16px !important;
  width: 420px;
  max-width: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.login-header {
  background-color: #ffffff;
  padding-top: 30px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0;
  text-align: center;
}

.login-header > img:first-child {
  margin-bottom: 15px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 160px;
}

.header-icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  animation: floatIcon 4s ease-in-out infinite;
}

.header-logo-icon {
  width: 90px !important;
  height: 90px !important;
  object-fit: contain;
  filter: drop-shadow(0px 6px 8px rgba(46, 125, 50, 0.2));
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.login-header h3 {
  color: #2e7d32;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
}

.login-header p {
  color: #6c757d;
  font-size: 0.95rem;
  margin-bottom: 0;
  font-weight: 500;
}

.login-body {
  padding: 30px 35px 35px 35px !important;
  background-color: #ffffff;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #495057;
}

.input-group {
  border-radius: 8px;
  overflow: hidden;
}

.input-group-text {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-right: none;
  color: #2e7d32;
  padding: 0.65rem 0.9rem;
}

.form-control {
  border: 1px solid #dee2e6;
  border-left: none;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
}

.form-control:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.15);
}

#togglePassword {
  border-left: 1px solid #dee2e6 !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  background-color: #f8f9fa;
  color: #6c757d;
  transition: all 0.2s ease;
}

#togglePassword:hover {
  background-color: #e9ecef;
  color: #2e7d32;
}

.remember-forgot {
  font-size: 0.85rem;
}

.form-check-input:checked {
  background-color: #2e7d32;
  border-color: #2e7d32;
}

.btn-login {
  background-color: #2e7d32 !important;
  border-color: #2e7d32 !important;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 0.75rem;
}

.btn-login:hover {
  background-color: #1b5e20 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.35);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(46, 125, 50, 0.3);
}

#alertMessage {
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

#loginButton:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

/* Estilos para modal de recuperación */
.modal-content {
  border-radius: 16px;
  border: none;
}

.modal-header {
  background-color: #2e7d32;
  color: white;
  border-bottom: none;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-title {
  font-weight: 600;
}

#codigoVerificacionInput {
  letter-spacing: 2px;
  font-family: monospace;
  font-size: 1.2rem;
  text-align: center;
}

.ticket-folio {
  background: #e8f4fd;
  border-left: 4px solid #2e7d32;
  padding: 12px;
  border-radius: 8px;
  font-family: monospace;
  font-weight: bold;
  margin-top: 15px;
}

/* ── Wrapper login + QR (flexbox) ── */
.login-wrapper {
  display: flex !important;
  flex-direction: row !important;
  gap: 28px;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  z-index: 10;
  padding: 20px;
  width: auto;
  margin: 0 auto;
}
@media (max-width: 920px) {
  .login-wrapper {
    flex-direction: column !important;
    align-items: center;
    padding: 16px;
    gap: 20px;
    width: 100%;
  }
  .login-wrapper .login-card {
    width: 100%;
    max-width: 420px;
  }
  .login-wrapper #qrChecadorSection {
    width: 100% !important;
    max-width: 420px !important;
  }
  /* En celular se oculta el botón y la sección QR */
  #btnChecadorQR,
  #qrChecadorSection {
    display: none !important;
  }
}

/* ── Sección QR del Checador en login ── */
#btnChecadorQR {
  transition: all 0.3s ease;
}
#btnChecadorQR:hover {
  background-color: #006657 !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,102,87,0.25);
}

#qrChecadorSection {
  animation: fadeInQR 0.35s ease;
}
@keyframes fadeInQR {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#qrCodeContainerLogin img,
#qrCodeContainerLogin canvas {
  max-width: 100%;
  height: auto;
}