/* ─────────────────────────────────────────────────────────────
   base.css — Variables, reset, tipografía
   FlowCore · Fase 1
   ───────────────────────────────────────────────────────────── */

/* Variables globales — cambiar aquí afecta todo el sistema */
:root {
  /* Colores principales */
  --color-bg:          #ffffff;
  --color-bg-secondary:#f5f5f3;
  --color-bg-tertiary: #eeede8;

  --color-text:        #1a1a18;
  --color-text-muted:  #6b6b66;
  --color-text-hint:   #9e9d97;

  --color-border:      rgba(0,0,0,0.10);
  --color-border-md:   rgba(0,0,0,0.18);

  /* Colores semánticos */
  --color-primary:     #185fa5;
  --color-primary-bg:  #e6f1fb;
  --color-success:     #0f6e56;
  --color-success-bg:  #e1f5ee;
  --color-warning:     #ba7517;
  --color-warning-bg:  #faeeda;
  --color-danger:      #a32d2d;
  --color-danger-bg:   #fcebeb;

  /* Rutas */
  --color-route-a-bg:  #b5d4f4;
  --color-route-a-txt: #0c447c;
  --color-route-b-bg:  #9fe1cb;
  --color-route-b-txt: #085041;
  --color-route-c-bg:  #fac775;
  --color-route-c-txt: #633806;
  --color-route-d-bg:  #f4c0d1;
  --color-route-d-txt: #72243e;

  /* Espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Bordes */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Tipografía */
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-size-lg: 15px;
  --font-size-xl: 18px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

  /* Transiciones */
  --transition: 150ms ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:          #1c1c1a;
    --color-bg-secondary:#252523;
    --color-bg-tertiary: #2e2e2b;
    --color-text:        #e8e7e0;
    --color-text-muted:  #a09f97;
    --color-text-hint:   #6b6a63;
    --color-border:      rgba(255,255,255,0.08);
    --color-border-md:   rgba(255,255,255,0.15);
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  color: var(--color-text);
  background: var(--color-bg-tertiary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Loading screen */
#app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: var(--space-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

#app-loading .loading-icon {
  font-size: 28px;
  color: var(--color-primary);
  animation: spin 1s linear infinite;
}

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

/* Utilidades de texto */
.text-muted    { color: var(--color-text-muted); }
.text-hint     { color: var(--color-text-hint); }
.text-sm       { font-size: var(--font-size-sm); }
.text-xs       { font-size: var(--font-size-xs); }
.text-bold     { font-weight: 500; }
.text-mono     { font-family: var(--font-mono); }
