/* tucalculadora — una sola hoja de estilos.
   Idea: la página es un escritorio gris azulado; lo único que es "papel" es el recibo,
   y lo único resaltado con marcador es el número que la persona vino a buscar. */
@font-face {
  font-family: "Archivo";
  src: url("/assets/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --tinta: #14213d;
  --fondo: #e9eef4;
  --papel: #ffffff;
  --azul: #2546c7;
  --rojo: #b42318;
  --resaltador: #ffe45e;
  --linea: #bcc8d6;
  --gris: #4f5b6e;
  --ancho: 70rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 400 1.0625rem/1.6 "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--azul); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.saltar { position: absolute; left: -999px; }
.saltar:focus { left: 1rem; top: 1rem; background: var(--papel); padding: 0.5rem 0.75rem; z-index: 5; }

.ancho { max-width: var(--ancho); margin-inline: auto; padding-inline: 1.25rem; }

/* ---------- cabecera ---------- */
.cabecera { border-bottom: 2px solid var(--tinta); }
.cabecera .ancho { display: flex; align-items: baseline; gap: 2rem; padding-block: 0.9rem; }
.marca { font-weight: 850; font-size: 1.3rem; letter-spacing: -0.035em; color: var(--tinta); text-decoration: none; white-space: nowrap; }
.marca i { font-style: normal; color: var(--azul); }
.cabecera nav { overflow-x: auto; min-width: 0; scrollbar-width: none; }
.cabecera nav::-webkit-scrollbar { display: none; }
.cabecera ul { display: flex; gap: 1.35rem; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.cabecera nav a { color: var(--tinta); font-size: 0.95rem; font-weight: 550; text-decoration: none; padding-block: 0.2rem; }
.cabecera nav a:hover { text-decoration: underline; }
.cabecera nav a[aria-current] { box-shadow: inset 0 -0.5em 0 var(--resaltador); }

/* ---------- títulos ---------- */
.intro { padding-block: 2.75rem 1.75rem; max-width: 46rem; }
h1 { font-size: clamp(2.1rem, 5.6vw, 3.4rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 850; margin: 0 0 0.9rem; text-wrap: balance; }
.bajada { font-size: 1.2rem; line-height: 1.45; color: var(--gris); margin: 0; max-width: 38rem; }
h2 { font-size: 1.55rem; line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; margin: 2.6rem 0 0.7rem; }
h3 { font-size: 1.1rem; line-height: 1.3; font-weight: 750; margin: 1.6rem 0 0.3rem; }

/* ---------- calculadora ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2.5rem; align-items: start; }
.campos { display: grid; gap: 1.15rem; }
.campo { display: grid; gap: 0.35rem; }
.campo > span:first-child, .campo > legend { font-weight: 650; font-size: 0.98rem; }
.campo small { color: var(--gris); font-size: 0.86rem; line-height: 1.4; }
.campo input:not([type="checkbox"]):not([type="radio"]), .campo select {
  width: 100%; font: inherit; font-size: 1.1rem; font-variant-numeric: tabular-nums;
  color: var(--tinta); background: var(--papel);
  border: 1.5px solid var(--tinta); border-radius: 3px; padding: 0.6rem 0.75rem; min-height: 3rem;
}
.campo select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--tinta) 50%), linear-gradient(135deg, var(--tinta) 50%, transparent 50%); background-position: calc(100% - 1.15rem) 55%, calc(100% - 0.8rem) 55%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2.2rem; }
.pesos { position: relative; display: block; }
.pesos::before { content: "$"; position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); font-weight: 650; color: var(--gris); }
.campo .pesos input[data-t="plata"] { padding-left: 1.85rem; }
.dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.campo, .campo input { min-width: 0; }
.tilde { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.98rem; line-height: 1.4; }
.tilde input { width: 1.15rem; height: 1.15rem; margin: 0.15rem 0 0; accent-color: var(--azul); flex: none; }
.tilde small { display: block; color: var(--gris); font-size: 0.86rem; }
fieldset.campo { border: 0; padding: 0; margin: 0; }
fieldset.campo legend { padding: 0; margin-bottom: 0.35rem; }
.opciones { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.opciones label { display: flex; gap: 0.45rem; align-items: center; }
.opciones input { accent-color: var(--azul); width: 1.1rem; height: 1.1rem; margin: 0; }
.boton {
  font: inherit; font-weight: 750; font-size: 1.05rem; color: #fff; background: var(--azul);
  border: 0; border-radius: 3px; padding: 0.8rem 1.4rem; min-height: 3rem; cursor: pointer; justify-self: start;
}
.boton:hover { background: #1b37a5; }

/* ---------- el recibo ---------- */
.recibo { background: var(--papel); border-top: 5px solid var(--tinta); box-shadow: 0 18px 30px -22px rgba(20, 33, 61, 0.55); position: sticky; top: 1rem; }
.recibo-titulo { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 0.85rem 1.25rem; border-bottom: 1px dashed var(--linea); font-size: 0.9rem; color: var(--gris); }
.recibo-titulo strong { color: var(--tinta); font-weight: 750; font-size: 1rem; }
.recibo-cuerpo { padding: 0.5rem 1.25rem 1.25rem; font-variant-numeric: tabular-nums; }
.recibo-vacio { color: var(--gris); margin: 1.5rem 0 1rem; max-width: 26rem; }
.recibo-aviso { color: var(--rojo); font-weight: 600; }
.recibo table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.recibo thead th { font-weight: 600; font-size: 0.82rem; color: var(--gris); text-align: right; padding: 0.6rem 0 0.4rem 0.75rem; border-bottom: 1.5px solid var(--tinta); }
.recibo thead th:first-child { text-align: left; padding-left: 0; }
.recibo tbody th { text-align: left; font-weight: 500; padding: 0.55rem 0.75rem 0.55rem 0; line-height: 1.3; }
.recibo tbody th small { display: block; font-weight: 400; font-size: 0.82rem; color: var(--gris); }
.recibo td { text-align: right; white-space: nowrap; padding: 0.55rem 0 0.55rem 0.5rem; vertical-align: top; }
.recibo tbody tr { border-bottom: 1px dotted var(--linea); }
.recibo td.desc { color: var(--rojo); }
.recibo tfoot th, .recibo tfoot td { padding-top: 0.6rem; font-weight: 700; font-size: 0.9rem; border-top: 1.5px solid var(--tinta); }
.recibo tfoot th { text-align: left; }
.neto { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 1.1rem 0 0.4rem; }
.neto span { font-weight: 700; font-size: 1.05rem; }
.neto b { font-size: clamp(1.9rem, 5vw, 2.5rem); font-weight: 850; letter-spacing: -0.035em; line-height: 1.1; }
.neto mark {
  color: inherit; padding: 0 0.22em; margin-right: -0.22em;
  background: linear-gradient(var(--resaltador), var(--resaltador)) no-repeat 0 62% / 100% 68%;
  animation: resaltar 0.45s ease-out;
}
@keyframes resaltar { from { background-size: 0% 68%; } }
.destacado { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 1rem 0 0.25rem; padding-bottom: 0.9rem; border-bottom: 1.5px solid var(--tinta); }
.destacado span { font-weight: 700; }
.destacado b { font-size: 1.9rem; font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; }
.recibo dl { margin: 0.9rem 0 0; font-size: 0.93rem; }
.recibo dl div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-top: 1px dotted var(--linea); }
.recibo dt { color: var(--gris); }
.recibo dd { margin: 0; text-align: right; font-weight: 600; }
.notas { margin: 0.9rem 0 0; padding: 0.75rem 0 0 1.1rem; border-top: 1px dashed var(--linea); font-size: 0.86rem; line-height: 1.45; color: var(--gris); }
.notas li + li { margin-top: 0.35rem; }

.vigencia { margin: 1.75rem 0 0; font-size: 0.9rem; color: var(--gris); }

/* ---------- nota y preguntas ---------- */
.nota { max-width: 44rem; padding-bottom: 1rem; }
.nota p, .nota ul, .nota ol { margin: 0 0 1rem; }
.nota li { margin-bottom: 0.3rem; }
.nota .cuenta { background: var(--papel); border-left: 5px solid var(--resaltador); padding: 0.9rem 1.1rem; font-variant-numeric: tabular-nums; }
.nota .cuenta p:last-child { margin-bottom: 0; }
.tabla-rueda { overflow-x: auto; margin: 0 0 1.2rem; }
.nota table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.95rem; background: var(--papel); }
.nota table th, .nota table td { padding: 0.5rem 0.75rem; text-align: right; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.nota table th:first-child, .nota table td:first-child { text-align: left; }
.nota thead th { font-weight: 650; font-size: 0.85rem; color: var(--gris); border-bottom: 1.5px solid var(--tinta); }
.nota tr.es-tuya td, .nota tr.es-hoy td { background: var(--resaltador); font-weight: 700; }
.fuentes { font-size: 0.88rem; color: var(--gris); }

/* ---------- índice (inicio y pie de cada página) ---------- */
.indice { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--tinta); }
.indice li { border-bottom: 1px solid var(--linea); }
.indice a { display: grid; grid-template-columns: 14rem minmax(0, 1fr) 17rem; gap: 0.25rem 1.5rem; align-items: baseline; padding: 1rem 0.5rem; color: var(--tinta); text-decoration: none; }
.indice a:hover { background: var(--papel); }
.indice a:hover .nombre { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.indice .nombre { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.025em; }
.indice .que { color: var(--gris); }
.indice .dato { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.93rem; text-align: right; }
.otras { padding-block: 1rem 3rem; }

/* ---------- pie ---------- */
.pie { border-top: 2px solid var(--tinta); margin-top: 2rem; font-size: 0.9rem; color: var(--gris); }
.pie .ancho { padding-block: 1.5rem 2.5rem; display: grid; gap: 0.6rem; }
.pie p { margin: 0; max-width: 48rem; }
.pie a { color: var(--tinta); }
.pie-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }

@media (max-width: 52rem) {
  .calc { grid-template-columns: 1fr; gap: 1.75rem; }
  .recibo { position: static; }
  .cabecera .ancho { flex-direction: column; gap: 0.5rem; padding-block: 0.75rem 0.6rem; }
  .cabecera nav { width: 100%; }
  .intro { padding-block: 1.75rem 1.25rem; }
  .indice a { grid-template-columns: 1fr; padding-inline: 0; }
  .indice .dato { text-align: left; }
}
@media (max-width: 28rem) {
  .dos { grid-template-columns: 1fr; }
  .recibo-cuerpo, .recibo-titulo { padding-inline: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .neto mark { animation: none; }
  html { scroll-behavior: auto; }
}
@media print {
  .cabecera nav, .campos, .otras, .pie, .nota, .vigencia { display: none; }
  body { background: #fff; }
  .calc { display: block; }
  .recibo { box-shadow: none; position: static; }
}
