/* === Estilos para validación de datos fiscales === */

/* Animación del punto de notificación */
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Punto de notificación en el menú hamburguesa */
.header-status-dot {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #ff6b6b;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-dot 2s ease-in-out infinite;
  z-index: 10;
}

/* Estados del campo con error */
.field-error {
  border-color: #ff6b6b !important;
  border-width: 2px !important;
  background-color: rgba(255, 107, 107, 0.05) !important;
  transition: all 0.3s ease;
}

.field-error:focus {
  border-color: #ff8787 !important;
  background-color: rgba(255, 107, 107, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1) !important;
}

/* Icono de advertencia en campos */
.field-warning-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  animation: warning-shake 0.5s ease-in-out;
}

@keyframes warning-shake {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }
  25% {
    transform: translateY(-50%) translateX(-4px);
  }
  75% {
    transform: translateY(-50%) translateX(4px);
  }
}

/* Contenedor de campos relativo para posicionar iconos */
.field-container {
  position: relative;
}

/* Badge de datos bloqueados */
#pcpLockBadge {
  margin: 10px 0;
  padding: 12px 16px;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

#pcpLockBadge b {
  display: block;
  margin-bottom: 4px;
  color: #ffc107;
}

#pcpUpgradeLink {
  color: #ffc107;
  text-decoration: underline;
  transition: opacity 0.2s;
}

#pcpUpgradeLink:hover {
  opacity: 0.8;
}

/* Botón dev reset */
#pcpDevResetBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99998;
  padding: 10px 14px;
  background: #ff6b6b;
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

#pcpDevResetBtn:hover {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#pcpDevResetBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Modal de confirmación mejorado */
#pcpFirstSaveModal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 18px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#pcpFirstSaveModal > div {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Preview de campos críticos en el modal */
#pcpCriticalPreview > div {
  transition: background-color 0.2s;
}

#pcpCriticalPreview > div:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Responsive: ajustes para móvil */
@media (max-width: 640px) {
  #pcpFirstSaveModal {
    padding: 12px;
  }

  #pcpFirstSaveModal > div {
    width: 100%;
    max-height: 92vh;
    padding: 16px;
  }

  #pcpDevResetBtn {
    bottom: 12px;
    right: 12px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .field-warning-icon {
    font-size: 14px;
    right: 6px;
  }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .header-status-dot,
  .field-warning-icon,
  #pcpFirstSaveModal,
  #pcpFirstSaveModal > div {
    animation: none !important;
  }

  * {
    transition: none !important;
  }
}

/* Dark mode (por si se implementa toggle) */
@media (prefers-color-scheme: light) {
  #pcpLockBadge {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    color: rgba(0, 0, 0, 0.87);
  }

  #pcpFirstSaveModal {
    background: rgba(255, 255, 255, 0.7);
  }

  #pcpFirstSaveModal > div {
    background: #fff;
    color: #000;
    border-color: rgba(0, 0, 0, 0.12);
  }
}

/* Tooltip mejorado para campos bloqueados */
input[disabled][title]::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input[disabled][title]:hover::after {
  opacity: 1;
}
