/* =========================================================
   VERIFICADOR DE SÍNTOMAS · UI del wizard de triaje
   ========================================================= */

/* ---------- Hero de la página ---------- */
.tri-hero {
  background: linear-gradient(135deg, #0a2a5e 0%, #143d82 55%, #1d52a8 100%);
  color: #fff;
  padding: 54px 0 40px;
  position: relative;
  overflow: hidden;
}
.tri-hero::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
  border-radius: 50%;
}
.tri-hero-inner { position: relative; z-index: 1; max-width: 720px; }
.tri-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 99px; margin-bottom: 16px;
  backdrop-filter: blur(4px);
}
.tri-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900; line-height: 1.1; margin: 0 0 14px;
}
.tri-hero-sub {
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.55; color: rgba(255,255,255,.92);
  margin: 0 0 22px;
}
.tri-hero-sub strong { color: #ffe08a; }
.tri-hero-feats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px 22px;
}
.tri-hero-feats li {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,.95);
}
.tri-hero-feats i { color: #ffe08a; }

/* ---------- Sección que contiene el wizard ---------- */
.tri-section {
  margin: -22px auto 64px;
  position: relative; z-index: 2;
  max-width: 760px;
}

/* ---------- Estado de carga inicial ---------- */
.tri-loading {
  text-align: center; padding: 60px 20px;
  color: var(--ink-500, #64748b);
}
.tri-spinner {
  display: inline-block; width: 34px; height: 34px;
  border: 3px solid var(--border, #e5e9f0);
  border-top-color: var(--blue, #1d52a8);
  border-radius: 50%;
  animation: tri-spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes tri-spin { to { transform: rotate(360deg); } }

.tri-card {
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e9f0);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(10, 42, 94, 0.08);
  overflow: hidden;
}

/* ---------- Barra de progreso por pasos ---------- */
.tri-progress {
  display: flex;
  gap: 4px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #0a2a5e, #143d82);
}
.tri-step { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.tri-step:not(:last-child)::after {
  content: ''; position: absolute; top: 13px; left: 60%; width: 80%; height: 2px;
  background: rgba(255,255,255,.2);
}
.tri-step.is-done:not(:last-child)::after { background: #4ade80; }
.tri-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  background: rgba(255,255,255,.18); color: #fff;
  border: 2px solid rgba(255,255,255,.3);
  position: relative; z-index: 1;
}
.tri-step.is-active .tri-step-dot { background: #fff; color: #0a2a5e; border-color: #fff; }
.tri-step.is-done .tri-step-dot { background: #4ade80; color: #053; border-color: #4ade80; }
.tri-step-lbl { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.85); }
.tri-step.is-active .tri-step-lbl { color: #fff; }

/* ---------- Cuerpo ---------- */
.tri-body { padding: 24px 22px 8px; }
.tri-h { margin: 0 0 6px; font-size: 20px; color: var(--ink-900, #0a2a5e); }
.tri-sub { margin: 0 0 18px; font-size: 14px; color: var(--ink-500, #5b6b85); line-height: 1.5; }

.tri-field { margin-bottom: 18px; }
.tri-field > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-900, #0a2a5e); margin-bottom: 8px; }
.tri-field input[type="number"] {
  width: 100%; max-width: 200px; padding: 12px 14px;
  border: 1px solid var(--border, #e5e9f0); border-radius: 12px;
  font: inherit; font-size: 16px; color: var(--ink-900, #0a2a5e);
  background: var(--bg, #f7f9fc);
}
.tri-field input:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

/* ---------- Chips (sexo + síntomas) ---------- */
.tri-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.tri-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--border, #e5e9f0);
  background: var(--white, #fff);
  color: var(--ink-900, #0a2a5e);
  border-radius: 999px; padding: 10px 16px;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s ease;
}
.tri-chip:hover { border-color: #93b4fb; }
.tri-chip.is-sel {
  background: #2563eb; border-color: #2563eb; color: #fff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .25);
}
.tri-sym-emoji { font-size: 16px; }

.tri-symwrap { max-height: 50vh; overflow-y: auto; padding-right: 4px; margin-bottom: 8px; }
.tri-group { margin-bottom: 18px; }
.tri-group-h {
  margin: 0 0 10px; font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-500, #5b6b85);
}

/* ---------- Escala de severidad ---------- */
.tri-scale { display: flex; align-items: center; gap: 18px; margin: 14px 0 6px; }
.tri-range {
  -webkit-appearance: none; appearance: none; flex: 1 1 auto; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #fde047 0%, #fb923c 50%, #ef4444 100%);
  outline: none;
}
.tri-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 3px solid #2563eb; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.tri-range::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 3px solid #2563eb; cursor: pointer;
}
.tri-scale-val { text-align: center; min-width: 64px; }
.tri-scale-val span { display: block; font-size: 30px; font-weight: 900; color: var(--ink-900, #0a2a5e); line-height: 1; }
.tri-scale-val small { font-size: 12px; color: var(--ink-500, #5b6b85); font-weight: 600; }
.tri-scale-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-500, #8a97ad); margin-bottom: 6px; }

/* ---------- Acciones del wizard ---------- */
.tri-actions { display: flex; justify-content: space-between; gap: 10px; padding: 18px 0 22px; }
.tri-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 22px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.tri-btn-primary { background: #2563eb; color: #fff; }
.tri-btn-primary:hover { filter: brightness(1.08); }
.tri-btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.tri-btn-ghost { background: transparent; color: var(--ink-500, #5b6b85); border: 1px solid var(--border, #e5e9f0); }
.tri-btn:active { transform: translateY(1px); }

/* ---------- Resultado ---------- */
.tri-result {
  border-radius: 16px; padding: 20px;
  background: color-mix(in srgb, var(--lvl) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--lvl) 30%, transparent);
  margin-bottom: 18px;
}
.tri-result-head { display: flex; gap: 16px; align-items: flex-start; }
.tri-result-ic {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; font-size: 26px; color: #fff;
  background: var(--lvl);
}
.tri-result-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--lvl); }
.tri-result-title { margin: 2px 0 4px; font-size: 22px; color: var(--ink-900, #0a2a5e); }
.tri-result-sub { margin: 0; font-size: 14px; color: var(--ink-500, #5b6b85); }
.tri-result-accion { margin: 16px 0 14px; font-size: 15px; font-weight: 600; color: var(--ink-900, #0a2a5e); }

.tri-redflag {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 12px; padding: 12px 14px; margin: 14px 0; font-size: 14px;
}
.tri-redflag i { margin-top: 2px; }

.tri-result-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.tri-cta {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 12px; padding: 12px 18px;
  font-weight: 700; font-size: 14px; text-decoration: none;
}
.tri-cta-primary { background: #2563eb; color: #fff; }
.tri-cta-danger { background: #dc2626; color: #fff; }
.tri-cta-outline { background: transparent; color: var(--ink-900, #0a2a5e); border: 1px solid var(--border, #e5e9f0); }
.tri-cta:hover { filter: brightness(1.06); }

/* ---------- Condiciones / causas ---------- */
.tri-conds { margin-bottom: 8px; }
.tri-conds-h { font-size: 14px; font-weight: 800; color: var(--ink-900, #0a2a5e); margin: 0 0 12px; }
.tri-cond { padding: 12px 0; border-bottom: 1px solid var(--border, #eef1f6); }
.tri-cond:last-child { border-bottom: 0; }
.tri-cond-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tri-cond-top strong { font-size: 15px; color: var(--ink-900, #0a2a5e); }
.tri-cond-pct { font-size: 13px; font-weight: 800; color: #2563eb; }
.tri-cond-bar { height: 7px; border-radius: 4px; background: var(--bg, #eef2f8); overflow: hidden; }
.tri-cond-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #2563eb, #60a5fa); }
.tri-cond-tip { margin: 8px 0 0; font-size: 13px; color: var(--ink-500, #5b6b85); line-height: 1.5; }
.tri-cond-tip i { color: #f59e0b; margin-right: 4px; }

/* ---------- Disclaimer ---------- */
.tri-disclaimer {
  display: flex; gap: 8px; align-items: flex-start;
  margin: 16px 4px 0; font-size: 12.5px; color: var(--ink-500, #5b6b85); line-height: 1.5;
}
.tri-disclaimer i { color: #2563eb; margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .tri-body { padding: 18px 16px 4px; }
  .tri-step-lbl { display: none; }
  .tri-actions { padding: 14px 0 18px; }
  .tri-btn { padding: 11px 18px; font-size: 14px; }
  .tri-result-cta .tri-cta { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Modo oscuro ---------- */
[data-theme="dark"] .tri-hero { background: linear-gradient(135deg, #0a1226 0%, #122249 55%, #163068 100%); }
[data-theme="dark"] .tri-loading { color: #9fb0cc; }
[data-theme="dark"] .tri-spinner { border-color: #2a3654; border-top-color: #4f8cff; }
[data-theme="dark"] .tri-card { background: #131c33; border-color: #2a3654; box-shadow: none; }
[data-theme="dark"] .tri-h,
[data-theme="dark"] .tri-result-title,
[data-theme="dark"] .tri-cond-top strong,
[data-theme="dark"] .tri-conds-h { color: #e8eefc; }
[data-theme="dark"] .tri-sub,
[data-theme="dark"] .tri-cond-tip,
[data-theme="dark"] .tri-result-sub { color: #9fb0cc; }
[data-theme="dark"] .tri-chip { background: #1b2540; border-color: #2a3654; color: #e8eefc; }
[data-theme="dark"] .tri-chip.is-sel { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-theme="dark"] .tri-field input[type="number"] { background: #1b2540; border-color: #2a3654; color: #e8eefc; }
[data-theme="dark"] .tri-cond { border-color: #2a3654; }
[data-theme="dark"] .tri-cond-bar { background: #1b2540; }
[data-theme="dark"] .tri-result-accion { color: #e8eefc; }
[data-theme="dark"] .tri-redflag { background: #3b1212; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .tri-btn-ghost,
[data-theme="dark"] .tri-cta-outline { border-color: #2a3654; color: #cdd8ef; }
