/* SERVIMAN Talento — mismos tokens que el dashboard (assets/style.css de dashboard-kpis). */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e6eaf0;
  --border-strong: #d5dbe5;
  --text: #0f172a;
  --text-2: #475569;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --crit: #dc2626;
  --crit-bg: #feecec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { height: 36px; width: auto; display: block; }
.top h1 { font-size: 18px; }
.top-user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }

main { max-width: 640px; margin: 16px auto 24px; padding: 0 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 8px; }
.card-error { border-color: var(--crit); background: var(--crit-bg); }

label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 4px; }
input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
input:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  margin-top: 16px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-sec { margin-top: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); }

.estado { margin-top: 12px; font-size: 14px; color: var(--text-2); min-height: 1.5em; }

.bloque { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.bloque h3 { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips li {
  padding: 4px 10px;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

/* ---- Fase 2a: lista y autoevaluación (celular primero, mín. 360 px, zonas táctiles ≥ 44 px) ---- */
button { touch-action: manipulation; }
textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
}
textarea:focus-visible, button:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn { min-height: 44px; }
.btn-ancho { width: 100%; }
.titulo-vista { font-size: 20px; margin-bottom: 12px; }
#ctxTecnico + #ctxGeneral { margin-top: 16px; }

.avance { width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--border); overflow: hidden; accent-color: var(--accent); }
.avance::-webkit-progress-bar { background: var(--border); }
.avance::-webkit-progress-value { background: var(--accent); }
.avance::-moz-progress-bar { background: var(--accent); }

.eval { margin-bottom: 12px; }
.eval h3 { font-size: 17px; }
.eval .periodo { color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.eval .auto-estado { font-weight: 600; margin-bottom: 6px; }
.eval .estado-eval { color: var(--text-2); font-size: 14px; }
.eval .avance { margin-bottom: 4px; }
.vacio { color: var(--text-2); }

.btn-enlace {
  min-height: 44px;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.auto-fija { position: sticky; top: 0; z-index: 2; margin: 0 -16px 12px; padding: 0 16px 8px; background: var(--bg); }
.auto-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auto-progreso { font-weight: 600; font-size: 14px; white-space: nowrap; }
.auto-card { padding: 16px; }
.paso { font-size: 13px; color: var(--text-2); }
#autoTitulo { margin: 2px 0 12px; outline: none; }
.intro { margin-bottom: 16px; padding: 12px; background: var(--accent-soft); border-radius: var(--radius-sm); font-size: 14px; }
.intro summary { display: flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; }
.intro p { margin-top: 8px; }
.leyenda { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.opcional { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }

.item { padding: 14px 0; border-top: 1px solid var(--border); }
.item:first-of-type { border-top: 0; }
.item-texto { font-weight: 500; margin-bottom: 8px; display: block; }
.item label { margin-top: 8px; }
.escala, .opciones { display: flex; gap: 8px; }
.punto {
  flex: 1;
  min-height: 48px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.punto.elegido { color: #fff; background: var(--accent); border-color: var(--accent); }
.valor-elegido { min-height: 1.5em; margin-top: 6px; font-size: 14px; color: var(--accent); font-weight: 600; }
.etiqueta-grupo { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.nota { margin-top: 4px; }
.nota label { margin-top: 4px; }

.resumen { list-style: none; margin-bottom: 8px; }
.resumen li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.promedio { margin: 12px 0; font-weight: 700; }
.faltan { list-style: none; margin-bottom: 12px; }
.faltan .btn-enlace { font-weight: 500; font-size: 14px; }
.declaracion { margin: 16px 0; padding-top: 12px; border-top: 1px solid var(--border); }
.declaracion h3 { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.casilla { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--text); margin: 0; cursor: pointer; }
.casilla input { width: 24px; height: 24px; flex: none; margin-top: 2px; padding: 0; accent-color: var(--accent); }
.confirmar { margin-top: 12px; padding: 12px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.confirmar .btn { margin-right: 8px; }

.auto-pie {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px -16px 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.auto-pie .btn { margin-top: 0; }
.guardado { grid-column: 1 / -1; order: -1; font-size: 13px; color: var(--text-2); text-align: center; min-height: 1.4em; }
#autoReintentar { grid-column: 1 / -1; order: -1; }
#autoSiguiente { grid-column: 2; }

.lectura-seccion h3 { font-size: 15px; margin-top: 16px; }
.respuesta { font-weight: 600; }
.nota-leida { font-size: 14px; color: var(--text-2); }

@media (max-width: 480px) {
  #topCorreo { display: none; }
}

/* ---- Fase 2b: Mi evaluación, firmar y apelar (diseño §15; mismos tokens, 360 px, objetivos ≥ 44 px) ---- */
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#evalTitulo, #firmaTitulo, #apelarTitulo { outline: none; }
.titulo-seccion { margin: 20px 0 8px; font-size: 15px; color: var(--text-2); }
.eval .resultado-tarjeta { margin-bottom: 4px; font-weight: 700; }
.eval[data-estado="firmar"] { border-color: var(--accent); }

.resultado { margin-bottom: 12px; padding: 12px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.resultado h3 { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.resultado-final { font-size: 24px; font-weight: 700; }
.resultado-accion { margin-bottom: 8px; color: var(--text-2); }
.resultado .resumen { margin: 8px 0 0; }

.plegable { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; }
.plegable > summary { display: flex; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; }
.plegable[open] { padding-bottom: 12px; }
.plegable .item:first-of-type { border-top: 0; }
.valor-sistema { font-size: 14px; color: var(--text-2); }
.texto-largo { white-space: pre-wrap; overflow-wrap: anywhere; }
.requisitos { margin: 4px 0 8px 20px; }
.requisitos li { margin: 4px 0; }
.plegable ol { margin: 8px 0 0 20px; }
.plegable ol li { margin-top: 6px; }

.literal { margin: 16px 0 8px; padding: 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); }
.literal footer { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.aviso-firma { margin-top: 8px; font-size: 14px; }

.eval-pie {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 12px -16px 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.eval-pie .btn { margin-top: 8px; }
.eval-pie-texto { font-size: 14px; text-align: center; }
