/* soycaminante — componentes
 * Depende de tokens.css. Mobile-first: la Agenda se usa en el teléfono.
 * Reglas de la constitución que se ven aquí:
 *   III  sin barras de progreso, semáforos ni porcentajes → .chip-estado es neutral
 *   VII  privacidad visible → .quien-lee siempre junto a contenido del proyecto
 */

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

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--f-texto);
  font-size: var(--t-m);
  line-height: var(--interlinea);
  -webkit-font-smoothing: antialiased;
}

h1, h2, .titulo {
  font-family: var(--f-titulo);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  margin: 0 0 var(--e-3);
}
h1 { font-size: var(--t-titulo-l); }
h2 { font-size: var(--t-titulo); }
h3 { font-size: var(--t-l); font-weight: 700; margin: 0 0 var(--e-2); line-height: 1.25; }
p  { margin: 0 0 var(--e-3); }
a  { color: var(--acento-tinta); text-underline-offset: 3px; }
.sec { color: var(--tinta-2); }
.pequeno { font-size: var(--t-s); color: var(--tinta-3); }

:focus-visible { outline: 3px solid var(--ag-amarillo); outline-offset: 2px; border-radius: var(--r-s); }

/* ── Cabecera diagonal, como los bloques de la Agenda ───────────────── */
.cabecera {
  background: var(--acento);
  color: var(--sobre-acento);
  padding: var(--e-5) var(--e-4) var(--e-7);
  clip-path: var(--diagonal);
  position: relative;
}
.cabecera h1, .cabecera h2 { color: inherit; margin: 0; }
.cabecera .pequeno { color: rgb(255 255 255 / .9); }
.cabecera--negra   { background: var(--ag-negro); color: #fff; }
.cabecera--mostaza { background: var(--destacado); color: var(--sobre-destacado); }
.cabecera--mostaza .pequeno { color: var(--ag-negro); }

/* ── Botones ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
  min-height: var(--toque-min);
  padding: 0 var(--e-5);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  font: 700 var(--t-m)/1 var(--f-texto);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.btn-primario   { background: var(--acento); color: var(--sobre-acento); }
.btn-primario:hover { background: var(--ag-rojo-osc); }
.btn-secundario { background: transparent; color: var(--tinta); border-color: var(--linea-fuerte); }
.btn-destacado  { background: var(--destacado); color: var(--sobre-destacado); }
.btn-bloque     { display: flex; width: 100%; }

/* ── Tarjeta y hoja de agenda ───────────────────────────────────────── */
.tarjeta {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--r-m);
  padding: var(--e-4);
  box-shadow: var(--sombra-1);
}
.hoja {
  background: var(--papel-2);
  border-radius: var(--r-m);
  padding: var(--e-4);
  /* renglones de cuaderno, como las páginas de escritura de la Agenda */
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent calc(1.5em - 1px), var(--linea) calc(1.5em - 1px), var(--linea) 1.5em);
  background-position: 0 calc(var(--e-4) + .2em);
}
.cita-proyecto {
  font-family: var(--f-titulo);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.05;
  border-left: 6px solid var(--acento);
  padding-left: var(--e-3);
  margin: 0;
}

/* ── Campos de escritura ────────────────────────────────────────────── */
.campo { display: grid; gap: var(--e-2); margin-bottom: var(--e-4); }
.campo label { font-weight: 700; }
.campo .ayuda { font-size: var(--t-s); color: var(--tinta-2); }
.campo textarea, .campo input, .campo select {
  font: inherit; color: var(--tinta);
  background: var(--papel-2);
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-s);
  padding: var(--e-3);
  min-height: var(--toque-min);
}
.campo textarea { min-height: 7.5em; resize: vertical; line-height: 1.5; }

/* ── Objetivo con estado (sin semáforo) ─────────────────────────────── */
.objetivo {
  display: grid; grid-template-columns: 1fr auto; gap: var(--e-2) var(--e-3);
  padding: var(--e-3) 0;
  border-bottom: 1px solid var(--linea);
}
.objetivo:last-child { border-bottom: 0; }
.objetivo .area { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--tinta-3); text-transform: uppercase; letter-spacing: .06em; }
.chip-estado {
  align-self: start;
  font-size: var(--t-xs); font-weight: 700;
  padding: 2px var(--e-2);
  border-radius: var(--r-pill);
  color: var(--tinta);
  background: var(--estado-camino);
  white-space: nowrap;
}
.chip-estado[data-estado="logre"]  { background: var(--estado-logre); }
.chip-estado[data-estado="cambio"] { background: var(--estado-cambio); }

/* ── Chip de campo prioritario: ícono + texto, el color solo como punto ── */
.chip-campo {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-s); font-weight: 600;
  padding: 2px var(--e-3) 2px var(--e-2);
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-pill);
}
.chip-campo::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ag-gris)); }
.chip-campo[data-campo="servicio"]   { --c: var(--campo-servicio); }
.chip-campo[data-campo="naturaleza"] { --c: var(--campo-naturaleza); }
.chip-campo[data-campo="trabajo"]    { --c: var(--campo-trabajo); }
.chip-campo[data-campo="viaje"]      { --c: var(--campo-viaje); }
.chip-campo[data-vacio]              { border-style: dashed; color: var(--tinta-3); font-weight: 400; }

/* ── Quién puede leer (constitución VII) ───────────────────────────── */
.quien-lee {
  display: flex; align-items: center; gap: var(--e-2);
  font-size: var(--t-s); color: var(--tinta-2);
  padding: var(--e-2) var(--e-3);
  background: var(--papel-3);
  border-radius: var(--r-s);
}
.quien-lee svg { flex: none; }

/* ── Camino simbólico: sendero vertical con hitos ──────────────────── */
.camino { list-style: none; margin: 0; padding: 0 0 0 var(--e-2); position: relative; }
.camino::before {  /* el sendero beige de la lámina */
  content: ""; position: absolute; left: 30px; top: 12px; bottom: 12px;
  width: 10px; border-radius: 5px; background: #DCD3C0;
}
.hito { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: var(--e-3); padding: var(--e-3) 0; }
.hito .marca {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--papel); border: 3px solid var(--linea-fuerte);
  position: relative; z-index: 1;
}
.hito .marca img { width: 38px; height: 38px; object-fit: contain; }
.hito[data-vivido] .marca { border-color: var(--ag-negro); background: var(--ag-negro); }
.hito:not([data-vivido]) .marca img { opacity: .35; filter: grayscale(1); }
.hito h3 { font-family: var(--f-titulo); font-size: var(--t-xl); margin: 0; line-height: 1.1; }
.hito .fecha { font-weight: 700; color: var(--acento-tinta); font-size: var(--t-s); }
.referencia {   /* requisitos oficiales como referencia, nunca como checklist */
  margin-top: var(--e-2);
  font-size: var(--t-s); color: var(--tinta-2);
  border-left: 3px solid var(--destacado);
  padding-left: var(--e-3);
}
.leyenda-oficial { font-size: var(--t-xs); color: var(--tinta-3); font-style: italic; }

/* ── Aviso amable (ni rojo de error ni alerta) ─────────────────────── */
.nota-suave {
  background: var(--papel-2);
  border: 1px dashed var(--linea-fuerte);
  border-radius: var(--r-m);
  padding: var(--e-3) var(--e-4);
  font-size: var(--t-s); color: var(--tinta-2);
}

/* ── Lista de personas (dirigente) ─────────────────────────────────── */
.persona {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--e-3); align-items: center;
  padding: var(--e-3) 0; border-bottom: 1px solid var(--linea);
  text-decoration: none; color: inherit;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ag-negro); color: var(--ag-amarillo);
  font-weight: 700;
}
.insignias-mini { display: flex; gap: 2px; }
.insignias-mini img { width: 22px; height: 26px; object-fit: contain; }

/* ── Navegación inferior ───────────────────────────────────────────── */
.nav-inferior {
  position: sticky; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--papel);
  border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-inferior a {
  display: grid; justify-items: center; gap: 2px;
  min-height: 56px; padding: var(--e-2) 0;
  font-size: var(--t-xs); font-weight: 600;
  color: var(--tinta-3); text-decoration: none;
}
.nav-inferior a[aria-current="page"] { color: var(--acento-tinta); }
.nav-inferior a[aria-current="page"] svg { color: var(--acento); }

/* ── Offline ───────────────────────────────────────────────────────── */
.estado-red {
  font-size: var(--t-xs); font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px var(--e-2); border-radius: var(--r-pill);
  background: rgb(255 255 255 / .18); color: inherit;
}
.estado-red::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ag-amarillo); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* En tema oscuro la cabecera negra se funde con el fondo: se aclara un poco */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .cabecera--negra { background: #3A3334; }
}
:root[data-tema="oscuro"] .cabecera--negra { background: #3A3334; }

/* ── Interruptor (compartir / dejar de compartir) ──────────────────── */
.interruptor { display: grid; grid-template-columns: 1fr auto; gap: var(--e-3); align-items: center; padding: var(--e-3) 0; border-bottom: 1px solid var(--linea); }
.interruptor:last-child { border-bottom: 0; }
.interruptor input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 15px;
  background: var(--linea-fuerte); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: var(--sombra-1); transition: transform .15s; }
.interruptor input:checked { background: var(--ag-negro); }
.interruptor input:checked::after { transform: translateX(22px); background: var(--ag-amarillo); }
.interruptor .pequeno { display: block; }

/* ── Línea de tiempo de la Agenda ──────────────────────────────────── */
.linea-tiempo { list-style: none; margin: 0; padding: 0; position: relative; }
.linea-tiempo::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--linea-fuerte); }
.linea-tiempo > li { position: relative; padding: 0 0 var(--e-4) var(--e-6); }
.linea-tiempo > li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--papel); border: 3px solid var(--linea-fuerte); }
.linea-tiempo > li[data-tipo="version"]::before { background: var(--acento); border-color: var(--acento); }
.linea-tiempo > li[data-tipo="autoevaluacion"]::before { background: var(--destacado); border-color: var(--destacado); }
.linea-tiempo .cuando { font-size: var(--t-xs); font-weight: 700; color: var(--acento-tinta); text-transform: uppercase; letter-spacing: .04em; }
.filtros { display: flex; gap: var(--e-2); flex-wrap: wrap; }
.filtros button { font: 600 var(--t-s) var(--f-texto); padding: 4px 14px; min-height: 36px; border-radius: var(--r-pill);
  border: 1px solid var(--linea-fuerte); background: var(--papel); color: var(--tinta); cursor: pointer; }
.filtros button[aria-pressed="true"] { background: var(--ag-negro); color: #fff; border-color: var(--ag-negro); }

/* ── Versión imprimible de la Agenda (F6) ──────────────────────────── */
.hoja-impresa { background: #fff; color: #231F20; font-size: 11pt; line-height: 1.45; padding: 18mm 16mm; }
.hoja-impresa h1 { font-size: 30pt; color: #ED1C24; }
.hoja-impresa h2 { font-size: 20pt; margin-top: 10mm; border-bottom: 2px solid #ED1C24; padding-bottom: 2mm; }
.hoja-impresa .confidencial { font-size: 8pt; text-transform: uppercase; letter-spacing: .08em; color: #767072; }
@media print {
  body * { visibility: hidden; }
  .hoja-impresa, .hoja-impresa * { visibility: visible; }
  .hoja-impresa { position: absolute; inset: 0; padding: 0; }
  .hoja-impresa section { break-inside: avoid; }
  @page { size: A4; margin: 16mm; }
}
