/* ============================================================
   base.css — Reset, tokens de diseño, tipografía y utilidades
   Intranet Universitaria UAPA · Prototipo (solo diseño)
   ============================================================ */

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

* { margin: 0; }

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* la página nunca hace scroll horizontal; el contenido ancho scrollea en su contenedor */
}

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

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

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

button { cursor: pointer; background: none; border: none; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; color: var(--color-text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Tokens ---------- */
:root {
  /* Marca */
  --color-primary: #123C7B;
  --color-primary-600: #0E2F62;
  --color-primary-050: #EAF0FA;
  --color-accent: #F39200;
  --color-accent-050: #FEF3E2;

  /* Superficies */
  --color-bg: #F6F7F9;
  --color-surface: #FFFFFF;
  --color-surface-2: #FAFBFC;

  /* Texto */
  --color-text: #1E2430;
  --color-muted: #6B7280;
  --color-faint: #9AA1AD;

  /* Líneas */
  --color-border: #E6E8EC;
  --color-border-strong: #D3D7DE;

  /* Estados */
  --color-success: #2E7D32;
  --color-success-050: #E8F3E9;
  --color-warning: #ED6C02;
  --color-warning-050: #FDF0E3;
  --color-danger: #C62828;
  --color-danger-050: #FBEAEA;
  --color-info: #1565C0;
  --color-info-050: #E7F0FA;

  /* Formas */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);

  /* Tipografía */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --topbar-h: 60px;
  --sidebar-w: 248px;
  --container: 1200px;
  --space: 20px;

  /* Transiciones */
  --t-fast: 120ms ease;
  --t: 200ms ease;
}

/* ---------- Utilidades ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space); }

.stack > * + * { margin-top: var(--stack-gap, 16px); }
.stack-sm { --stack-gap: 8px; }
.stack-lg { --stack-gap: 28px; }

.row { display: flex; gap: var(--row-gap, 12px); align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }

.grid { display: grid; gap: var(--grid-gap, 20px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.muted { color: var(--color-muted); }
.faint { color: var(--color-faint); }
.small { font-size: .82rem; }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.divider { height: 1px; background: var(--color-border); border: 0; margin: 16px 0; }

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
