@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Estilos personalizados */
.login-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-shadow {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  @apply bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.btn-secondary {
  @apply bg-gray-600 hover:bg-gray-700 text-white font-medium py-2 px-4 rounded-lg transition-colors duration-200;
}

.input-field {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent;
}

.form-group {
  @apply mb-4;
}

.form-label {
  @apply block text-sm font-medium text-gray-700 mb-2;
}

.alert {
  @apply p-4 rounded-lg mb-4;
}

.alert-success {
  @apply bg-green-100 border border-green-400 text-green-700;
}

.alert-error {
  @apply bg-red-100 border border-red-400 text-red-700;
}

.alert-info {
  @apply bg-blue-100 border border-blue-400 text-blue-700;
}

/* UI helpers para formularios públicos */
.btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  border-radius: 9999px;
  animation: spin 0.8s linear infinite;
}
.btn-check {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background-color: #22c55e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-check::after {
  content: '';
  width: 0.5rem;
  height: 0.25rem;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
  margin-top: -1px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.bg-wpp {
  background-color: #4dd569;
  position: fixed;
  bottom: 24px; /* ~ right-6 */
  right: 24px; /* ~ bottom-6 */
  width: 56px; /* ~ w-14 */
  height: 56px; /* ~ h-14 */
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.notification-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #d23232;
  z-index: 101;
}
.notification-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: inherit;
  animation: wpp-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: -1;
}
@keyframes wpp-ping {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  70% {
    transform: scale(2.2);
    opacity: 0.2;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Grid responsivo para formularios públicos */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* Formulario compacto (inline) */
.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.inline-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.inline-field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

/* Responsive para formulario compacto */
@media (max-width: 768px) {
  .inline-form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .inline-field-wrapper {
    gap: 0.5rem;
  }
  
  .inline-field-label {
    white-space: normal;
  }
}

#promoPopup,
#lightbox {
  background: #696969a6;
}

.break-inside-avoid {
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
}

/* Masonry grid 2 columnas */
.masonry-grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Scroll suave global y compensación por header sticky */
html {
  scroll-behavior: smooth;
}
[id] {
  scroll-margin-top: 96px;
}
