/* ============================================================================
   SRF Consultores — Visual foundations
   Consultoría, implementación y soporte Microsoft Dynamics 365 · Bogotá, Colombia

   Dirección visual: corporativa B2B sobria y técnica, alineada con el sitio
   srfconsultores.com — índigo profundo como color de marca, un acento violeta,
   tipografía Geist y superficies claras con esquinas generosas.

   Todo componente del sistema consume estos tokens. No escribas hex sueltos.
   ========================================================================== */

/* Geist variable, la misma tipografía que sirve srfconsultores.com. Se empaqueta
   con la app para no depender de un tercero en tiempo de ejecución. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/geist-variable.woff2') format('woff2');
}

:root {
  /* ---------------------------------------------------------------------
     1. TIPOGRAFÍA — familias
     Geist es la tipografía del sitio corporativo. Detrás va el stack de
     respaldo para el instante previo a que cargue la variable.
     --------------------------------------------------------------------- */
  --font-display:
    'Geist', 'Segoe UI Variable Display', 'Segoe UI', Inter, system-ui, -apple-system,
    'Helvetica Neue', Arial, sans-serif;
  --font-sans:
    'Geist', 'Segoe UI Variable Text', 'Segoe UI', Inter, system-ui, -apple-system,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono:
    'Cascadia Code', 'Cascadia Mono', Consolas, ui-monospace, 'SF Mono', Menlo, monospace;

  /* Pesos autorizados. 300 y 800+ no se usan: rompen la sobriedad corporativa. */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---------------------------------------------------------------------
     2. TIPOGRAFÍA — escala fluida (ratio ~1.25)
     --------------------------------------------------------------------- */
  --text-display-xl: clamp(2.5rem, 1.6rem + 3.6vw, 4rem); /* 40 → 64 */
  --text-display-lg: clamp(2rem, 1.4rem + 2.4vw, 3rem); /* 32 → 48 */
  --text-h1: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem); /* 28 → 40 */
  --text-h2: clamp(1.5rem, 1.25rem + 1vw, 2rem); /* 24 → 32 */
  --text-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); /* 20 → 24 */
  --text-h4: 1.125rem; /* 18 */
  --text-body-lg: 1.0625rem; /* 17 */
  --text-body: 1rem; /* 16 */
  --text-body-sm: 0.875rem; /* 14 */
  --text-caption: 0.8125rem; /* 13 */
  --text-eyebrow: 0.75rem; /* 12 */

  /* Interlineado: ≥1.45 en texto corrido, ≥1.20 en displays. */
  --leading-display: 1.08;
  --leading-heading: 1.22;
  --leading-body: 1.6;
  --leading-tight: 1.45;

  /* Tracking: negativo en displays, positivo y amplio en eyebrows. */
  --tracking-display: -0.022em;
  --tracking-heading: -0.012em;
  --tracking-body: 0;
  --tracking-eyebrow: 0.12em;

  --measure-prose: 68ch;
  --measure-narrow: 46ch;

  /* ---------------------------------------------------------------------
     3. COLOR — índigo de marca
     Los peldaños marcados «sitio» están tomados literalmente de las variables
     globales de srfconsultores.com; el resto interpola entre ellos para
     completar la escala. --brand-600 es el color de acción primaria.
     --------------------------------------------------------------------- */
  --brand-950: #060311; /* sitio — fondo más profundo */
  --brand-900: #0c1129; /* sitio */
  --brand-800: #0a1a5c; /* sitio — primario corporativo */
  --brand-700: #16226b;
  --brand-600: #2b237c; /* sitio — acción primaria */
  --brand-500: #414bae;
  --brand-400: #5e78e4; /* sitio */
  --brand-300: #93a6ef;
  --brand-200: #c4cff7;
  --brand-100: #e7edf3; /* sitio */
  --brand-50: #f4f7ff; /* sitio */

  /* ---------------------------------------------------------------------
     4. COLOR — acento violeta (único acento del sistema)
     600 es el violeta del sitio y llega a 5.2:1 sobre blanco, así que vale
     también para texto. 300 es la variante para superficies índigo.
     --------------------------------------------------------------------- */
  --accent-700: #4a2fd1;
  --accent-600: #6f4bf2; /* sitio */
  --accent-500: #8468f5;
  --accent-300: #b3a2fa;
  --accent-100: #eeeafe;

  /* ---------------------------------------------------------------------
     5. COLOR — neutrales fríos
     Mismo matiz índigo que la marca, para que un gris junto a un azul no
     delate dos familias distintas.
     --------------------------------------------------------------------- */
  --gray-900: #191b2a;
  --gray-800: #2a2d3f;
  --gray-700: #3f4356;
  --gray-600: #565b73;
  --gray-500: #757a91; /* eco del gris de texto del sitio (#7A7A7A) */
  --gray-400: #9ca2b8;
  --gray-300: #c8cedc;
  --gray-200: #dfe3ec;
  --gray-100: #eef1f7;
  --gray-50: #f7f8fc;
  --white: #ffffff;

  /* ---------------------------------------------------------------------
     6. COLOR — semánticos
     Tonos apagados, del mismo registro corporativo. Ningún neón.
     --------------------------------------------------------------------- */
  --success-700: #14603a;
  --success-600: #1f7a4c;
  --success-100: #e4f2ea;
  --warning-700: #8a5309;
  --warning-600: #a9660b;
  --warning-100: #fbf0dc;
  --danger-700: #8e1d17;
  --danger-600: #b3261e;
  --danger-100: #fbe7e5;
  --info-600: var(--brand-600);
  --info-100: var(--brand-100);

  /* ---------------------------------------------------------------------
     7. SUPERFICIES Y TEXTO (tema claro — el tema por defecto)
     --------------------------------------------------------------------- */
  --surface-page: var(--white);
  --surface-subtle: var(--gray-50);
  --surface-raised: var(--white);
  --surface-sunken: var(--gray-100);
  --surface-brand: var(--brand-900);
  --surface-brand-soft: var(--brand-100);
  --surface-accent-soft: var(--accent-100);
  --surface-overlay: rgba(6, 3, 17, 0.62);

  --text-primary: var(--brand-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500); /* solo ≥18px o elementos no textuales */
  --text-inverse: var(--white);
  --text-inverse-secondary: #c2c6dc;
  --text-brand: var(--brand-600);
  --text-accent: var(--accent-600);
  --text-link: var(--brand-600);
  --text-link-hover: var(--brand-700);

  --border-subtle: var(--gray-200);
  --border-default: var(--gray-300);
  --border-strong: var(--gray-400);
  --border-brand: var(--brand-600);
  --border-inverse: rgba(255, 255, 255, 0.16);
  --hairline: 1px solid var(--border-subtle);

  /* ---------------------------------------------------------------------
     8. ESPACIADO — base 4, saltos de 8 desde el nivel 4
     --------------------------------------------------------------------- */
  --space-0: 0;
  --space-1: 0.25rem; /* 4  */
  --space-2: 0.5rem; /* 8  */
  --space-3: 0.75rem; /* 12 */
  --space-4: 1rem; /* 16 */
  --space-5: 1.25rem; /* 20 */
  --space-6: 1.5rem; /* 24 */
  --space-8: 2rem; /* 32 */
  --space-10: 2.5rem; /* 40 */
  --space-12: 3rem; /* 48 */
  --space-16: 4rem; /* 64 */
  --space-20: 5rem; /* 80 */
  --space-24: 6rem; /* 96 */
  --space-32: 8rem; /* 128 */

  --gutter-page: clamp(1.25rem, 4vw, 3.5rem);
  --section-block: clamp(3.5rem, 7vw, 7rem);
  --container-max: 1200px;
  --container-narrow: 820px;

  /* ---------------------------------------------------------------------
     9. RADIOS — nada de píldoras salvo en chips
     El sitio corporativo redondea sus tarjetas a 12, 16 y 22 px; la escala
     aterriza en esos tres valores para que una tarjeta de la consola y una
     del sitio se lean como la misma familia.
     --------------------------------------------------------------------- */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 22px;
  --radius-pill: 999px;

  /* ---------------------------------------------------------------------
     10. ELEVACIÓN — sombras frías y bajas; la jerarquía la carga el hairline
     --------------------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(12, 17, 41, 0.06);
  --shadow-sm: 0 1px 2px rgba(12, 17, 41, 0.06), 0 2px 6px rgba(12, 17, 41, 0.05);
  --shadow-md: 0 2px 4px rgba(12, 17, 41, 0.05), 0 8px 20px rgba(12, 17, 41, 0.07);
  --shadow-lg: 0 4px 8px rgba(12, 17, 41, 0.05), 0 18px 40px rgba(12, 17, 41, 0.1);
  --shadow-xl: 0 8px 16px rgba(12, 17, 41, 0.06), 0 32px 64px rgba(12, 17, 41, 0.14);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* ---------------------------------------------------------------------
     11. FOCO — anillo de 2px + halo; siempre :focus-visible, nunca :focus
     --------------------------------------------------------------------- */
  --focus-ring-color: var(--brand-600);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-halo: 0 0 0 4px rgba(111, 75, 242, 0.22);
  --focus-halo-inverse: 0 0 0 4px rgba(179, 162, 250, 0.34);

  /* ---------------------------------------------------------------------
     12. MOTION — la animación responde a un evento, nunca decora
     --------------------------------------------------------------------- */
  --duration-instant: 90ms;
  --duration-fast: 140ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-entrance: cubic-bezier(0, 0, 0, 1);
  --ease-exit: cubic-bezier(0.3, 0, 1, 1);

  /* ---------------------------------------------------------------------
     13. ALTURAS DE CONTROL — objetivo táctil mínimo 44×44
     --------------------------------------------------------------------- */
  --control-height-sm: 36px;
  --control-height-md: 44px;
  --control-height-lg: 52px;
  --touch-target-min: 44px;

  --z-base: 0;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ============================================================================
   Superficie oscura. Se aplica con [data-surface="dark"] sobre cualquier
   contenedor (header navy, hero, footer). No es un dark mode de producto:
   es la inversión de superficie que la marca ya usa en secciones de autoridad.
   ========================================================================== */
[data-surface='dark'] {
  --surface-page: var(--brand-900);
  --surface-subtle: var(--brand-800);
  --surface-raised: rgba(255, 255, 255, 0.05);
  --surface-sunken: var(--brand-950);

  --text-primary: var(--white);
  --text-secondary: var(--text-inverse-secondary);
  --text-tertiary: #959bb8;
  --text-brand: var(--accent-300);
  --text-accent: var(--accent-300);
  --text-link: var(--accent-300);
  --text-link-hover: var(--white);

  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-default: rgba(255, 255, 255, 0.2);
  --border-strong: rgba(255, 255, 255, 0.34);

  --focus-ring-color: var(--accent-300);
  --focus-halo: var(--focus-halo-inverse);

  color: var(--text-primary);
  background-color: var(--surface-page);
}

/* ============================================================================
   Base de documento
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  color: var(--text-primary);
  background-color: var(--surface-page);
  font-feature-settings:
    'kern' 1,
    'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------------------------
   Encabezados
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-primary);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  letter-spacing: var(--tracking-heading);
}

h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
}

.display-xl,
.display-lg {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.display-xl {
  font-size: var(--text-display-xl);
}
.display-lg {
  font-size: var(--text-display-lg);
}

/* ---------------------------------------------------------------------------
   Texto corrido
   -------------------------------------------------------------------------- */
p,
li,
dd {
  text-wrap: pretty;
}

p {
  margin: 0;
  line-height: var(--leading-body);
  max-width: var(--measure-prose);
}

.lead {
  font-size: var(--text-body-lg);
  line-height: 1.62;
  color: var(--text-secondary);
}

.text-sm {
  font-size: var(--text-body-sm);
  line-height: var(--leading-tight);
}
.caption {
  font-size: var(--text-caption);
  line-height: var(--leading-tight);
  color: var(--text-secondary);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-accent);
}

/* Cifras en tablas y KPI: siempre tabulares y alineadas a la derecha. */
.numeric {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  text-align: right;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9375em;
  font-variant-ligatures: none;
}

code {
  padding: 0.12em 0.36em;
  border-radius: var(--radius-sm);
  background-color: var(--surface-sunken);
  color: var(--brand-700);
}

a {
  color: var(--text-link);
  text-decoration-color: color-mix(in oklch, currentColor 42%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--text-link-hover);
  text-decoration-color: currentColor;
}

/* ---------------------------------------------------------------------------
   Foco global — visible, 2px, con halo. Nunca se suprime.
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

::selection {
  background-color: var(--brand-100);
  color: var(--brand-900);
}

/* ---------------------------------------------------------------------------
   Marca — el logo SIEMPRE se dimensiona por ancho, nunca por alto
   -------------------------------------------------------------------------- */
.ds-logo,
.brand img,
header img[src*='logo-'],
footer img[src*='logo-'] {
  width: clamp(132px, 9vw, 220px);
  height: auto;
  max-height: 52px;
  object-fit: contain;
  display: block;
}

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