/* CEIM · Dinámicas en vivo — paleta tomada de la presentación */
:root {
  --navy: #002060;
  --navy-2: #163a7a;
  --navy-3: #0b2b6b;
  --orange: #f07c22;
  --yellow: #f9b226;
  --blue: #0077bd;
  --ink: #12233f;
  --ink-2: #5b6472;
  --rule: #d9e1ec;
  --paper: #f3f7fb;
  --white: #ffffff;
  --ok: #1f9d63;
  --danger: #d64545;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 420ms;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 32, 96, 0.06), 0 8px 24px rgba(0, 32, 96, 0.08);
  --shadow-lg: 0 2px 6px rgba(0, 32, 96, 0.08), 0 24px 60px rgba(0, 32, 96, 0.18);

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Calibri, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
img { display: block; }

/* ---------- Vistas con transición ---------- */
.view {
  position: fixed;
  inset: 0;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.985);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
}
.view.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur) var(--ease-out) 80ms, transform 560ms var(--ease-out) 80ms, visibility 0s;
}
.view.leaving { transform: translateY(-14px) scale(0.985); }

/* ---------- Fondo de marca ---------- */
.brand-bg {
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(240, 124, 34, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(0, 119, 189, 0.28), transparent 60%),
    linear-gradient(160deg, var(--navy-2), var(--navy) 55%, #001640);
  color: var(--white);
}
.brand-bg::before {
  /* líneas topográficas sutiles, guiño a la mina */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: repeating-radial-gradient(circle at 80% 120%, transparent 0 38px, #fff 39px 40px);
}

.stripe { height: 6px; background: linear-gradient(90deg, var(--orange) 0 60%, var(--yellow) 60% 100%); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 14px 26px;
  font-weight: 700; letter-spacing: 0.01em;
  transition: transform 160ms var(--ease-out), box-shadow 200ms var(--ease-out), background 200ms, opacity 200ms;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 20px rgba(240, 124, 34, 0.35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 28px rgba(240, 124, 34, 0.45); transform: translateY(-1px); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; opacity: 0.85; }
.btn-ghost:hover { opacity: 1; }
.btn-soft { background: #fff; color: var(--navy); border: 1px solid var(--rule); }
.btn-soft:hover { border-color: var(--navy-2); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 18px 34px; font-size: 18px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--rule); background: #fff; color: var(--navy);
  display: inline-grid; place-items: center; transition: background 160ms, transform 160ms;
}
.icon-btn:hover { background: var(--paper); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Etiquetas ---------- */
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--yellow); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.12); color: #fff;
}
.num-badge {
  display: inline-grid; place-items: center; min-width: 54px; height: 54px; padding: 0 10px; border-radius: 14px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 24px; flex-shrink: 0;
}

/* ---------- Campos ---------- */
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; }
.input {
  width: 100%; padding: 16px 18px; border-radius: var(--r-md); border: 2px solid var(--rule); background: #fff;
  font-size: 18px; outline: none; transition: border-color 200ms, box-shadow 200ms;
}
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(240, 124, 34, 0.15); }

/* ---------- Animaciones ---------- */
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(240, 124, 34, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(240, 124, 34, 0); }
}
@keyframes flash {
  0% { background: rgba(249, 178, 38, 0.28); }
  100% { background: transparent; }
}
@keyframes dots { 0%, 20% { opacity: 0.2 } 50% { opacity: 1 } 100% { opacity: 0.2 } }
.stagger > * { animation: fade-up 600ms var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }
.stagger > *:nth-child(9) { animation-delay: 480ms; }

.typing-dots span { animation: dots 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ---------- Toast / conexión ---------- */
.conn {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: transform 400ms var(--ease-out); z-index: 100; box-shadow: var(--shadow-lg);
}
.conn.show { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

[hidden] { display: none !important; }
