@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700;800&family=Barlow+Condensed:wght@600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --navy-950: #081730;
  --navy-900: #0E2247;
  --navy-800: #14305F;
  --navy-700: #1B3A6E;
  --navy-600: #24406B;
  --navy-500: #2C4A78;
  --navy-400: #3C567F;

  --texto: #22344F;
  --texto-medio: #48566A;
  --texto-suave: #5B6875;
  --texto-claro: #7A8799;
  --texto-navy-suave: #A9BBD3;
  --texto-navy-claro: #C9D4E4;
  --texto-navy-tenue: #9FB3CE;

  --amarillo: #F6B91A;
  --amarillo-claro: #FFD152;
  --amarillo-fondo: #FFF8E6;
  --amarillo-borde: #F0E2BC;
  --amarillo-oscuro: #C08A00;
  --amarillo-texto: #7A5600;

  --fondo: #F4F6F8;
  --blanco: #FFFFFF;
  --gris-100: #EEF2F7;
  --gris-200: #E3E9F1;
  --gris-300: #DCE3EC;
  --gris-400: #C3CDDB;

  --verde: #1F7A4C;
  --verde-fondo: #E4F2EA;
  --rojo: #B3261E;
  --rojo-fondo: #FBE7E5;

  --fuente-texto: 'Barlow', Helvetica, Arial, sans-serif;
  --fuente-titulo: 'Barlow Condensed', 'Barlow', sans-serif;
  --fuente-mono: 'IBM Plex Mono', monospace;

  --esp-1: 4px;
  --esp-2: 8px;
  --esp-3: 12px;
  --esp-4: 16px;
  --esp-5: 24px;
  --esp-6: 32px;
  --esp-7: 48px;
  --esp-8: 64px;
  --esp-9: 88px;

  --ancho-max: 1240px;
  --borde: 1px solid var(--gris-300);
  --sombra-md: 0 4px 18px rgba(14, 34, 71, 0.10);
  --sombra-lg: 0 14px 38px rgba(8, 23, 48, 0.22);
  --transicion: 160ms ease;

  --z-header: 50;
  --z-modal: 500;
  --z-toast: 900;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--fuente-texto);
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy-900);
  background-color: var(--fondo);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--amarillo); color: var(--navy-900); }

h1, h2, h3, h4 {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.02;
  color: var(--navy-900);
}

h1 { font-size: clamp(46px, 6.6vw, 88px); line-height: 0.96; }
h2 { font-size: clamp(36px, 4.6vw, 58px); }
h3 { font-size: clamp(24px, 2.6vw, 32px); }
h4 { font-size: 20px; line-height: 1.2; }

a {
  color: var(--navy-800);
  text-decoration: none;
  transition: color var(--transicion), background-color var(--transicion), border-color var(--transicion);
}

a:hover { color: var(--amarillo-oscuro); }

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

:focus-visible {
  outline: 3px solid var(--amarillo);
  outline-offset: 2px;
}

.contenedor {
  width: 100%;
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding-inline: var(--esp-5);
}

.seccion { padding-block: var(--esp-9); }
.seccion-navy { background: var(--navy-900); color: var(--blanco); }
.seccion-blanca { background: var(--blanco); }
.seccion-gris { background: var(--fondo); }
.seccion-amarilla { background: var(--amarillo); color: var(--navy-900); }
.seccion-navy h2,
.seccion-navy h3 { color: var(--blanco); }

.eyebrow {
  display: inline-block;
  font-family: var(--fuente-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amarillo-texto);
}

.eyebrow-claro { color: var(--amarillo); }
.eyebrow-navy { color: var(--navy-900); }

.oculto { display: none !important; }
.texto-centro { text-align: center; }
.texto-mono { font-family: var(--fuente-mono); }
.mono-num { font-variant-numeric: tabular-nums; }
.sr-solo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--esp-2);
  padding: 16px 28px;
  border: 2px solid transparent;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background-color var(--transicion), border-color var(--transicion), color var(--transicion);
}

.btn:disabled,
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-amarillo { background: var(--amarillo); color: var(--navy-900); }
.btn-amarillo:hover:not(:disabled) { background: var(--amarillo-claro); color: var(--navy-900); }

.btn-navy { background: var(--navy-900); color: var(--blanco); }
.btn-navy:hover:not(:disabled) { background: var(--navy-800); color: var(--blanco); }

.btn-linea {
  border-color: var(--navy-400);
  color: var(--blanco);
  font-weight: 700;
}

.btn-linea:hover:not(:disabled) { border-color: var(--amarillo); color: var(--amarillo); }

.btn-linea-navy {
  border-color: var(--navy-900);
  color: var(--navy-900);
  font-weight: 700;
}

.btn-linea-navy:hover:not(:disabled) { background: var(--navy-900); color: var(--blanco); }

.btn-sm { padding: 12px 20px; font-size: 13px; }
.btn-lg { padding: 18px 30px; font-size: 16px; }
.btn-bloque { width: 100%; }

.campo { display: flex; flex-direction: column; gap: 6px; }

.campo label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--texto-suave);
}

.campo input,
.campo select,
.campo textarea,
.input {
  width: 100%;
  min-width: 0;
  padding: 15px 16px;
  font-size: 15px;
  background: var(--blanco);
  border: 1px solid var(--gris-300);
  transition: border-color var(--transicion);
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus,
.input:focus {
  outline: none;
  border-color: var(--amarillo);
}

.campo textarea { resize: vertical; min-height: 110px; }

.campo-oscuro input,
.campo-oscuro select,
.campo-oscuro textarea {
  background: var(--navy-900);
  border-color: var(--navy-500);
  color: var(--blanco);
}

.campo-oscuro input::placeholder,
.campo-oscuro textarea::placeholder { color: var(--texto-navy-tenue); }
.campo-oscuro label { color: var(--texto-navy-suave); }

.campo-error input,
.campo-error select,
.campo-error textarea { border-color: var(--rojo); }
.mensaje-error { font-size: 13px; color: var(--rojo); }
.ayuda { font-size: 13px; color: var(--texto-suave); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--fuente-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-listo { background: var(--verde-fondo); color: var(--verde); }
.badge-cierra { background: var(--amarillo-fondo); color: var(--amarillo-texto); }
.badge-neutro { background: var(--gris-200); color: var(--texto-suave); }
.badge-alerta { background: var(--rojo-fondo); color: var(--rojo); }
.badge-navy { background: var(--navy-900); color: var(--amarillo); }

.progreso {
  width: 100%;
  height: 10px;
  background: var(--gris-200);
  overflow: hidden;
}

.progreso-barra {
  height: 100%;
  width: 0;
  background: var(--navy-900);
  transition: width 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.progreso-barra.completa { background: var(--verde); }
.progreso-barra.marca-propia { background: var(--amarillo); }

.progreso-datos {
  display: flex;
  justify-content: space-between;
  font-family: var(--fuente-mono);
  font-size: 12px;
  color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar { display: none; }

.stepper-etapa {
  flex: 1 0 auto;
  min-width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  text-align: center;
}

.stepper-etapa::before {
  content: '';
  position: absolute;
  top: 8px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--gris-300);
}

.stepper-etapa:first-child::before { display: none; }

.stepper-punto {
  width: 18px;
  height: 18px;
  background: var(--blanco);
  border: 2px solid var(--gris-300);
  position: relative;
  z-index: 1;
}

.stepper-nombre {
  font-family: var(--fuente-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texto-claro);
  line-height: 1.3;
}

.stepper-etapa.completada::before { background: var(--navy-900); }
.stepper-etapa.completada .stepper-punto { background: var(--navy-900); border-color: var(--navy-900); }
.stepper-etapa.completada .stepper-nombre { color: var(--texto-suave); }

.stepper-etapa.actual::before { background: var(--navy-900); }
.stepper-etapa.actual .stepper-punto { background: var(--amarillo); border-color: var(--amarillo); }
.stepper-etapa.actual .stepper-nombre { color: var(--navy-900); font-weight: 700; }

.tabla-envoltorio { width: 100%; overflow-x: auto; }

.tabla {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--blanco);
}

.tabla th {
  text-align: left;
  padding: 18px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--texto-suave);
  border-bottom: 2px solid var(--navy-900);
  white-space: nowrap;
}

.tabla td {
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto-medio);
  border-bottom: 1px solid var(--gris-200);
}

.tabla tbody tr:last-child td { border-bottom: none; }

.vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--esp-3);
  padding: var(--esp-8) var(--esp-4);
  text-align: center;
  color: var(--texto-suave);
}

.vacio i { font-size: 30px; color: var(--gris-400); }

.cargando {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gris-300);
  border-top-color: var(--navy-900);
  border-radius: 50%;
  animation: girar 700ms linear infinite;
}

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

.esqueleto {
  background: linear-gradient(90deg, var(--gris-100) 25%, var(--gris-200) 37%, var(--gris-100) 63%);
  background-size: 400% 100%;
  animation: brillo 1.4s ease infinite;
}

@keyframes brillo {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

#toast-contenedor {
  position: fixed;
  top: var(--esp-4);
  right: var(--esp-4);
  display: flex;
  flex-direction: column;
  gap: var(--esp-2);
  z-index: var(--z-toast);
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--esp-3);
  padding: 14px 16px;
  background: var(--blanco);
  border: 1px solid var(--gris-300);
  border-left: 5px solid var(--navy-900);
  box-shadow: var(--sombra-lg);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.visible { opacity: 1; transform: translateX(0); }
.toast.saliendo { opacity: 0; transform: translateX(16px); }

.toast-icono { flex-shrink: 0; font-size: 18px; line-height: 1.4; }
.toast-cuerpo { flex: 1; min-width: 0; }

.toast-titulo {
  font-family: var(--fuente-titulo);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 17px;
  line-height: 1.2;
}

.toast-mensaje { font-size: 14px; line-height: 1.45; color: var(--texto-suave); word-break: break-word; }

.toast-cerrar {
  flex-shrink: 0;
  color: var(--texto-claro);
  font-size: 14px;
  padding: 2px 4px;
}

.toast-cerrar:hover { color: var(--navy-900); }

.toast-exito { border-left-color: var(--verde); }
.toast-exito .toast-icono { color: var(--verde); }
.toast-error { border-left-color: var(--rojo); }
.toast-error .toast-icono { color: var(--rojo); }
.toast-alerta { border-left-color: var(--amarillo); }
.toast-alerta .toast-icono { color: var(--amarillo-oscuro); }
.toast-info { border-left-color: var(--navy-900); }
.toast-info .toast-icono { color: var(--navy-800); }

.modal-fondo {
  position: fixed;
  inset: 0;
  background: rgba(8, 23, 48, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--esp-4);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transicion), visibility var(--transicion);
}

.modal-fondo.abierto { opacity: 1; visibility: visible; }

.modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--blanco);
  box-shadow: var(--sombra-lg);
  transform: translateY(12px);
  transition: transform var(--transicion);
}

.modal-fondo.abierto .modal { transform: translateY(0); }
.modal-cabecera { padding: var(--esp-5); border-bottom: 3px solid var(--amarillo); }
.modal-cuerpo { padding: var(--esp-5); display: flex; flex-direction: column; gap: var(--esp-4); }
.modal-pie { padding: var(--esp-4) var(--esp-5); border-top: var(--borde); display: flex; justify-content: flex-end; gap: var(--esp-3); flex-wrap: wrap; }

.logo { flex: 0 0 auto; display: block; background: var(--blanco); padding: 8px 14px; }
.logo img { height: 38px; width: auto; }

.pie { background: var(--navy-950); color: #8DA0BC; padding: 44px 0; }

.pie-inner {
  display: flex;
  gap: var(--esp-5);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.logo-pie img { height: 34px; }
.pie-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.pie-nav a { color: #8DA0BC; font-size: 14px; font-weight: 600; }
.pie-nav a:hover { color: var(--amarillo); }
.pie-texto { font-size: 13px; letter-spacing: 0.06em; }

@media (max-width: 900px) {
  .seccion { padding-block: var(--esp-8); }
}

@media (max-width: 768px) {
  html { scroll-padding-top: 76px; }
  #toast-contenedor { top: auto; bottom: var(--esp-4); left: var(--esp-4); right: var(--esp-4); max-width: none; }
  .toast { transform: translateY(16px); }
  .toast.visible { transform: translateY(0); }
  .toast.saliendo { transform: translateY(16px); }
  .tabla th, .tabla td { padding: 14px 16px; }
}

@media (max-width: 480px) {
  .contenedor { padding-inline: var(--esp-4); }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
