/* ─────────────────────────────────────────────────────────────
   Inducción Contratistas FPC — estilos

   Estética minimalista del formulario original: fondo gris claro,
   tarjeta blanca, verde corporativo #7CB342, Arial.
   La primera mitad es el flujo del contratista; la segunda, el
   panel de control (body.admin).
   ───────────────────────────────────────────────────────────── */

* { box-sizing: border-box; max-width: 100%; }

html, body {
  margin: 0; padding: 0; width: 100%;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f5f5; color: #333;
  overscroll-behavior-x: none;
}

/* ══════════════════════════════════════════════════════════════
   FLUJO DEL CONTRATISTA
   ══════════════════════════════════════════════════════════════ */

.container {
  width: 100%; max-width: 700px; margin: 18px auto;
  background: #fff; padding: 18px 20px;
  border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,.08);
}

h2, h3 { text-align: center; margin: 8px 0; }
h2 { font-size: 20px; }
h3 { font-size: 17px; margin-top: 22px; }
h4 { font-size: 14px; font-weight: normal; line-height: 1.5; color: #444; margin: 16px 0 12px; }

.encabezado {
  text-align: center; padding-bottom: 14px;
  border-bottom: 2px solid #7CB342; margin-bottom: 6px;
}
.encabezado .marca { font-size: 22px; font-weight: bold; color: #7CB342; letter-spacing: 1px; }
.encabezado .sub { font-size: 13px; color: #777; margin-top: 4px; }

.centro { text-align: center; line-height: 1.6; color: #555; font-size: 14px; }
.chico { font-size: 13px; color: #666; }
.destacado { font-weight: bold; color: #7CB342; }

/* ── Pasos ── */
.pasos { display: flex; gap: 6px; margin: 14px 0 18px; }
.paso {
  flex: 1; text-align: center; font-size: 11px; padding: 8px 4px;
  border-radius: 6px; background: #eee; color: #999; font-weight: bold;
}
.paso.activo { background: #7CB342; color: #fff; }
.paso.listo { background: #dff0d0; color: #4a7a1e; }

.datos {
  background: #f9f9f9; border: 1px solid #eee; border-radius: 8px;
  padding: 12px 14px; font-size: 14px; line-height: 1.7; margin-bottom: 6px;
}
.datos strong { color: #555; }

/* ── Campos ── */
label { display: block; margin-top: 12px; font-weight: bold; font-size: 14px; }
input[type=text], input[type=date], input[type=email], input[type=number], input[type=password] {
  width: 100%; padding: 10px; margin-top: 6px;
  border-radius: 6px; border: 1px solid #ccc; font-size: 15px; font-family: inherit;
}
input:focus { outline: 2px solid #7CB342; border-color: #7CB342; }

/* ── Preguntas Verdadero/Falso ── */
.pregunta { margin-bottom: 18px; }
.pregunta p { margin: 6px 0 8px; line-height: 1.4; }
.opciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; width: 100%; }
.btn-opcion {
  flex: 1 1 45%; max-width: 140px; padding: 10px 12px;
  border-radius: 8px; border: 2px solid #7CB342; background: #fff;
  cursor: pointer; font-size: 14px; font-weight: bold; text-align: center;
  transition: background .12s ease, transform .06s; user-select: none;
}
.btn-opcion:hover { background: #e9f6df; transform: translateY(-1px); }
.btn-opcion.selected { background: #7CB342; color: #fff; }

/* ── Casillas ── */
.fila-contador {
  display: flex; justify-content: space-between; align-items: center;
  margin: 12px 0; font-size: 13px; color: #666;
}
.checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: normal; font-size: 14px; line-height: 1.45;
  margin: 0; padding: 9px 10px; border-radius: 6px; cursor: pointer;
}
.checkbox-label:hover { background: #f7fbf3; }
.checkbox-label input[type=checkbox] {
  width: 20px; height: 20px; min-width: 20px; margin-top: 1px;
  accent-color: #7CB342; cursor: pointer;
}

/* ── Botones ── */
.btn-primary {
  display: block; width: 100%; padding: 13px; margin-top: 18px;
  border-radius: 8px; background: #7CB342; color: #fff;
  font-size: 17px; font-weight: bold; border: none; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { background: #6ba238; }
.btn-primary:disabled { background: #bbb; cursor: not-allowed; }

.btn-secondary {
  padding: 8px 14px; background: #6c757d; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-family: inherit;
}
.btn-secondary:hover { background: #5a6268; }

/* ── Firma ── */
.firma-box { text-align: center; margin: 16px 0; }
#firma {
  display: block; width: 100%; max-width: 350px; height: 160px;
  border-radius: 8px; border: 2px solid #444; background: #fff;
  margin: 0 auto 10px; touch-action: pan-y; cursor: crosshair;
}

/* ── Mensajes ── */
.mensaje, .error {
  margin-top: 14px; padding: 12px; border-radius: 8px;
  text-align: center; font-weight: bold; font-size: 14px;
}
.mensaje { background: #7CB342; color: #fff; }
.error { background: #d9534f; color: #fff; }

.aviso {
  background: #f5f5f5; border-left: 4px solid #7CB342;
  padding: 12px 14px; font-size: 13px; color: #555;
  line-height: 1.6; margin: 16px 0; border-radius: 0 6px 6px 0;
}

/* ── Contenido de la inducción ── */
.contenido-cuerpo { font-size: 15px; line-height: 1.7; }
.contenido-cuerpo img { height: auto; border-radius: 8px; margin: 12px 0; }
.contenido-cuerpo h2, .contenido-cuerpo h3 { text-align: left; color: #4a7a1e; }
.contenido-cuerpo ul, .contenido-cuerpo ol { padding-left: 22px; line-height: 1.8; }
video { width: 100%; border-radius: 8px; background: #000; margin: 12px 0; }

.progreso-caja {
  background: #f9f9f9; border: 1px solid #e3e3e3;
  border-radius: 8px; padding: 14px; margin-top: 18px;
}
.barra { height: 8px; background: #e3e3e3; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.barra span { display: block; height: 100%; background: #7CB342; width: 0; transition: width .4s ease; }
.progreso-texto { font-size: 13px; color: #666; display: flex; justify-content: space-between; }

/* ── Resultado final ── */
.resultado { text-align: center; padding: 20px 0; }
.resultado .icono { font-size: 52px; line-height: 1; }
.resultado .titulo { font-size: 22px; font-weight: bold; margin: 12px 0 6px; }
.resultado.aprobado .titulo { color: #7CB342; }
.resultado.reprobado .titulo { color: #d9534f; }
.resultado .folio {
  display: inline-block; background: #f5f5f5; border: 1px dashed #bbb;
  border-radius: 6px; padding: 8px 16px;
  font-family: 'Courier New', monospace; font-size: 16px; margin: 10px 0;
}

/* ══════════════════════════════════════════════════════════════
   PANEL DE CONTROL
   ══════════════════════════════════════════════════════════════ */

body.admin { font-size: 14px; }

.topbar {
  background: #fff; border-bottom: 3px solid #7CB342;
  padding: 12px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.topbar .marca { font-size: 18px; font-weight: bold; color: #7CB342; letter-spacing: 1px; }
.topbar nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none; color: #555; padding: 7px 14px;
  border-radius: 6px; font-weight: bold; font-size: 13px;
}
.topbar nav a:hover { background: #f0f7e8; color: #4a7a1e; }
.topbar nav a.activo { background: #7CB342; color: #fff; }
.topbar .usuario { font-size: 12px; color: #777; display: flex; align-items: center; gap: 10px; }

.contenido { max-width: 1240px; margin: 22px auto; padding: 0 20px; }
body.admin h1 { font-size: 20px; margin: 0 0 18px; }
body.admin h2 { font-size: 15px; margin: 26px 0 10px; color: #444; text-align: left; }
body.admin hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }

/* ── KPI ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi {
  background: #fff; border-radius: 10px; padding: 16px 18px;
  box-shadow: 0 2px 4px rgba(0,0,0,.06); border-left: 4px solid #ccc;
}
.kpi .valor { font-size: 28px; font-weight: bold; line-height: 1.1; }
.kpi .etiqueta { font-size: 12px; color: #777; margin-top: 4px; }
.kpi.verde { border-left-color: #7CB342; } .kpi.verde .valor { color: #4a7a1e; }
.kpi.azul  { border-left-color: #4a90d9; } .kpi.azul .valor  { color: #2c6ca8; }
.kpi.ambar { border-left-color: #e8a33d; } .kpi.ambar .valor { color: #a86d10; }
.kpi.rojo  { border-left-color: #d9534f; } .kpi.rojo .valor  { color: #a02b25; }
.kpi.gris  { border-left-color: #999; }    .kpi.gris .valor  { color: #666; }

.panel {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,.06); margin: 18px 0;
}
.panel h2:first-child { margin-top: 0; }

/* ── Tablas ── */
table.datos { width: 100%; border-collapse: collapse; font-size: 13px; }
table.datos th {
  text-align: left; padding: 9px 10px; background: #f7f7f7; color: #666;
  font-size: 12px; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid #eee;
}
table.datos td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
table.datos tr:hover td { background: #fafcf8; }
table.datos td.acciones { text-align: right; white-space: nowrap; }

/* ── Etiquetas de estado ── */
.tag { display: inline-block; padding: 3px 9px; border-radius: 11px; font-size: 11px; font-weight: bold; white-space: nowrap; }
.tag.emitida, .tag.abierta { background: #e8f0fb; color: #2c6ca8; }
.tag.en_progreso, .tag.por_vencer { background: #fdf3e0; color: #a86d10; }
.tag.completada, .tag.vigente, .tag.aprobado { background: #eaf4e0; color: #3c6b12; }
.tag.expirada, .tag.revocada { background: #f0f0f0; color: #777; }
.tag.bloqueada, .tag.vencida, .tag.reprobado { background: #fbeaea; color: #a02b25; }

/* ── Formularios del panel ── */
.formulario { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.campo label { display: block; font-size: 12px; color: #666; font-weight: bold; margin: 0 0 5px; }
.campo input, .campo select {
  width: 100%; padding: 9px 10px; border: 1px solid #ccc;
  border-radius: 6px; font-size: 14px; font-family: inherit; margin: 0;
}
.campo input:focus, .campo select:focus { outline: 2px solid #7CB342; border-color: #7CB342; }

.btn {
  padding: 9px 16px; border: none; border-radius: 6px; background: #7CB342;
  color: #fff; font-weight: bold; font-size: 13px; cursor: pointer;
  font-family: inherit; text-decoration: none; display: inline-block;
}
.btn:hover { background: #6ba238; }
.btn.gris { background: #6c757d; } .btn.gris:hover { background: #5a6268; }
.btn.rojo { background: #d9534f; } .btn.rojo:hover { background: #c9302c; }
.btn.pequeno { padding: 5px 10px; font-size: 12px; }

.aviso-caja {
  background: #eaf4e0; border-left: 4px solid #7CB342; padding: 11px 14px;
  border-radius: 0 6px 6px 0; font-size: 13px; margin-bottom: 16px;
}
.vacio { text-align: center; color: #999; padding: 30px; }
.paginacion { display: flex; gap: 8px; justify-content: center; margin-top: 16px; align-items: center; font-size: 13px; }
.mono { font-family: 'Courier New', monospace; font-size: 12px; }

/* ── Login ── */
.login-caja {
  max-width: 380px; margin: 90px auto; background: #fff;
  border-radius: 10px; padding: 30px; box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.login-caja .marca { text-align: center; font-size: 24px; font-weight: bold; color: #7CB342; letter-spacing: 1px; }
.login-caja .sub { text-align: center; font-size: 13px; color: #888; margin: 6px 0 24px; }
.login-caja .campo { margin-bottom: 14px; }
.login-caja .btn { width: 100%; padding: 12px; font-size: 15px; }
.error-caja {
  background: #fbeaea; color: #a02b25; padding: 11px; border-radius: 6px;
  font-size: 13px; margin-bottom: 16px; text-align: center;
}

/* ── Adaptación ── */
@media (min-width: 720px) {
  .opciones { justify-content: flex-start; }
  .btn-opcion { flex: 0 0 48%; min-width: 160px; }
}
@media (max-width: 700px) {
  .container { margin: 10px auto; padding: 14px; border-radius: 8px; }
  .paso { font-size: 10px; }
  .topbar { padding: 10px 14px; gap: 12px; }
  .contenido { padding: 0 12px; }
  table.datos { font-size: 12px; }
  table.datos th, table.datos td { padding: 7px 6px; }
}
