/* =========================================================================
   Base: reset mínimo, tipografía, foco y utilidades de accesibilidad.
   Requiere tokens.css.
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: var(--t-md);
  line-height: var(--interlineado);
  -webkit-font-smoothing: antialiased;
}

/* El portal usa base 16 px (evita el zoom automático de iOS en los campos) */
body.portal { font-size: var(--t-lg); }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: var(--peso-fuerte);
  text-wrap: balance;
}
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); }

p { margin: 0; }
p + p { margin-top: var(--e-3); }

a {
  color: var(--primario);
  text-underline-offset: 2px;
}
/* Los enlaces con aspecto de botón (.btn) definen sus propios colores */
a:not(.btn):hover { color: var(--primario-hover); }

img, svg { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Datos de ancho fijo: Nº de orden, PIN, montos en tablas */
.mono, code, kbd {
  font-family: var(--fuente-mono);
  font-variant-ligatures: none;
}
.numeros { font-variant-numeric: tabular-nums; }

/* Textos largos del usuario (direcciones, problemas) no rompen el layout */
.texto-largo { overflow-wrap: anywhere; }

/* ---- Foco visible (nunca se elimina) --------------------------------- */
:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Accesibilidad --------------------------------------------------- */
.visualmente-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.saltar-contenido {
  position: absolute;
  left: var(--e-2);
  top: -100px;
  z-index: var(--z-dialogo);
  padding: var(--e-2) var(--e-4);
  background: var(--primario);
  color: var(--sobre-primario);
  border-radius: var(--radio-2);
  font-weight: var(--peso-medio);
}
.saltar-contenido:focus { top: var(--e-2); }
a.saltar-contenido:hover { color: var(--sobre-primario); }  /* gana sobre a:not(.btn):hover */

/* Íconos del sprite: heredan el color del texto */
.icono {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.2em;
}
.icono-lg { width: 24px; height: 24px; }

@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;
  }
}
