/* Libro de Reclamaciones — estilos propios, sobrios y legibles en móvil. */
:root {
  --texto: #1f2328;
  --texto-suave: #57606a;
  --fondo: #ffffff;
  --fondo-suave: #f6f8fa;
  --borde: #d0d7de;
  --acento: #0b5cad;
  --acento-oscuro: #08457f;
  --error: #b42318;
  --exito: #1a7f37;
  --radio: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  font-size: 1rem;
}

.contenedor {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main { flex: 1; padding-top: 1.5rem; padding-bottom: 2rem; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

a { color: var(--acento); }
a:hover { color: var(--acento-oscuro); }

:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

.saltar {
  position: absolute;
  left: -999px;
  top: 0;
  padding: .5rem 1rem;
  background: var(--acento);
  color: #fff;
  z-index: 10;
}
.saltar:focus { left: 1rem; }

.cabecera {
  border-bottom: 3px solid var(--acento);
  background: var(--fondo-suave);
  padding: .75rem 0;
}
.logo {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--texto);
}
.logo-institucion { font-weight: 700; font-size: 1.125rem; }
.logo-libro { font-size: .875rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; }

.pie {
  border-top: 1px solid var(--borde);
  color: var(--texto-suave);
  font-size: .875rem;
  padding: 1rem 0;
}
.pie p { margin: 0; }

.aviso {
  border: 1px solid var(--borde);
  border-left: 4px solid var(--acento);
  border-radius: var(--radio);
  padding: 1rem;
  background: var(--fondo-suave);
}

/* Formularios */
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: .625rem .75rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
  min-height: 2.75rem;
}
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
textarea { min-height: 7rem; resize: vertical; }
.campo { margin-bottom: 1rem; }
.ayuda { font-size: .875rem; color: var(--texto-suave); }
.error-campo { color: var(--error); font-size: .875rem; margin-top: .25rem; }
[aria-invalid="true"] { border-color: var(--error); }

.boton, button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: .625rem 1.25rem;
  min-height: 2.75rem;
  border: 1px solid var(--acento);
  border-radius: var(--radio);
  background: var(--acento);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.boton:hover, button:hover { background: var(--acento-oscuro); color: #fff; }
.boton-secundario { background: #fff; color: var(--acento); }

/* Tablas */
.tabla-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { background: var(--fondo-suave); }

@media (min-width: 40rem) {
  h1 { font-size: 1.75rem; }
  main { padding-top: 2rem; }
}

/* Formulario público */
.datos-institucion { margin: 0 0 1.5rem; display: grid; gap: .25rem 1rem; grid-template-columns: 1fr; }
.datos-institucion div { display: flex; gap: .5rem; flex-wrap: wrap; }
.datos-institucion dt { font-weight: 600; }
.datos-institucion dt::after { content: ":"; }
.datos-institucion dd { margin: 0; }
.formulario fieldset { border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem; margin: 0 0 1.5rem; }
.formulario legend { font-weight: 700; padding: 0 .25rem; }
.formulario fieldset.grupo { border: 0; padding: 0; margin: 0 0 1rem; }
.formulario fieldset.grupo legend { font-weight: 600; padding: 0; margin-bottom: .25rem; }
.opcion { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; margin-bottom: .25rem; }
.opcion input { margin-top: .3rem; }
.avisos { font-size: .875rem; color: var(--texto-suave); background: var(--fondo-suave); border-radius: var(--radio); padding: .75rem 1rem; margin-bottom: 1rem; }
.avisos p { margin: 0 0 .5rem; }
.avisos p:last-child { margin: 0; font-weight: 600; color: var(--texto); }
.resumen-errores { border: 2px solid var(--error); border-radius: var(--radio); padding: 1rem; margin-bottom: 1.5rem; }
.resumen-errores h2 { color: var(--error); font-size: 1.125rem; }
.resumen-errores ul { margin: 0; padding-left: 1.25rem; }
.resumen-errores a { color: var(--error); }
.aviso-exito { border-left-color: var(--exito); }
/* Honeypot: fuera de pantalla (no display:none, que algunos bots detectan). */
.trampa { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* "Nombre del padre o madre" solo si marca menor; sin :has() queda siempre visible. */
@supports selector(:has(a)) {
  .formulario:not(:has(#es_menor:checked)) .campo-apoderado { display: none; }
}
@media (min-width: 40rem) {
  .datos-institucion { grid-template-columns: 1fr 1fr; }
}

/* Panel del coordinador */
.cabecera .contenedor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.nav-panel { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-size: .9375rem; }
.nav-panel form { margin: 0; }
.nav-usuario { color: var(--texto-suave); }
.boton-chico { padding: .375rem .875rem; min-height: 2.25rem; }
.boton-secundario:hover { background: var(--fondo-suave); color: var(--acento-oscuro); }
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filtros a { padding: .375rem .75rem; border: 1px solid var(--borde); border-radius: 999px; text-decoration: none; }
.filtros a[aria-current="page"] { background: var(--acento); border-color: var(--acento); color: #fff; }
.dias { font-weight: 600; white-space: nowrap; }
.dias-rojo { color: var(--error); }
.dias-ambar { color: #9a6700; }
.paginacion { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.seccion-hoja { margin: 1.5rem 0; }
.datos-hoja { margin: 0; }
.datos-hoja div { padding: .375rem 0; border-bottom: 1px solid var(--borde); }
.datos-hoja dt { font-weight: 600; font-size: .875rem; color: var(--texto-suave); }
.datos-hoja dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.respuesta { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fondo-suave); border-radius: var(--radio); padding: .75rem 1rem; margin-top: .75rem; }
.historial { padding-left: 1.25rem; }
.historial time { color: var(--texto-suave); font-variant-numeric: tabular-nums; margin-right: .5rem; }
.login { max-width: 24rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.en-linea { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.en-linea input { width: auto; flex: 1 1 10rem; }
.en-linea .error-campo { flex-basis: 100%; margin: 0; }
.acciones { white-space: nowrap; }
.acciones a + a { margin-left: .75rem; }
