/* CertiNómina — encuesta para subcontratistas
   Paleta tomada de la obra: yeso de drywall, tinta de lápiz de carpintero,
   azul de tiralíneas, papel manila de tarjeta de horas, rojo de corrección
   y amarillo de cinta métrica. */
@font-face {
  font-family: "Archivo";
  src: url("fuentes/archivo-variable.woff") format("woff");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --yeso: #ECEEEA;
  --papel: #FFFFFF;
  --tinta: #1E2A32;
  --gris: #4F5B64;
  --linea: #C6CCC5;
  --tiza: #2B59A6;
  --tiza-osc: #1F4483;
  --tiza-claro: #E9F0FA;
  --manila: #EADFC4;
  --manila-linea: #CDBE96;
  --rojo: #B3332A;
  --rojo-claro: #FBECEA;
  --cinta: #F0C330;
  --fuente: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--yeso);
  color: var(--tinta);
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
}
@media (min-width: 760px) { body { font-size: 1.125rem; } }

img, svg { max-width: 100%; }
a { color: var(--tiza); text-underline-offset: 0.15em; }
a:hover { color: var(--tiza-osc); }
:focus-visible { outline: 3px solid var(--tiza); outline-offset: 2px; }

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

.envoltura { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 600px) { .envoltura { padding: 0 1.5rem; } }
.texto > * { max-width: 44rem; }

/* Tipografía */
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.1; }
h1 {
  font-size: clamp(2.1rem, 5.2vw + .6rem, 3.6rem);
  font-weight: 800;
  font-stretch: 116%;
  letter-spacing: -0.015em;
  line-height: 1.03;
  max-width: 14ch;
}
h2 {
  font-size: clamp(1.55rem, 2.2vw + .9rem, 2.15rem);
  font-weight: 760;
  font-stretch: 110%;
  letter-spacing: -0.01em;
}
h3 { font-size: 1.3rem; font-weight: 720; font-stretch: 106%; }
p { margin: 0 0 1em; max-width: 68ch; }
.entrada { font-size: 1.12em; color: var(--tinta); }
.nota { color: var(--gris); font-size: .92em; }
.opcional { color: var(--gris); font-weight: 400; }
strong { font-weight: 700; }

/* Barra superior */
.barra { border-bottom: 1px solid var(--linea); background: var(--yeso); }
.barra-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.marca { font-weight: 800; font-stretch: 120%; font-size: 1.15rem; color: var(--tinta); text-decoration: none; letter-spacing: -0.01em; }
.marca:hover { color: var(--tinta); }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .75rem 1.35rem;
  background: var(--tiza); color: #fff;
  border: 2px solid var(--tiza); border-radius: 4px;
  font: inherit; font-weight: 700; font-stretch: 104%;
  text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center;
}
.boton:hover { background: var(--tiza-osc); border-color: var(--tiza-osc); color: #fff; }
.boton-sec { background: transparent; color: var(--tiza); }
.boton-sec:hover { background: var(--tiza-claro); color: var(--tiza-osc); }
.boton-chico { min-height: 2.5rem; padding: .45rem .9rem; font-size: .92rem; }
.boton[disabled] { opacity: .6; cursor: progress; }

/* Portada */
.portada { padding: 2.5rem 0 3rem; }
.portada-in { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) {
  .portada { padding: 4.5rem 0 4.5rem; }
  .portada-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 3.5rem; }
}
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1.5rem; }
.acciones .nota { margin: 0; }

/* La planilla: el elemento que se recuerda */
.planilla {
  margin: 0;
  background: var(--manila);
  border: 1px solid var(--manila-linea);
  padding: 1rem .75rem 1rem;
  box-shadow: 0 1px 0 rgba(30, 42, 50, .06), 0 22px 40px -26px rgba(30, 42, 50, .55);
}
@media (min-width: 600px) { .planilla { padding: 1.25rem 1.25rem 1.1rem; } }
.planilla-cab {
  display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 2px solid var(--tinta);
  padding-bottom: .4rem; margin-bottom: .25rem;
  font-stretch: 78%; font-weight: 650; font-size: .82rem; color: var(--tinta);
}
.planilla-tabla { overflow-x: auto; }
.planilla table {
  width: 100%; border-collapse: collapse;
  font-stretch: 74%; font-variant-numeric: tabular-nums;
  font-size: .9rem; line-height: 1.2;
}
.planilla th, .planilla td {
  border-bottom: 1px solid var(--manila-linea);
  padding: .5rem .25rem; text-align: center; white-space: nowrap;
}
.planilla thead th { font-weight: 650; color: var(--gris); font-size: .78rem; padding-top: .35rem; }
.planilla tbody th { text-align: left; font-weight: 650; font-size: .92rem; }
.planilla tbody th small { display: block; font-weight: 450; color: var(--gris); font-size: .78rem; }
.planilla .col-nombre { text-align: left; }
.planilla .total { font-weight: 700; }
.planilla td + td { border-left: 1px solid rgba(205, 190, 150, .55); }
@media (max-width: 520px) {
  .planilla .finde { display: none; }
  .planilla table { font-size: .84rem; }
  .planilla th, .planilla td { padding: .45rem .18rem; }
}
.fila-error td, .fila-error th { background: rgba(179, 51, 42, .06); }
.marcado { position: relative; color: var(--rojo); font-weight: 700; }
.marcado svg {
  position: absolute; left: 50%; top: 50%;
  width: 4.6rem; height: 2.3rem; transform: translate(-50%, -50%);
  overflow: visible; pointer-events: none;
}
.marcado path { fill: none; stroke: var(--rojo); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.planilla-aviso { margin: .9rem 0 .4rem; color: var(--rojo); font-weight: 700; font-size: .98rem; line-height: 1.4; }
.planilla figcaption { font-size: .8rem; color: var(--gris); line-height: 1.45; }

@media (prefers-reduced-motion: no-preference) {
  .planilla .h { animation: escribir .18s ease-out both; animation-delay: calc(var(--i) * 42ms + 350ms); }
  .marcado path { stroke-dashoffset: 1; animation: trazar .55s ease-in-out 1.75s forwards; }
  .planilla-aviso { animation: aparecer .4s ease-out 2.3s both; }
}
@keyframes escribir { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes aparecer { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Secciones */
.seccion { padding: 2.75rem 0; }
@media (min-width: 760px) { .seccion { padding: 3.75rem 0; } }

.ficha { margin: 0 0 1.25rem; border-top: 2px solid var(--tinta); }
.ficha > div { border-bottom: 1px solid var(--linea); padding: .8rem 0; }
.ficha dt { font-weight: 720; font-stretch: 108%; }
.ficha dd { margin: .15rem 0 0; }
@media (min-width: 640px) {
  .ficha > div { display: grid; grid-template-columns: 10rem 1fr; gap: 1.25rem; }
  .ficha dd { margin: 0; }
}

.errores { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.errores li { position: relative; padding: .2rem 0 .9rem 2rem; }
.errores li::before {
  content: ""; position: absolute; left: .15rem; top: .42em;
  width: .85em; height: .85em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 3l10 10M13 3L3 13' stroke='%23B3332A' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.flujo { list-style: none; counter-reset: paso; padding: 0; margin: 0 0 1.25rem; }
.flujo li { counter-increment: paso; position: relative; padding: 0 0 1.1rem 3.25rem; min-height: 2.6rem; }
.flujo li::before {
  content: counter(paso); position: absolute; left: 0; top: -.15rem;
  font-weight: 800; font-stretch: 125%; font-size: 2rem; line-height: 1; color: var(--tiza);
}

.recibe { list-style: none; padding: 0; margin: 0; }
.recibe li { position: relative; padding: 0 0 .9rem 2rem; }
.recibe li::before {
  content: ""; position: absolute; left: .1rem; top: .38em;
  width: .95em; height: .95em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' fill='none' stroke='%232B59A6' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Encuesta */
.seccion-encuesta { padding-top: 1rem; }
.panel {
  max-width: 46rem; margin: 0;
  background: var(--papel); border: 1px solid var(--linea);
  border-top: 4px solid var(--tiza);
  padding: 1.5rem 1rem 1.75rem;
}
@media (min-width: 600px) { .panel { padding: 2.25rem 2.25rem 2.5rem; } }

.progreso { margin-bottom: 1.75rem; }
.progreso-texto { font-weight: 650; margin-bottom: .4rem; }
.metro {
  position: relative; height: 16px; background: #E1E4DF; border-radius: 2px; overflow: hidden;
}
.metro-relleno {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--avance, .33) * 100%);
  background-color: var(--cinta);
  background-image:
    repeating-linear-gradient(90deg, rgba(30,42,50,.85) 0 1.5px, transparent 1.5px 40px),
    repeating-linear-gradient(90deg, rgba(30,42,50,.6) 0 1px, transparent 1px 8px);
  background-size: 100% 100%, 100% 45%;
  background-repeat: no-repeat;
  transition: width .45s ease;
}
@media (prefers-reduced-motion: reduce) { .metro-relleno { transition: none; } }

.paso h3 { outline: none; }
.campo { margin-bottom: 1.15rem; border: 0; padding: 0; }
.campo > label, .campo > legend { display: block; font-weight: 650; margin-bottom: .35rem; }
input:not([type=radio]):not([type=checkbox]), textarea {
  width: 100%; min-height: 3rem;
  font: inherit; color: var(--tinta);
  background: #fff; border: 1.5px solid #8F9A93; border-radius: 4px;
  padding: .6rem .75rem;
}
textarea { min-height: 6rem; resize: vertical; }
.etiqueta { font-weight: 650; margin: 0 0 .35rem; }
.subir {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  padding: .75rem; border: 1.5px dashed #8F9A93; border-radius: 4px; background: var(--yeso); cursor: pointer;
}
.subir:hover { border-color: var(--tiza); }
.subir:focus-within { outline: 3px solid var(--tiza); outline-offset: 2px; }
.subir:has(.archivo[aria-invalid="true"]) { border-color: var(--rojo); }
.archivo { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.subir-boton {
  display: inline-flex; align-items: center; min-height: 2.6rem; padding: .45rem .95rem;
  border: 2px solid var(--tiza); border-radius: 4px; background: #fff; color: var(--tiza); font-weight: 700;
}
.subir-nombres { color: var(--gris); font-size: .95rem; overflow-wrap: anywhere; }
.subir.con-archivos .subir-nombres { color: var(--tinta); font-weight: 600; }
input:focus, textarea:focus { border-color: var(--tiza); }
[aria-invalid="true"] { border-color: var(--rojo) !important; }

.pregunta { border: 0; padding: 0; margin: 0 0 1.9rem; }
.pregunta legend { font-weight: 700; font-size: 1.04em; line-height: 1.35; margin-bottom: .6rem; padding: 0; }
.pregunta .ayuda, .pregunta-corta .ayuda { display: block; font-weight: 400; color: var(--gris); font-size: .9em; margin-top: .15rem; }
.opciones { display: grid; gap: .45rem; }
.opciones-fila { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 520px) { .opciones-fila { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.opcion {
  display: flex; align-items: center; gap: .7rem;
  min-height: 3rem; padding: .6rem .85rem;
  border: 1.5px solid var(--linea); border-radius: 4px; background: #fff;
  cursor: pointer; line-height: 1.3;
}
.opcion:hover { border-color: #8F9A93; }
.opcion:has(input:checked) { border-color: var(--tiza); background: var(--tiza-claro); }
.opcion:has(input:focus-visible) { outline: 3px solid var(--tiza); outline-offset: 2px; }
.opcion input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--tiza); flex: none; }
.opcion-chica { justify-content: center; padding: .5rem; font-weight: 650; }
.pregunta.con-error .opcion { border-color: rgba(179, 51, 42, .55); }

.consentimiento { display: flex; gap: .7rem; align-items: flex-start; margin: .9rem 0 .2rem; cursor: pointer; line-height: 1.45; }
.consentimiento input { width: 1.25rem; height: 1.25rem; margin: .12rem 0 0; accent-color: var(--tiza); flex: none; }
.leer-aviso { display: inline-block; margin: 0 0 .2rem 1.95rem; font-size: .95rem; }

.error-campo { color: var(--rojo); font-weight: 650; font-size: .93rem; margin: .35rem 0 0; }
.alerta {
  border-left: 4px solid var(--rojo); background: var(--rojo-claro);
  padding: .75rem 1rem; margin: 0 0 1.25rem; font-weight: 600;
}
.consejo { background: #FFF6D9; border-left: 4px solid var(--cinta); padding: .75rem 1rem; margin: 0 0 1.25rem; }
.consejo p { margin: 0; }
.acciones-form { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.trampa { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* Preguntas frecuentes */
.faq details { border-bottom: 1px solid var(--linea); }
.faq details:first-child { border-top: 2px solid var(--tinta); }
.faq summary { cursor: pointer; padding: .9rem 0; font-weight: 700; }
.faq details p { margin: 0 0 1rem; }

/* Pie */
.pie { border-top: 1px solid var(--linea); padding: 2rem 0 3rem; color: var(--gris); font-size: .9rem; }
.pie p { max-width: 72ch; }
.pie-enlaces { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* Páginas de texto (guía, privacidad) */
.documento { padding: 2.5rem 0 3rem; }
.documento h1 { max-width: 20ch; font-size: clamp(1.9rem, 3.8vw + .7rem, 3rem); }
.documento h2 { font-size: 1.35rem; margin-top: 2rem; font-stretch: 106%; }
.lista-guia { padding-left: 0; list-style: none; counter-reset: err; margin: 1.5rem 0; }
.lista-guia li { counter-increment: err; position: relative; padding: 1rem 0 1rem 3rem; border-top: 1px solid var(--linea); }
.lista-guia li::before {
  content: counter(err); position: absolute; left: 0; top: .85rem;
  font-weight: 800; font-stretch: 125%; font-size: 1.6rem; color: var(--rojo); line-height: 1;
}
.lista-guia h2 { margin: 0 0 .3rem; font-size: 1.12rem; }
.lista-guia p { margin: 0; }

@media print {
  .barra, .pie, .no-imprimir, .saltar { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .documento { padding: 0; }
  a { color: inherit; text-decoration: none; }
}
