/* ================================================================
   global.css — Estilos base y reset
   Importar después de variables.css
   ================================================================ */

/* ── Reset ────────────────────────────────────────────────── */
*, *::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(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Tipografía ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  color: var(--color-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-base); font-weight: var(--fw-semi); }

p {
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

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

strong  { font-weight: var(--fw-bold); }
em      { font-style: italic; }
small   { font-size: var(--text-sm); }

/* ── Imágenes y media ─────────────────────────────────────── */
img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Listas ───────────────────────────────────────────────── */
ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-1); }

/* ── Formularios base ─────────────────────────────────────── */
input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

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

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

/* ── Colores de estado para badges ───────────────────────────*/
.estado-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.estado-reportado  { background: #f1f3f5; color: var(--estado-reportado); }
.estado-revision   { background: #dbeafe; color: var(--estado-revision); }
.estado-asignado   { background: #fef3c7; color: var(--estado-asignado); }
.estado-proceso    { background: #ede9fe; color: var(--estado-proceso); }
.estado-resuelto   { background: #d1fae5; color: var(--estado-resuelto); }
.estado-cerrado    { background: #f3f4f6; color: var(--estado-cerrado); }

.prioridad-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
}
.prioridad-baja    { background: #f1f3f5; color: var(--prioridad-baja); }
.prioridad-media   { background: #dbeafe; color: var(--prioridad-media); }
.prioridad-alta    { background: #fef3c7; color: var(--prioridad-alta); }
.prioridad-critica { background: #fee2e2; color: var(--prioridad-critica); }

/* ── Toast notifications ──────────────────────────────────── */
#toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  color: var(--color-white);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn var(--transition) ease forwards;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.toast.saliendo { animation: toastOut var(--transition) ease forwards; }
.toast-exito    { background: var(--color-success); }
.toast-error    { background: var(--color-danger); }
.toast-alerta   { background: var(--color-warning); }
.toast-info     { background: var(--color-info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}

/* ── Spinner de carga ─────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Overlay de carga ─────────────────────────────────────── */
.cargando-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 51, 102, 0.4);
  backdrop-filter: blur(4px);
  z-index: 8888;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  color: var(--color-white);
  font-size: var(--text-lg);
  font-weight: var(--fw-semi);
}
.cargando-overlay .spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
}
.cargando-overlay.oculto { display: none; }

/* ── Responsive breakpoints ───────────────────────────────── */
@media (max-width: 768px) {
  .container { padding-inline: var(--space-4); }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
}
@media (max-width: 480px) {
  .container { padding-inline: var(--space-3); }
}
