/* base.css — Reset minimal + estilos universales (botones, inputs, links).
 * Importa tokens.css. Cualquier página debería incluir SOLO base.css y los
 * estilos específicos de su pantalla. */

@import url('./tokens.css');

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overscroll-behavior: none;
}

/* === Tipografía === */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--fg);
}
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-3) 0; }

/* === Links: estilo GitHub (azul, sin underline salvo hover) === */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--tr-fast);
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* === Código mono inline y bloques === */
code, kbd, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}
kbd {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.05em 0.35em;
  font-size: 0.85em;
}

/* === Inputs === */
button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 5px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 20px;
  transition: background var(--tr-fast), border-color var(--tr-fast);
}
button:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
}
button:active { background: var(--border); }
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button:disabled {
  color: var(--fg-muted);
  background: var(--bg-elev);
  cursor: not-allowed;
}

/* Variante primaria (acción principal) */
button.primary,
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-fg);
}
button.primary:hover,
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
  border-color: transparent;
}

/* Variante danger */
button.danger {
  color: var(--danger);
  border-color: var(--border);
}
button.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

input[type="text"], input[type="number"], input[type="search"],
input:not([type]), textarea, select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  color: var(--fg);
  width: 100%;
  font-size: var(--fs-base);
  line-height: 20px;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
}

/* === Badges/labels (estilo arxiv tag o github label) === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  background: var(--bg-elev);
  font-family: var(--font-mono);
}

/* === Mensaje de error genérico === */
.error {
  max-width: 600px;
  margin: var(--sp-8) auto;
  padding: var(--sp-5);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
}
.error h2 {
  margin-top: 0;
  color: var(--danger);
  font-size: var(--fs-lg);
}

/* === Utilidades === */
.mono { font-family: var(--font-mono); }
.dim  { color: var(--fg-dim); }
.muted{ color: var(--fg-muted); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
