/* Template suizo de tools.arcoirisrd.tech. Sistema: Hanken Grotesk en
   cuatro pesos (100/300/400/700), siete estilos sobre retícula de 8 px,
   mínimo 12 px, tinta #143247 y un solo acento rojo. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/static/fonts/hanken-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A,
    U+201C-201E, U+2022, U+2026, U+20AC, U+2212;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/static/fonts/hanken-variable-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}

:root {
  --paper: #fbfbfa;
  --ink: #143247;
  --secundario: #6f7b87;
  --apagado: #a4aeb6;
  --acento: #c63d2f;
  --verde: #397451;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

/* ---------- cabecera y titular ---------- */

.cabecera {
  max-width: 1480px;
  margin: 0 auto;
  padding: 40px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ink);
}

.logo { height: 18px; width: auto; }

.meta-caps {
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secundario);
}

main { max-width: 1480px; margin: 0 auto; padding: 0 24px 72px; }

.tablero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: 72px;
  align-items: start;
}

.previsualizacion { position: sticky; top: 24px; margin-top: 64px; }

.previa-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.previa-formato { display: block; font-size: 16px; line-height: 24px; font-weight: 700; }

.hoja {
  background: #ffffff;
  border: 1px solid var(--apagado);
  padding: 32px 36px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.v-org {
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secundario);
}
.v-doc { font-size: 24px; line-height: 32px; font-weight: 300; letter-spacing: -0.02em; margin-top: 8px; }
.v-meta { font-size: 12px; line-height: 16px; color: var(--secundario); margin-top: 4px; }
.v-tabla { margin-top: 16px; border-top: 1px solid var(--ink); }
.v-fila {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #d6dce0;
}
.v-etq {
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secundario);
  padding-top: 2px;
}
.v-val { font-size: 14px; line-height: 20px; overflow-wrap: break-word; }
.v-parrafo-titulo {
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  margin-top: 20px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.v-parrafo { font-size: 14px; line-height: 20px; margin-top: 8px; white-space: pre-line; overflow-wrap: break-word; }
.v-nota { font-size: 11px; line-height: 16px; color: var(--secundario); margin-top: 20px; }

h1 {
  margin: 48px 0 0;
  font-size: clamp(44px, 9vw, 88px);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.punto { color: var(--acento); }

.guia-general {
  max-width: 620px;
  margin: 24px 0 0;
  font-size: 16px;
  line-height: 24px;
}

/* ---------- importación y plantilla ---------- */

.importar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.enlace-plantilla {
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.enlace-plantilla:hover { color: var(--acento); }

#estado-importar { font-size: 12px; line-height: 16px; color: var(--secundario); }
#estado-importar.error { color: var(--acento); }
#estado-importar.ok { color: var(--verde); }

.formato { max-width: 460px; margin-top: 48px; }
.formato label { margin-top: 0; }

/* ---------- secciones: numeral hairline y rótulo en la línea base ---------- */

section { margin-top: 64px; }

section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.folio {
  font-size: 56px;
  line-height: 56px;
  font-weight: 100;
  letter-spacing: -0.04em;
}

/* ---------- campos: subrayado, sin caja ---------- */

label {
  display: block;
  margin-top: 32px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secundario);
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 0 10px;
  font-family: inherit;
  font-size: 20px;
  line-height: 32px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-bottom-width: 2px;
  padding-bottom: 9px;
}

::placeholder { color: var(--apagado); }

textarea { resize: vertical; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4 7l5 5 5-5' stroke='%23143247' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}

input[type="file"] { border-bottom: 0; padding: 6px 0 0; font-size: 16px; line-height: 24px; }

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 8px 16px;
  margin-right: 16px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #eef1f3; }

small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--secundario);
}
small.suelto { margin: 8px 0 0; }

.req { color: var(--acento); }

.fila { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin-top: 32px; }
.fila.tres { grid-template-columns: 2fr 1fr 1.4fr; }
.fila label { margin-top: 0; }

.etiqueta {
  margin: 40px 0 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secundario);
}
.etiqueta small { display: inline; margin-left: 8px; }

/* ---------- financiadores ---------- */

.donante {
  display: grid;
  grid-template-columns: 3fr 1.2fr 0.9fr auto;
  gap: 24px;
  align-items: end;
  margin-top: 8px;
}
.donante input, .donante select { margin-top: 0; }
.donante .quitar {
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  border: 1px solid var(--apagado);
  background: var(--paper);
  color: var(--secundario);
  border-radius: 0;
  padding: 8px 16px;
  cursor: pointer;
}
.donante .quitar:hover { color: var(--acento); border-color: var(--acento); }

.entrada {
  border-left: 3px solid var(--apagado);
  padding-left: 16px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.entrada .donante { margin-top: 0; }

button { font: inherit; cursor: pointer; }

.secundario {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 11px 24px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}
.secundario:hover { background: #eef1f3; }

#agregar-donante { margin-top: 16px; }

#lista-archivos, #hallazgos { list-style: none; padding: 0; margin: 8px 0 0; }
#lista-archivos li, #hallazgos li { font-size: 12px; line-height: 16px; padding: 4px 0; color: var(--secundario); }
#lista-archivos li.grande, #hallazgos li.grande { color: var(--acento); }

/* ---------- envío ---------- */

.acciones {
  margin-top: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

#enviar {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 0;
  padding: 16px 40px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}
#enviar:hover { background: #0e2536; }
#enviar:disabled { background: var(--apagado); cursor: wait; }

#estado-envio { margin: 0; font-size: 16px; line-height: 24px; }
#estado-envio.error { color: var(--acento); }
#estado-envio.ok { color: var(--verde); }

.oculto { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- confirmación ---------- */

.confirmacion { margin-top: 64px; }
.confirmacion h2 {
  margin: 0;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  font-weight: 300;
  letter-spacing: -0.02em;
}
.confirmacion p { margin: 16px 0 0; max-width: 620px; }
.confirmacion .id { font-size: 12px; line-height: 16px; color: var(--secundario); }
.confirmacion .descargas a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.confirmacion .descargas a:hover { color: var(--acento); }
.confirmacion button { margin-top: 32px; }

/* ---------- pie ---------- */

.pie {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.pie p {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--secundario);
}

/* ---------- portada ---------- */

.portada {
  max-width: 880px;
  margin: 0 auto;
  min-height: 70vh;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.portada h1 { margin: 0; }
.portada p { max-width: 520px; margin: 24px 0 0; color: var(--secundario); }
.portada-acceso a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.portada-acceso a:hover { color: var(--acento); }

/* ---------- portada con índice de herramientas ---------- */

.portada.inicio {
  max-width: 1480px;
  min-height: 0;
  justify-content: flex-start;
  padding-top: 48px;
  padding-bottom: 24px;
}

.tablero-estado {
  display: inline-flex;
  align-items: baseline;
  gap: 20px;
  margin-top: 40px;
  padding: 14px 20px;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.tablero-estado .tablero-detalle { font-size: 16px; line-height: 24px; font-weight: 700; }
.tablero-estado:hover .tablero-detalle { color: var(--acento); }

.indice { margin-top: 64px; }

.indice-fila {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.2fr) minmax(0, 2fr) 48px;
  align-items: baseline;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.indice .indice-fila:last-child { border-bottom: 1px solid var(--ink); }

.indice-nombre { font-size: 20px; line-height: 32px; font-weight: 700; }
.indice-desc { font-size: 16px; line-height: 24px; color: var(--secundario); }
.indice-fila svg { align-self: center; justify-self: end; }
a.indice-fila:hover .indice-nombre, a.indice-fila:hover svg { color: var(--acento); }

.indice-fila.apagada .folio, .indice-fila.apagada .indice-nombre { color: var(--apagado); }
.indice-estado {
  justify-self: end;
  align-self: center;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--apagado);
  white-space: nowrap;
}

@media (max-width: 680px) {
  .indice-fila { grid-template-columns: 56px minmax(0, 1fr); }
  .indice-desc { grid-column: 2; }
  .indice-fila svg, .indice-estado { display: none; }
}

/* ---------- acceso y panel del equipo ---------- */

.acceso-form { max-width: 380px; margin-top: 40px; }
.acceso-form #enviar { margin-top: 32px; }
.aviso-error { margin: 12px 0 0; color: var(--acento); font-size: 16px; line-height: 24px; }

.enlace-salir { text-decoration: none; }
.enlace-salir:hover { color: var(--acento); }

.enlace-fila {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-top: 24px;
}
.enlace-nombre { font-size: 16px; line-height: 24px; font-weight: 700; padding-bottom: 10px; }
.enlace-url { margin-top: 0; font-size: 15px; color: var(--secundario); }

.envios { margin-top: 8px; border-top: 1px solid var(--ink); }
.envio {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid #d6dce0;
}
.envio-fecha { font-size: 12px; line-height: 16px; color: var(--secundario); }
.envio-titulo { font-size: 16px; line-height: 24px; font-weight: 700; }
.envio-titulo small { font-weight: 400; margin-top: 2px; }
.envio-descargas { display: flex; gap: 16px; }
.envio-descargas a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.envio-descargas a:hover { color: var(--acento); }

@media (max-width: 680px) {
  .enlace-fila, .envio { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 1100px) {
  .tablero { grid-template-columns: 1fr; gap: 0; }
  .previsualizacion { position: static; margin-top: 72px; }
  .hoja { max-height: none; }
}

@media (max-width: 680px) {
  .fila, .fila.tres, .donante { grid-template-columns: 1fr; gap: 0; }
  .donante .quitar { justify-self: start; margin-top: 8px; }
  .fila label, .donante input, .donante select { margin-top: 32px; }
  .donante input:first-child { margin-top: 8px; }
  section { margin-top: 56px; }
}
