/* =====================================================================
   Misión Caleb 2027 - Hoja de Estilos Oficial y Sistema de Diseño
   Paleta extraída de Caleb.jpeg, Caleb2.jpeg y caleb_favicon.png
   ===================================================================== */

:root {
  --caleb-dark: #002340;
  --caleb-navy: #003658;
  --caleb-primary: #014e7a;
  --caleb-blue: #016b95;
  --caleb-cyan: #06719b;
  --caleb-accent: #f59e0b;
  --caleb-accent-hover: #d97706;
  --caleb-accent-glow: rgba(245, 158, 11, 0.35);
  --caleb-surface: #ffffff;
  --caleb-surface-alt: #f8fafc;
  --caleb-border: #e2e8f0;
  --caleb-text: #0f172a;
  --caleb-muted: #475569;
  --caleb-success: #10b981;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--caleb-text);
  background: linear-gradient(135deg, #f0f5fa 0%, #e2ecf5 50%, #d8e5f0 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Fondo decorativo con ondas y partículas sutiles */
.bg-caleb-mesh {
  background-color: #002340;
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 113, 155, 0.45) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(1, 107, 149, 0.4) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(0, 35, 64, 0.95) 0px, transparent 50%);
}

.gradient-caleb {
  background: linear-gradient(135deg, var(--caleb-navy) 0%, var(--caleb-primary) 50%, var(--caleb-cyan) 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
}

.gradient-card-header {
  background: linear-gradient(90deg, rgba(1, 78, 122, 0.08) 0%, rgba(6, 113, 155, 0.03) 100%);
}

/* Elevación y Efecto Glassmorphism */
.caleb-card {
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 10px 30px -5px rgba(0, 35, 64, 0.08), 0 4px 6px -2px rgba(0, 35, 64, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.caleb-glass {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Inputs y Controles */
.caleb-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  font-size: 0.95rem;
  color: #1e293b;
  transition: all 0.2s ease;
}

.caleb-input:focus {
  outline: none;
  border-color: var(--caleb-blue);
  box-shadow: 0 0 0 4px rgba(1, 107, 149, 0.15);
  background-color: #ffffff;
}

.caleb-input:read-only {
  background-color: #f1f5f9;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* Zona de Carga de Archivos (Drag & Drop) */
.dropzone-container {
  border: 2px dashed #94a3b8;
  border-radius: 0.875rem;
  background-color: #f8fafc;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.dropzone-container:hover, .dropzone-container.dragover {
  border-color: var(--caleb-cyan);
  background-color: #f0f7fb;
  box-shadow: 0 0 0 4px rgba(6, 113, 155, 0.1);
}

.dropzone-container.has-file {
  border-color: var(--caleb-success);
  background-color: #f0fdf4;
}

/* Botones */
.btn-caleb-primary {
  background: linear-gradient(135deg, var(--caleb-navy) 0%, var(--caleb-blue) 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 0.85rem 1.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px 0 rgba(1, 78, 122, 0.35);
  transition: all 0.25s ease;
}

.btn-caleb-primary:hover {
  background: linear-gradient(135deg, var(--caleb-dark) 0%, var(--caleb-primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(1, 78, 122, 0.45);
}

.btn-caleb-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: #002340;
  font-weight: 800;
  padding: 0.95rem 2rem;
  border-radius: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 16px 0 rgba(245, 158, 11, 0.4);
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}

.btn-caleb-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px 0 rgba(245, 158, 11, 0.55);
  filter: brightness(1.05);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  font-weight: 700;
  padding: 0.85rem 1.5rem;
  border-radius: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 14px 0 rgba(37, 211, 102, 0.4);
  transition: all 0.25s ease;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px 0 rgba(37, 211, 102, 0.55);
}

/* Tarjetas de Selección Interactiva (Kits y Opciones) */
.option-card {
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.1rem;
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.option-card:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--caleb-blue);
  background-color: #f0f7fb;
  box-shadow: 0 4px 12px rgba(1, 107, 149, 0.12);
}

.option-card.fixed-option {
  border-color: var(--caleb-primary);
  background: linear-gradient(135deg, rgba(1, 78, 122, 0.05) 0%, rgba(6, 113, 155, 0.08) 100%);
  cursor: default;
}

/* Etiquetas / Tags de Cargos */
.cargo-tag {
  background: linear-gradient(135deg, #e2ecf5 0%, #d0e2f0 100%);
  color: var(--caleb-navy);
  border: 1px solid #b8d4e9;
  border-radius: 9999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  animation: fadeIn 0.2s ease-in-out;
}

.cargo-tag .remove-btn {
  color: #ef4444;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cargo-tag .remove-btn:hover {
  transform: scale(1.2);
}

/* Sticky Total Bar en móviles */
.sticky-total-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
  z-index: 40;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Clase utilitaria compatible con Tailwind config personalizado */
.animate-fadeIn {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}

.pulse-whatsapp {
  animation: pulseGlow 2.5s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* =====================================================================
   Preloader Corto Glassmorphism Oficial Caleb 2027
   ===================================================================== */
#caleb-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(1, 78, 122, 0.94) 0%, rgba(0, 35, 64, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
}

#caleb-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-glass-card {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2rem;
  padding: 2.25rem 2.75rem;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(6, 113, 155, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: preloaderCardIn 0.45s ease-out forwards;
}

.preloader-logo-ring {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.preloader-glow-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, rgba(6, 113, 155, 0.25) 50%, transparent 75%);
  animation: haloPulse 2s ease-in-out infinite;
  filter: blur(10px);
}

.preloader-spinner-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: preloaderSpin 1.4s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.preloader-progress-bar {
  width: 150px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1.1rem;
  position: relative;
}

.preloader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06719b 0%, #38bdf8 40%, #f59e0b 80%, #fbbf24 100%);
  border-radius: 999px;
  animation: progressFill 0.9s ease-in-out forwards;
}

@keyframes preloaderCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes preloaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes haloPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes progressFill {
  0% { width: 0%; }
  60% { width: 70%; }
  100% { width: 100%; }
}

/* =====================================================================
   Estilos de Impresión para el Comprobante de Registro
   ===================================================================== */
@media print {
  /* Ocultar todo excepto el modal de éxito */
  body > *:not(#successModal) {
    display: none !important;
  }
  #successModal {
    position: static !important;
    background: none !important;
    backdrop-filter: none !important;
    display: block !important;
    padding: 0 !important;
  }
  #successModal > div {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    max-width: 100% !important;
  }
  #closeModalBtn,
  .sticky-total-bar,
  header,
  footer,
  .btn-whatsapp {
    display: none !important;
  }
  .pulse-whatsapp {
    animation: none !important;
  }
}

/* Tipografía oficial: Montserrat Bold en todas las páginas. */
body, input, select, textarea, button, .font-heading {
  font-family: 'Montserrat', sans-serif;
}
body, body * {
  font-weight: 700 !important;
}
/* Mantener el peso requerido por los iconos de Font Awesome. */
body .fa-solid, body .fas { font-weight: 900 !important; }
body .fa-regular, body .far, body .fa-brands, body .fab { font-weight: 400 !important; }

/* Accesibilidad y pantallas pequeñas. */
:focus-visible { outline: 3px solid #0284c7; outline-offset: 3px; }
html { scroll-padding-top: 90px; }
#successModal > div { max-height: calc(100dvh - 2rem); overflow-y: auto; }
@media (max-width: 640px) { .caleb-input { font-size: 16px; } }
@media print {
  #successModal > div { max-height: none; overflow: visible; }
  #successModal button { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
