/* ==============================================================================
   ByteFactura — Tipografía Base, Reset y Accesibilidad
   ============================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-texto);
  color: var(--texto);
  background-color: var(--papel);
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-titulo);
  color: var(--tinta);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.125rem; }

p {
  color: var(--texto-2);
  margin-bottom: 1rem;
}

a {
  color: var(--marca-azul, #1d4ed8);
  text-decoration: none;
  transition: color var(--t-rapida);
}

a:hover {
  color: var(--tinta);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--marca-azul, #2563eb);
  outline-offset: 2px;
}

.num-mono {
  font-family: var(--f-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.contenedor {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.contenedor-estrecho {
  max-width: 860px;
}

.trama-renglon {
  background-image: linear-gradient(var(--linea) 1px, transparent 1px);
  background-size: 100% 24px;
}

img, svg, video, canvas { max-width: 100%; height: auto; }
.tabla-contenedor { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Utilidades de alineación y color */
.text-right, .txt-der { text-align: right !important; }
.text-center, .txt-cen { text-align: center !important; }
.txt-peligro { color: var(--error) !important; }
.txt-ok { color: var(--ok) !important; }
.etiqueta-sub {
  font-size: 0.78rem;
  color: var(--texto-3);
  margin-top: 0.15rem;
}

@media (max-width: 768px) {
  h1 { font-size: 1.95rem; }
  h2 { font-size: 1.5rem; }
  .contenedor { padding-left: 1rem; padding-right: 1rem; }
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 1rem !important; }
  table { font-size: 0.85rem; }
  input, select, textarea { font-size: 16px; }
}
