/* 
  Estilos para la página de login moderna y step-by-step.
  Colores institucionales CAZEL
*/

/* =========================
   COLORES INSTITUCIONALES CAZEL
   ========================= */
:root {
  /* Colores Principales CAZEL - Solo rojos y neutros */
  --cazel-primary: #730111;             /* Rojo principal CAZEL */
  --cazel-primary-light: #5a0d0e;       /* Rojo medio */
  --cazel-primary-dark: #41090b;        /* Rojo oscuro */
  --cazel-accent-light: #f8f9fa;        /* Gris muy claro */
  --cazel-accent: #e9ecef;              /* Gris claro */
  --cazel-neutral: #6c757d;             /* Gris medio */
  --cazel-dark: #1a1a1a;               /* Negro corporativo */
  --cazel-success: #28a745;             /* Verde éxito */
  --cazel-warning: #ffc107;             /* Amarillo advertencia */
  --cazel-danger: #dc3545;              /* Rojo peligro */
  
  /* Override Tabler variables with CAZEL colors */
  --tblr-primary: var(--cazel-primary);
  --tblr-primary-rgb: 115, 1, 17;
  --tblr-secondary: var(--cazel-neutral);
  --tblr-secondary-rgb: 108, 117, 125;
}

.page-center {
  background: var(--cazel-accent-light);
  min-height: 100vh;
}

.card {
  box-shadow: 0 10px 30px rgba(115, 1, 17, 0.15);
  border: none;
  border-radius: 12px;
  background: white;
}

/* =========================
   INPUT WITH KEYBOARD BUTTON
   ========================= */
.input-with-keyboard {
  position: relative;
  display: block;
}

.input-with-keyboard .form-control {
  border-radius: 8px;
  border: 2px solid var(--tblr-border-color);
  transition: all 0.3s ease;
  /* No padding-right adicional - se mantendrá el tamaño original */
}

.input-with-keyboard .form-control:focus {
  border-color: var(--cazel-primary);
  box-shadow: 0 0 0 0.2rem rgba(200, 16, 46, 0.25);
}

.keyboard-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--cazel-primary);
  color: white;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  /* Mejorar accesibilidad */
  outline: none;
  border: 2px solid transparent;
  /* Asegurar que esté bien centrado */
  font-size: 14px;
  font-weight: 600;
}

.keyboard-btn:hover {
  background: var(--cazel-primary-dark);
  transform: translateY(-50%) scale(1.05);
}

.keyboard-btn:focus {
  border-color: var(--cazel-primary-light);
  box-shadow: 0 0 0 2px rgba(115, 1, 17, 0.3);
}

.keyboard-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Ajustes específicos para diferentes alturas de input */
.input-with-keyboard .form-control[style*="height: 38px"] + .keyboard-btn,
.input-with-keyboard .form-control:not([style*="height"]) + .keyboard-btn {
  width: 32px;
  height: 32px;
  right: 3px;
}

.input-with-keyboard .form-control[style*="height: 44px"] + .keyboard-btn {
  width: 38px;
  height: 38px;
  right: 3px;
}

.input-with-keyboard .form-control[style*="height: 45px"] + .keyboard-btn {
  width: 39px;
  height: 39px;
  right: 3px;
}

/* Proteger el espacio del botón sin modificar el input */
.input-with-keyboard .form-control {
  padding-right: 46px; /* Espacio para el botón más grande */
}

/* =========================
   DISPOSITIVOS GUARDADOS
   ========================= */
#saved-devices-container {
  display: none;
  margin-bottom: 1rem;
}

.saved-devices-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.device-card {
  background: white;
  border: 2px solid var(--cazel-accent);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.device-card:hover {
  background: rgba(115, 1, 17, 0.02);
  border-color: var(--cazel-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(115, 1, 17, 0.15);
}

.device-card.swiping {
  transform: translateX(var(--swipe-distance, 0px)) scale(0.98);
  background: #ffe6e6;
  border-color: #ff4757;
  box-shadow: 0 2px 16px rgba(255, 71, 87, 0.3);
}

.device-card-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.device-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--cazel-primary) 0%, #1a1a1a 100%);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(115, 1, 17, 0.2);
  font-size: 1.1rem;
}

.device-info {
  flex: 1;
  min-width: 0;
}

.device-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cazel-primary);
  margin-bottom: 0.25rem;
}

.device-user {
  font-size: 0.75rem;
  color: var(--cazel-neutral);
  font-weight: 400;
}

.device-date {
  font-size: 0.75rem;
  color: var(--cazel-neutral);
  text-align: right;
  flex-shrink: 0;
}

.device-swipe-action {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: var(--cazel-danger);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.device-card.swipe-delete .device-swipe-action {
  right: 10px;
}

/* Dropdown para nuevo dispositivo */
.device-dropdown {
  position: relative;
}

.device-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
}

.device-dropdown.show .device-dropdown-content {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.5rem;
}

/* When dropdown is open by default (no saved devices) */
.device-dropdown.show .device-dropdown-content {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.5rem;
}

/* Default open state for new users */
.device-dropdown .device-dropdown-content[style*="display: block"] {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.5rem;
}

.device-dropdown.show #new-device-btn svg:last-child {
  transform: rotate(180deg);
}

/* Button state when acting as header (no devices) */
.device-dropdown.show #new-device-btn {
  background: var(--cazel-primary);
  color: white;
  border-color: var(--cazel-primary);
}

#new-device-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  color: var(--cazel-neutral);
}

#new-device-btn:hover {
  background: var(--cazel-accent-light);
  border-color: var(--cazel-primary);
  color: var(--cazel-primary);
}

/* Hover override when button is in open state */
.device-dropdown.show #new-device-btn:hover {
  background: var(--cazel-primary-light);
  color: white;
  border-color: var(--cazel-primary-light);
}

/* Responsive para dispositivos */
@media (max-width: 768px) {
  .device-card-content {
    gap: 0.5rem;
  }
  
  .device-icon {
    width: 36px;
    height: 36px;
  }
  
  .device-name {
    font-size: 0.85rem;
  }
  
  .device-hwid {
    font-size: 0.75rem;
  }
}

/* =========================
   PHONE HELP DROPDOWN
   ========================= */
.phone-help-dropdown {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 248, 225, 0.3);
}

.dropdown-header {
  padding: 0.75rem;
  cursor: pointer;
  background: rgba(255, 248, 225, 0.5);
  transition: background-color 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.dropdown-header:hover {
  background: rgba(255, 248, 225, 0.7);
}

.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0;
  background: rgba(255, 248, 225, 0.2);
  border-top: 1px solid transparent;
}

.dropdown-content.show {
  max-height: 300px;
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 193, 7, 0.3);
}

.chevron-icon {
  transition: transform 0.3s ease;
}

.dropdown-header.active .chevron-icon {
  transform: rotate(180deg);
}

/* =========================
   OVERLAYS Y MODALES INSTITUCIONALES
   ========================= */
.spacer-for-centering {
  width: 120px;
  flex-shrink: 0;
}

.tooltip-help {
  cursor: help;
}

/* =========================
   AUTH METHODS DROPDOWN
   ========================= */
.auth-method-option {
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
  border: 2px solid transparent;
}

.auth-method-option:hover {
  background: rgba(115, 1, 17, 0.05);
  border-color: rgba(115, 1, 17, 0.2);
}

.auth-method-option.active {
  background: rgba(115, 1, 17, 0.1);
  border-color: var(--cazel-primary);
}

.auth-method-option.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.auth-method-option.disabled:hover {
  background: transparent;
  border-color: transparent;
}

.method-icon-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--cazel-primary);
  color: white;
  border-radius: 6px;
  flex-shrink: 0;
}

.auth-method-option.active .method-icon-small {
  background: var(--cazel-primary-dark);
}

.method-status-indicator {
  margin-left: auto;
}

.auth-methods-modal {
  max-width: 420px;
}

.auth-methods-modal .auth-methods-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85); /* Fondo blanco suave en lugar de negro */
  -webkit-backdrop-filter: blur(8px); /* Safari support */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  padding: 1rem;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-container {
  transform: translateY(20px) scale(0.9);
  transition: transform 0.3s ease;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-overlay.show .modal-container {
  transform: translateY(0) scale(1);
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loading-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.error-icon {
  background: rgba(220, 53, 69, 0.1);
  color: var(--cazel-danger);
}

.success-icon {
  background: rgba(40, 167, 69, 0.1);
  color: var(--cazel-success);
}

.warning-icon {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.modal-title {
  color: var(--cazel-dark);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.loading-title {
  color: var(--cazel-dark);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-message, .loading-message {
  color: var(--cazel-neutral);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Loader CAZEL personalizado */
.loader-cazel {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(200, 16, 46, 0.2);
  border-left: 4px solid var(--cazel-primary);
  border-radius: 50%;
  animation: spin-cazel 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin-cazel {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Botones institucionales CAZEL */
.btn-cazel-primary {
  background: var(--cazel-primary);
  border: 2px solid var(--cazel-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-cazel-primary:hover {
  background: var(--cazel-primary-dark);
  border-color: var(--cazel-primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(115, 1, 17, 0.3);
}

.btn-cazel-secondary {
  background: transparent;
  border: 2px solid var(--cazel-neutral);
  color: var(--cazel-neutral);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-cazel-secondary:hover {
  background: var(--cazel-neutral);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.method-info {
  flex: 1;
}

.method-info h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tblr-body-color);
}

.method-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tblr-muted);
}

.method-status {
  display: flex;
  align-items: center;
}

/* =========================
   OTP METHOD BUTTONS
   ========================= */
.otp-methods {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.otp-method-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  border: 2px solid var(--tblr-border-color);
  border-radius: 8px;
  background: var(--tblr-bg-surface);
  color: var(--tblr-body-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  font-weight: 500;
}

.otp-method-btn:hover {
  border-color: var(--cazel-primary);
  background: rgba(115, 1, 17, 0.1);
  color: var(--cazel-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(115, 1, 17, 0.15);
}

.otp-method-btn.active {
  border-color: var(--cazel-primary);
  background: var(--cazel-primary);
  color: white;
}

/* Ajustar grid para 3 métodos OTP */
.otp-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 575px) {
  .otp-methods {
    grid-template-columns: repeat(1, 1fr);
    gap: 0.75rem;
  }
}

/* =========================
   AUTH FORMS
   ========================= */

#auth-forms {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-form {
  display: none;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
}

.auth-form.active {
  display: flex;
  flex-direction: column;
}

.auth-step {
  display: none;
}

.auth-step.active {
  display: block;
  width: 100%;
}

/* =========================
   OTP SPECIFIC STYLES
   ========================= */
.otp-input {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5rem;
  padding: 1rem !important;
}

.otp-info {
  background: var(--tblr-bg-surface-secondary);
  border-radius: 6px;
  padding: 0.75rem;
}

.countdown {
  font-weight: 600;
  color: var(--tblr-primary);
  font-size: 0.9rem;
}

.countdown.expired {
  color: var(--tblr-danger);
}

.countdown.warning {
  color: var(--cazel-warning);
  animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* =========================
   HANDHELD LOGIN STYLES (Credencial Laboral)
   ========================= */
.handheld-icon-container,
.handheld-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cazel-accent-light), var(--cazel-accent));
  margin-bottom: 1rem;
}

.handheld-icon-container svg,
.handheld-pin-icon svg {
  width: 48px;
  height: 48px;
}

.handheld-pin-info {
  background: var(--tblr-bg-surface-secondary);
  border-radius: 6px;
  padding: 0.75rem;
}

.pin-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.75rem;
  padding: 1rem !important;
}

.pin-input::placeholder {
  letter-spacing: 0.5rem;
  opacity: 0.5;
}

/* Handheld PIN Compact View */
.handheld-pin-compact {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.handheld-pin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.handheld-pin-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cazel-primary);
}

.pin-input-large {
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 1rem;
  padding: 1.5rem !important;
  border: 2px solid var(--cazel-primary);
  border-radius: 12px;
  background: white;
}

.pin-input-large:focus {
  outline: none;
  border-color: var(--cazel-primary);
  box-shadow: 0 0 0 4px rgba(115, 1, 17, 0.15);
}

.pin-input-large::placeholder {
  letter-spacing: 0.5rem;
  opacity: 0.3;
}

/* Handheld method badge */
#handheld-form .badge.bg-info {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
}

/* =========================
   TECLADO VIRTUAL FLOTANTE OPTIMIZADO PARA DESKTOP
   ========================= */
.virtual-keyboard {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.virtual-keyboard.show {
  opacity: 1;
}

.virtual-keyboard-modal {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 650px; /* Aumentado para acomodar teclado QWERTY completo */
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.virtual-keyboard.show .virtual-keyboard-modal {
  transform: scale(1);
}

/* Hide virtual keyboard on mobile devices */
/* Use multiple detection methods: screen size, touch capability, and pointer coarse */
@media (max-width: 768px) {
  .keyboard-btn {
    display: none !important;
  }
  
  .virtual-keyboard {
    display: none !important;
  }
}

/* Also hide on touch devices regardless of screen size */
@media (hover: none) and (pointer: coarse) {
  .keyboard-btn {
    display: none !important;
  }
  
  .virtual-keyboard {
    display: none !important;
  }
}

/* Hide on tablets in portrait mode */
@media (max-width: 1024px) and (orientation: portrait) {
  .keyboard-btn {
    display: none !important;
  }
  
  .virtual-keyboard {
    display: none !important;
  }
}

.keyboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--cazel-accent);
  width: 100%;
}

.keyboard-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}

.keyboard-close {
  background: var(--cazel-danger);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  font-weight: bold;
}

.keyboard-close:hover {
  background: var(--cazel-primary-dark);
  transform: scale(1.05);
}

/* Contenedor principal para el teclado QWERTY, usa Flexbox para las filas */
.keyboard-container {
  display: flex;
  flex-direction: column;
  gap: 8px; /* Espacio entre filas */
  width: 100%;
}

/* Cada fila del teclado */
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 8px; /* Espacio entre teclas */
}

/* Estilos específicos para teclado numérico */
.keyboard-display {
  width: 100%;
  height: 50px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 15px;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 15px;
  background: #f8fafc;
}

.keyboard-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 15px;
}

.keyboard-grid.numeric {
  grid-template-columns: repeat(3, 1fr);
}

.keyboard-key {
  height: 50px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 45px; /* Ancho mínimo para teclas QWERTY */
  flex: 1; /* Permite que las teclas crezcan proporcionalmente */
}

.keyboard-key:hover {
  background: #e2e8f0;
  transform: scale(1.05);
}

.keyboard-key:active {
  transform: scale(0.95);
}

.keyboard-key.wide {
  flex: 1.5; /* Teclas anchas como borrar y confirmar */
  min-width: 70px;
}

.keyboard-key.spacebar {
  flex: 4; /* Barra espaciadora ocupa más espacio */
  min-width: 200px;
  background: #e0e7ff;
  color: #4f46e5;
  font-weight: 500;
}

.keyboard-key.spacebar:hover {
  background: #c7d2fe;
}

/* Ajustes específicos para filas del teclado QWERTY */
.keyboard-row.row-0 {
  /* Primera fila: Q W E R T Y U I O P - 10 teclas */
  justify-content: center;
}

.keyboard-row.row-1 {
  /* Segunda fila: A S D F G H J K L ⌫ - 10 teclas con borrar más ancha */
  justify-content: center;
}

.keyboard-row.row-2 {
  /* Tercera fila: Z X C V B N M - _ ✓ - 10 teclas con confirmar más ancha */
  justify-content: center;
}

.keyboard-row.row-3 {
  /* Cuarta fila: números 1-0 */
  justify-content: center;
}

.keyboard-actions {
  display: flex;
  gap: 10px;
}

.keyboard-action {
  flex: 1;
  height: 45px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.keyboard-cancel {
  background: #f1f5f9;
  color: #64748b;
}

.keyboard-cancel:hover {
  background: #e2e8f0;
}

.keyboard-confirm {
  background: var(--cazel-primary);
  color: white;
}

.keyboard-confirm:hover {
  background: var(--cazel-primary-dark);
}



/* =========================
   FORM CONTROLS
   ========================= */
.form-control {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  border-radius: 6px !important;
  padding: 0.75rem !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  border: 1px solid var(--tblr-border-color) !important;
  background-color: var(--tblr-bg-surface) !important;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
  min-height: 45px !important;
  height: 45px !important;
}

.form-control:focus {
  border-color: var(--tblr-primary) !important;
  box-shadow: 0 0 0 0.125rem rgba(var(--tblr-primary-rgb), 0.25) !important;
}

.input-group {
  width: 100% !important;
  display: flex !important;
  height: 45px !important;
  align-items: stretch !important;
}

.input-group .form-control {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  height: 45px !important;
}

.input-group .btn {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 0.75rem !important;
}

/* =========================
   OVERLAY STYLES
   ========================= */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.loading-overlay.show {
  opacity: 1;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 300px;
}

.loading-overlay .loader {
  width: 60px;
  height: 60px;
  border: 4px solid var(--tblr-primary);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1.2s linear infinite;
}

.loading-overlay .loading-message {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: var(--tblr-body-color);
  font-weight: 500;
}

.error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(220, 53, 69, 0.95);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.error-overlay.show {
  opacity: 1;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.error-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1.5rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.error-actions .btn {
  margin: 0 0.5rem;
}

@keyframes rotation {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   DARK MODE ADJUSTMENTS
   ========================= */
@media (prefers-color-scheme: dark) {
  .loading-overlay {
    background-color: rgba(32, 37, 42, 0.95);
  }
  
  .virtual-keyboard {
    background: var(--tblr-dark);
    border-top-color: var(--tblr-border-color-dark);
  }
}

/* Input group styling */
#loginForm .input-group {
  padding: 0.5rem 0.75rem !important;
  margin: 0 !important;
  vertical-align: top !important;
}

#loginForm .input-group-text {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-left: 0 !important;
  background-color: var(--tblr-bg-surface) !important;
  border: 1px solid var(--tblr-border-color) !important;
  border-left: none !important;
  height: 38px !important; /* Altura fija para el icono */
  display: flex !important;
  align-items: center !important;
  padding: 0 0.75rem !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

/* Botón de submit */
#loginForm .btn-primary {
  width: 100% !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.875rem !important;
  border-radius: 6px !important;
  transition: all 0.2s ease-in-out !important;
  -webkit-transform: none !important;
  transform: none !important;
}

#loginForm .btn-primary:active {
  -webkit-transform: translateY(1px) !important;
  transform: translateY(1px) !important;
}

/* ===== CORRECCIÓN ESPECÍFICA PARA CAMPO DE CONTRASEÑA ===== */

/* Override absoluto para el campo de contraseña en input-group */
#loginForm input#contrasena {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  line-height: 1.5 !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.875rem !important;
  border-radius: 6px 0 0 6px !important;
  border: 1px solid var(--tblr-border-color) !important;
  border-right: none !important;
  background-color: var(--tblr-bg-surface) !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  -webkit-transform: none !important;
  transform: none !important;
}

/* Asegurar que el input-group tenga altura fija */
#loginForm .input-group-flat {
  position: relative !important;
  height: 38px !important;
  display: flex !important;
  align-items: stretch !important;
  margin: 0 !important;
}

#loginForm .input-group-flat .form-control {
  padding-right: 50px !important; /* Espacio para el icono */
}

/* Override para el icono del campo de contraseña */
#loginForm .input-group-flat .input-group-text {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 38px !important;
  border: none !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 0.75rem !important;
  margin: 0 !important;
  min-width: 42px !important;
  z-index: 10 !important;
  cursor: pointer !important;
}

/* Icono dentro del input-group-text */
#loginForm .input-group-flat .input-group-text a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  text-decoration: none !important;
  color: var(--tblr-muted) !important;
}

#loginForm .input-group-flat .input-group-text a:hover {
  color: var(--tblr-body-color) !important;
}

/* SVG del icono */
#loginForm .input-group-flat .input-group-text svg {
  width: 18px !important;
  height: 18px !important;
  vertical-align: middle !important;
}

/* Mobile optimizations específicas para campo contraseña */
@media screen and (max-width: 767px) {
  #loginForm input#contrasena {
    font-size: 16px !important; /* Evita zoom en iOS */
    height: 44px !important; /* Touch target mínimo en móvil */
    min-height: 44px !important;
    max-height: 44px !important;
  }
  
  #loginForm .input-group-flat {
    height: 44px !important;
  }
  
  #loginForm .input-group-flat .form-control {
    padding-right: 54px !important; /* Más espacio en móvil */
  }
  
  #loginForm .input-group-flat .input-group-text {
    height: 44px !important;
    min-width: 48px !important; /* Botón más grande en móvil */
  }
}

/* =========================
   RECAPTCHA V3 FIX
   ========================= */
/* Fix reCAPTCHA v3 - Keep badge visible but prevent expansion */
.grecaptcha-badge {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  bottom: 14px !important;
  right: 14px !important;
  z-index: 1000 !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  transform: scale(0.8) !important;
  transform-origin: bottom right !important;
  transition: all 0.3s ease !important;
}

/* Prevent badge from expanding and affecting layout */
.grecaptcha-badge:hover {
  transform: scale(0.85) !important;
}

/* Ensure main content doesn't get pushed by reCAPTCHA */
body {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Hide the reCAPTCHA challenge popup when not needed */
iframe[title="recaptcha challenge expires in two minutes"] {
  visibility: hidden !important;
  opacity: 0 !important;
  position: fixed !important;
  bottom: -200px !important;
  right: -200px !important;
  z-index: -1 !important;
  width: 0 !important;
  height: 0 !important;
}

/* ===== PASSWORD TOGGLE ===== */
.password-input-container {
  position: relative;
  width: 100%;
}

.password-input-container .form-control {
  padding-right: 45px !important; /* Espacio para el botón */
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #495057 !important;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 10;
}

.password-toggle:hover {
  color: var(--cazel-primary) !important;
}

.password-toggle:focus {
  outline: none;
  color: var(--cazel-primary) !important;
}

.password-toggle i {
  font-size: 16px;
  color: inherit !important;
  opacity: 1 !important;
}

.password-toggle .toggle-icon {
  font-size: 18px;
  color: inherit !important;
  opacity: 1 !important;
  line-height: 1;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  color: inherit !important;
  stroke: currentColor !important;
}

/* ===== END PASSWORD TOGGLE ===== */

/* End of file */
