/* ============================================================
   Civika · Sistema de diseño (rediseño, pre.civika.info)
   Variables reutilizables: colores, tipografía, espaciado,
   radios, sombras, botones, tarjetas, etiquetas, formularios.
   ============================================================ */

:root {
  /* --- Color: verde principal (según imagen de referencia) --- */
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #14532d;

  /* --- Color: neutros / texto --- */
  --ink-900: #0f172a;
  --ink-700: #1e293b;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white: #ffffff;

  /* --- Color: acentos para etiquetas de categoría --- */
  --amber-100: #fef3c7;  --amber-700: #b45309;
  --blue-100:  #dbeafe;  --blue-700:  #1d4ed8;
  --violet-100:#ede9fe;  --violet-700:#6d28d9;
  --rose-100:  #ffe4e6;  --rose-700:  #be123c;

  /* --- Estado --- */
  --danger-600: #dc2626;
  --focus-ring: 0 0 0 3px rgba(22, 163, 74, .25);

  /* --- Tipografía --- */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text-xs:   .75rem;
  --text-sm:   .875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
  --text-4xl:  2.75rem;
  --leading-tight: 1.2;
  --leading-normal: 1.55;

  /* --- Espaciado (escala 4px) --- */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* --- Radios --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* --- Sombras: discretas, sin exceso --- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 8px 28px rgba(15, 23, 42, .08);

  /* --- Layout --- */
  --container-max: 1200px;
  --header-height: 72px;
}

/* ============================================================
   Reset ligero
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-600);
  background: var(--white);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink-900); line-height: var(--leading-tight); margin: 0; font-weight: 800; }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* Foco visible siempre (accesibilidad) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

.container {
  width: min(var(--container-max), calc(100% - 2 * var(--space-6)));
  margin-inline: auto;
}

.section { padding-block: var(--space-16); }
.section-alt { background: var(--slate-50); }

/* ============================================================
   Botones
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 700; font-size: var(--text-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--green-700); color: var(--white); }
.btn-primary:hover { background: var(--green-800); }

.btn-secondary { background: var(--white); color: var(--ink-900); border-color: var(--slate-200); }
.btn-secondary:hover { border-color: var(--green-600); color: var(--green-700); }

.btn-outline { background: transparent; color: var(--green-700); border-color: var(--green-600); }
.btn-outline:hover { background: var(--green-50); }

.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); color: var(--ink-900); }

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--text-xs); }

/* Tamaño mínimo táctil accesible (44px) ya cubierto por min-height de .btn */

/* ============================================================
   Tarjetas
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-padded { padding: var(--space-6); }
.card-link { display: block; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card-link:hover { border-color: var(--green-500); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }

/* ============================================================
   Etiquetas / badges
   ============================================================ */
.tag {
  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: 700;
  line-height: 1.4;
}
.tag-green  { background: var(--green-100);  color: var(--green-700); }
.tag-amber  { background: var(--amber-100);  color: var(--amber-700); }
.tag-blue   { background: var(--blue-100);   color: var(--blue-700); }
.tag-violet { background: var(--violet-100); color: var(--violet-700); }
.tag-rose   { background: var(--rose-100);   color: var(--rose-700); }
.tag-neutral{ background: var(--slate-100);  color: var(--slate-600); }

/* ============================================================
   Formularios
   ============================================================ */
.field-label {
  display: block; margin-bottom: var(--space-2);
  font-size: var(--text-sm); font-weight: 700; color: var(--ink-900);
}
.field-input {
  width: 100%; min-height: 48px; padding: 0 var(--space-4);
  border: 1px solid var(--slate-200); border-radius: var(--radius-md);
  background: var(--white); color: var(--ink-900); font-size: var(--text-base);
}
.field-input::placeholder { color: var(--slate-400); }
.field-input:focus { border-color: var(--green-600); }

/* ============================================================
   Utilidades de estado de interacción / accesibilidad
   ============================================================ */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--green-700); color: var(--white);
  padding: var(--space-3) var(--space-5); border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  .section { padding-block: var(--space-10); }
}
