/* TRIAN · sistema visual (2026-11-13)
   Idea: el libro contable y el expediente. Papel frío, tinta verde botella, y el amarillo de
   marcador que usa un auditor para señalar: sólo marca, nunca es fondo de sección.
   Una familia (Archivo variable): angosta y pesada para títulos, normal para texto. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fuentes/archivo-variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --papel: #F1F4F0;
  --hoja: #FFFFFF;
  --tinta: #12261F;
  --tinta-suave: #44574F;
  --verde: #1F5A49;
  --verde-hondo: #143D32;
  --linea: #C5D0C8;
  --marcador: #F4CE4B;
  --error: #9B2318;

  --t-1: 0.875rem;
  --t0: 1rem;
  --t1: 1.2rem;
  --t2: 1.44rem;
  --t3: 1.728rem;
  --t4: 2.488rem;
  --t5: 3.583rem;

  --e1: 0.5rem;
  --e2: 1rem;
  --e3: 1.5rem;
  --e4: 2.5rem;
  --e5: 4rem;
  --e6: 6rem;

  --radio: 4px;
  --tipo: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--tipo);
  font-size: var(--t0);
  line-height: 1.6;
  font-variant-numeric: lining-nums;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: var(--verde); text-underline-offset: 0.18em; }
a:hover { color: var(--verde-hondo); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--marcador); outline-offset: 2px; box-shadow: 0 0 0 5px var(--tinta); border-radius: 2px; }
[hidden] { display: none !important; }

.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.salto { position: absolute; left: var(--e2); top: -4rem; background: var(--tinta); color: var(--hoja); padding: var(--e1) var(--e2); z-index: 50; }
.salto:focus { top: var(--e2); }

.ancho { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.estrecho { max-width: 46rem; }

/* Cabecera */
.cabecera { background: var(--papel); border-bottom: 1px solid var(--linea); position: sticky; top: 0; z-index: 20; }
.cabecera__fila { display: flex; align-items: center; gap: var(--e3); min-height: 4rem; }
.marca { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--tinta); text-decoration: none; }
.marca__signo { width: 1.9rem; height: 1.9rem; color: var(--verde); }
.marca__nombre { font-weight: 800; font-stretch: 112%; font-size: var(--t2); letter-spacing: 0.04em; line-height: 1; }
.menu { display: none; gap: var(--e3); margin-left: auto; }
.menu a { color: var(--tinta); text-decoration: none; font-weight: 500; padding-block: var(--e1); }
.menu a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.cabecera .boton { margin-left: auto; }
@media (min-width: 52rem) {
  .menu { display: flex; }
  .cabecera .boton { margin-left: 0; }
}

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.4rem;
  background: var(--verde); color: var(--hoja);
  border: 2px solid var(--verde); border-radius: var(--radio);
  font-weight: 650; text-decoration: none; line-height: 1.2;
}
.boton:hover { background: var(--verde-hondo); border-color: var(--verde-hondo); color: var(--hoja); }
.boton--chico { min-height: 2.6rem; padding: 0.45rem 1rem; font-size: var(--t-1); }
.boton--contorno { background: transparent; color: var(--verde-hondo); }
.boton--contorno:hover { background: var(--verde-hondo); color: var(--hoja); }
.enlace {
  background: none; border: 0; padding: 0.35rem 0; color: var(--verde);
  font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em;
}
.enlace:hover { color: var(--verde-hondo); }

/* Inicio */
.inicio { padding-block: var(--e4) var(--e5); }
.inicio__rejilla { display: grid; gap: var(--e4); }
.inicio h1 {
  font-size: clamp(2.2rem, 6.2vw, var(--t5));
  font-weight: 800; font-stretch: 75%;
  line-height: 1.02; letter-spacing: -0.01em;
  max-width: 13ch; text-wrap: balance;
}
.entrada { font-size: var(--t1); line-height: 1.5; color: var(--tinta-suave); margin-top: var(--e3); max-width: 34rem; }
.plazo { margin-top: var(--e3); padding-left: var(--e2); border-left: 4px solid var(--marcador); max-width: 34rem; }
.plazo__marca { font-weight: 700; background: linear-gradient(transparent 55%, var(--marcador) 55%); }
@media (min-width: 60rem) {
  .inicio { padding-block: var(--e5) var(--e6); }
  .inicio__rejilla { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; gap: var(--e5); }
}

/* El expediente: la pregunta con la que abre la página */
.expediente {
  position: relative; background: var(--hoja);
  border: 1px solid var(--tinta); border-radius: 0 var(--radio) var(--radio) var(--radio);
  padding: var(--e3); margin-top: 1.9rem;
  box-shadow: 6px 6px 0 var(--verde);
}
.expediente__pestana {
  position: absolute; left: -1px; top: -1.9rem; height: 1.9rem;
  display: flex; align-items: center; padding-inline: var(--e2);
  background: var(--tinta); color: var(--hoja);
  font-size: var(--t-1); font-weight: 600; border-radius: var(--radio) var(--radio) 0 0;
}
.expediente h2 { font-size: var(--t3); font-weight: 800; font-stretch: 80%; line-height: 1.1; }
.expediente__nota { color: var(--tinta-suave); font-size: var(--t-1); margin-top: var(--e1); }
.opciones { margin-block: var(--e2) var(--e2); border-top: 1px solid var(--linea); }
.opciones button {
  display: grid; gap: 0.1rem; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--linea);
  padding: 0.85rem 2rem 0.85rem 0.6rem; position: relative;
}
.opciones button::after {
  content: ""; position: absolute; right: 0.7rem; top: 50%;
  width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--verde); border-top: 2px solid var(--verde);
  transform: translateY(-50%) rotate(45deg);
}
.opciones button:hover { background: linear-gradient(90deg, var(--marcador) 0 5px, var(--papel) 5px); }
.opciones strong { font-weight: 700; }
.opciones span { color: var(--tinta-suave); font-size: var(--t-1); }

/* Secciones */
.seccion { padding-block: var(--e5); }
.seccion--papel { background: var(--hoja); border-block: 1px solid var(--linea); }
.seccion--verde { background: var(--verde-hondo); color: var(--hoja); }
.titulo { font-size: clamp(1.75rem, 4.4vw, var(--t4)); font-weight: 800; font-stretch: 78%; line-height: 1.08; max-width: 22ch; text-wrap: balance; }
.bajada { margin-top: var(--e2); max-width: 44rem; color: var(--tinta-suave); font-size: var(--t1); line-height: 1.5; }
.seccion p + p { margin-top: var(--e2); }
@media (min-width: 60rem) { .seccion { padding-block: var(--e6); } }

/* El libro: servicios como renglones de un libro contable */
.libro { margin-top: var(--e4); border-top: 2px solid var(--tinta); }
.libro__cabeza { display: none; }
.libro__renglon { display: grid; gap: var(--e2); padding-block: var(--e3); border-bottom: 1px solid var(--linea); }
.libro__renglon h3 { font-size: var(--t2); font-weight: 750; font-stretch: 85%; line-height: 1.15; }
.libro__renglon > p { color: var(--tinta-suave); }
.libro__renglon ul { display: grid; gap: 0.3rem; margin-bottom: var(--e2); }
.libro__renglon li { padding-left: 1.3rem; position: relative; }
.libro__renglon li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.7rem; height: 2px; background: var(--verde); }
@media (min-width: 60rem) {
  .libro__cabeza, .libro__renglon { grid-template-columns: 0.8fr 1.1fr 1.1fr; column-gap: var(--e4); }
  .libro__cabeza { display: grid; padding-block: var(--e1); border-bottom: 1px solid var(--tinta); font-size: var(--t-1); font-weight: 600; color: var(--tinta-suave); }
  .libro__renglon { padding-block: var(--e4); }
}

/* Pasos: sí son una secuencia, por eso van numerados */
.pasos { counter-reset: paso; display: grid; gap: var(--e3); margin-top: var(--e4); }
.pasos li { counter-increment: paso; border-top: 1px solid rgba(255, 255, 255, 0.35); padding-top: var(--e2); }
.pasos li::before { content: counter(paso); display: block; font-size: var(--t4); font-weight: 800; font-stretch: 70%; line-height: 1; color: var(--marcador); margin-bottom: var(--e1); }
.pasos h3 { font-size: var(--t1); font-weight: 700; line-height: 1.25; }
.pasos p { margin-top: var(--e1); color: #D9E4DD; }
@media (min-width: 44rem) { .pasos { grid-template-columns: repeat(2, 1fr); gap: var(--e4); } }
@media (min-width: 68rem) { .pasos { grid-template-columns: repeat(4, 1fr); } }

/* Dos columnas */
.dos { display: grid; gap: var(--e4); }
.dos > div > p { max-width: 36rem; margin-top: var(--e2); }
@media (min-width: 60rem) { .dos { grid-template-columns: 1fr 1fr; gap: var(--e5); align-items: start; } }
.hechos { display: grid; gap: var(--e3); }
.hechos li { padding-left: var(--e2); border-left: 4px solid var(--verde); }
.hechos strong { display: block; font-weight: 700; font-size: var(--t1); line-height: 1.3; }

/* Preguntas */
details { border-bottom: 1px solid var(--linea); }
details:first-of-type { margin-top: var(--e3); border-top: 2px solid var(--tinta); }
summary { cursor: pointer; padding: var(--e2) 2.2rem var(--e2) 0; font-weight: 650; font-size: var(--t1); line-height: 1.3; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); font-size: var(--t3); font-weight: 400; color: var(--verde); line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p { padding-bottom: var(--e3); max-width: 40rem; color: var(--tinta-suave); }

/* Formulario */
.formulario { background: var(--hoja); border: 1px solid var(--tinta); border-radius: var(--radio); padding: var(--e3); display: grid; gap: var(--e2); }
.campo { display: grid; gap: 0.3rem; }
.campo label { font-weight: 650; }
.campo input, .campo select, .campo textarea {
  font: inherit; color: var(--tinta); background: var(--hoja);
  border: 1px solid #6B7F76; border-radius: var(--radio);
  padding: 0.65rem 0.75rem; width: 100%; min-height: 3rem;
}
.campo textarea { resize: vertical; min-height: 7rem; }
.campo [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.campo__error { color: var(--error); font-size: var(--t-1); font-weight: 600; }
.formulario__acciones { display: flex; flex-wrap: wrap; gap: var(--e2); margin-top: var(--e1); }
.formulario__acciones .boton { flex: 1 1 12rem; }
.letra-chica { font-size: var(--t-1); color: var(--tinta-suave); }

/* Pie */
.pie { background: var(--tinta); color: #D9E4DD; padding-block: var(--e3) 5.5rem; font-size: var(--t-1); }
.pie__fila { display: flex; flex-wrap: wrap; gap: var(--e2) var(--e4); justify-content: space-between; }
.pie strong { color: var(--hoja); font-stretch: 112%; letter-spacing: 0.04em; margin-right: 0.5rem; }
.pie a { color: var(--hoja); }

/* Botón flotante */
.flotante {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30;
  display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 3.25rem; padding: 0.6rem 1.15rem;
  background: var(--marcador); color: var(--tinta);
  border: 2px solid var(--tinta); border-radius: 999px;
  font-weight: 700; box-shadow: 3px 3px 0 var(--tinta);
}
.flotante svg { width: 1.3rem; height: 1.3rem; }
.flotante:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tinta); }
/* Mientras el primer diagnóstico está a la vista el flotante sobra y le tapa las opciones. */
body.con-asistente .flotante, body.en-diagnostico .flotante { display: none; }

/* Asistente */
.asistente {
  position: fixed; z-index: 40; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto auto auto;
  background: var(--hoja); color: var(--tinta);
}
@media (min-width: 40rem) {
  .asistente { inset: auto 1.25rem 1.25rem auto; width: 25rem; height: min(40rem, 100dvh - 2.5rem); border: 1px solid var(--tinta); border-radius: var(--radio); box-shadow: 6px 6px 0 var(--verde); }
}
.asistente__barra { display: flex; align-items: center; justify-content: space-between; background: var(--verde-hondo); color: var(--hoja); padding: 0.6rem 0.6rem 0.6rem 1rem; }
.asistente__barra h2 { font-size: var(--t0); font-weight: 700; }
.asistente__cerrar { background: none; border: 0; color: var(--hoja); width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: var(--radio); }
.asistente__cerrar svg { width: 1.3rem; height: 1.3rem; }
.asistente__cerrar:hover { background: rgba(255, 255, 255, 0.15); }
.asistente__platica { overflow-y: auto; padding: var(--e2); display: flex; flex-direction: column; gap: 0.6rem; background: var(--papel); overscroll-behavior: contain; }
.burbuja { max-width: 86%; padding: 0.6rem 0.85rem; border-radius: 10px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.burbuja--bot { background: var(--hoja); border: 1px solid var(--linea); border-bottom-left-radius: 2px; align-self: flex-start; }
.burbuja--yo { background: var(--verde); color: var(--hoja); border-bottom-right-radius: 2px; align-self: flex-end; }
.burbuja--resumen { background: var(--hoja); border: 1px solid var(--tinta); border-left: 5px solid var(--marcador); max-width: 100%; font-size: var(--t-1); }
.asistente__opciones { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0.6rem var(--e2); border-top: 1px solid var(--linea); max-height: 13.5rem; overflow-y: auto; }
.asistente__opciones:empty { display: none; }
.ficha { min-height: 2.75rem; padding: 0.4rem 0.9rem; background: var(--hoja); border: 1.5px solid var(--verde); color: var(--verde-hondo); border-radius: 999px; font-weight: 600; font-size: var(--t-1); text-align: left; line-height: 1.25; }
.ficha--fuerte { background: var(--verde); color: var(--hoja); }
/* Sólo con ratón: en pantalla táctil el «hover» se queda pegado tras tocar. */
@media (hover: hover) {
  .ficha:hover { background: var(--verde); color: var(--hoja); }
  .ficha--fuerte:hover { background: var(--verde-hondo); }
}
.ficha--suave { border-color: #6B7F76; color: var(--tinta-suave); }
.asistente__entrada { display: flex; gap: 0.45rem; padding: 0.6rem var(--e2); border-top: 1px solid var(--linea); }
.asistente__entrada input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 0.6rem 0.75rem; border: 1px solid #6B7F76; border-radius: var(--radio); min-height: 2.9rem; color: var(--tinta); background: var(--hoja); }
.asistente__entrada button { width: 2.9rem; min-height: 2.9rem; background: var(--verde); color: var(--hoja); border: 0; border-radius: var(--radio); display: grid; place-items: center; }
.asistente__entrada button:hover { background: var(--verde-hondo); }
.asistente__entrada svg { width: 1.3rem; height: 1.3rem; }
.asistente__pie { font-size: 0.78rem; color: var(--tinta-suave); padding: 0.3rem var(--e2) 0.6rem; }

.sin-js { position: fixed; inset: auto 0 0 0; background: var(--marcador); color: var(--tinta); padding: var(--e2); text-align: center; font-weight: 600; z-index: 60; }

/* Página de texto (aviso de privacidad, 404) */
.texto { padding-block: var(--e4) var(--e5); }
.texto h1 { font-size: clamp(2rem, 5vw, var(--t4)); font-weight: 800; font-stretch: 78%; line-height: 1.08; }
.texto h2 { font-size: var(--t2); font-weight: 750; font-stretch: 85%; margin-top: var(--e4); line-height: 1.2; }
.texto p, .texto ul { margin-top: var(--e2); max-width: 44rem; }
.texto ul { list-style: disc; padding-left: 1.3rem; }
.texto .pendiente { background: linear-gradient(transparent 55%, var(--marcador) 55%); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flotante:hover { transform: none; }
}
