/*
 * LegalClaro — Design System
 * Identidad visual definitiva (decisión de María, sesión 20/06/2026):
 * azul marino #004a6e + verde acento #48d1a5 + fondo gris claro #f4f6f8.
 * Tipografía: Roboto (headings) + Open Sans (body).
 * Sustituye la paleta navy/claro/amber-oklch + Plus Jakarta Sans anterior.
 *
 * CÓMO USAR:
 * - Usar SOLO estas variables en todos los archivos CSS/HTML
 * - Prohibido: hex hardcodeados, px inventados, inline styles
 * - Mobile-first: todo se diseña a 375px primero
 */

/* ─────────────────────────────────────────────
   FUENTES AUTOHOSPEDADAS (Roboto headings / Open Sans body)
   Regla dura de la Factory (DSGVO): PROHIBIDO fonts.googleapis.com /
   fonts.gstatic.com — woff2 propios en /fonts/, subset latin.
   ───────────────────────────────────────────── */
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/open-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/open-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/open-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto';
  src: url('../fonts/roboto-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}


:root {

  /* ─── PALETA DE COLOR ─────────────────────────
     Navy: azul marino corporativo — autoridad / confianza
     Verde: acento vibrante — CTAs y energía
     Gris claro: fondo de marca
     ─────────────────────────────────────────── */

  /* Navy — principal brand color (#004a6e) */
  --navy-950: #001e2e;
  --navy-900: #00293d;   /* texto sobre fondo claro */
  --navy-800: #004a6e;   /* headings primarios / brand base */
  --navy-700: #0c5a80;
  --navy-600: #1a6c93;
  --navy-500: #0072a0;   /* azul medio (primary-light eRecht24) */
  --navy-300: #9bc6d6;   /* hover de borde sobre fondo claro (botón free) */
  --navy-200: #b9d8e3;
  --navy-100: #dfedf2;   /* fondos muy sutiles */
  --navy-50:  #f1f7fa;

  /* Claro (verde vibrante) — identidad de marca / acento */
  --claro-700: #2f9c79;   /* hover oscuro (accent-green-hover) */
  --claro-600: #3cb388;   /* hover */
  --claro-500: #48d1a5;   /* primary accent (verde vibrante) */
  --claro-400: #6bdab5;
  --claro-300: #8fe3c6;
  --claro-100: #def7ee;   /* tint fondos */
  --claro-50:  #eefbf7;

  /* Warm — alias retenido por compatibilidad de nombre; en esta identidad
     usa el mismo verde de acento (no se introduce un tercer color) */
  --warm-700:  var(--claro-700);
  --warm-600:  var(--claro-600);
  --warm-500:  var(--claro-500);
  --warm-400:  var(--claro-400);
  --warm-100:  var(--claro-100);
  --warm-50:   var(--claro-50);

  /* Semantic colors */
  --color-success:     #2f9c79;
  --color-success-bg:  #eefbf7;
  --color-error:       #c0392b;
  --color-error-bg:    #fbeae8;
  --color-warning:     #d98c1f;
  --color-warning-bg:  #fdf3e3;

  /* ─── TOKENS SEMÁNTICOS ──────────────────────
     Usar ESTOS tokens en los componentes, no los raw
     ─────────────────────────────────────────── */

  --color-bg:          #ffffff;
  --color-bg-subtle:   #f4f6f8;   /* gris claro de marca */
  --color-bg-muted:    var(--navy-100);
  --color-surface:     #ffffff;
  --color-border:      #e0e4e7;
  --color-border-strong: #c7ced3;

  --color-ink:         #333333;
  --color-ink-muted:   #666666;
  --color-ink-subtle:  #888888;
  --color-ink-inverted: #ffffff;

  --color-brand:       var(--navy-800);
  --color-brand-dark:  var(--navy-950);
  --color-accent:      var(--claro-500);
  --color-accent-dark: var(--claro-700);
  --color-cta:         var(--claro-500);
  --color-cta-hover:   var(--claro-600);
  --color-cta-text:    var(--navy-800);   /* texto oscuro sobre verde, como index2 */

  /* ─── TIPOGRAFÍA ─────────────────────────────
     Roboto para headings (autoridad), Open Sans para cuerpo (legibilidad)
     ─────────────────────────────────────────── */

  --font-sans: 'Open Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;

  /* Escala tipográfica — mobile first */
  --text-xs:   0.75rem;     /* 12px — legal fine print */
  --text-sm:   0.875rem;    /* 14px — labels, captions */
  --text-base: 1rem;        /* 16px — body */
  --text-lg:   1.125rem;    /* 18px — intro, lead */
  --text-xl:   1.25rem;     /* 20px — H4 */
  --text-2xl:  1.5rem;      /* 24px — H3 */
  --text-3xl:  1.875rem;    /* 30px — H2 mobile */
  --text-4xl:  2.25rem;     /* 36px — H2 desktop */
  --text-5xl:  3rem;        /* 48px — H1 mobile */
  --text-6xl:  clamp(3rem, 5vw, 4rem); /* H1 desktop — máximo 64px */

  /* Line heights */
  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Font weights */
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold: 600;
  --weight-bold:    700;
  --weight-extrabold: 800;

  /* Letter spacing */
  --tracking-tight:  -0.01em;   /* Roboto necesita menos tracking negativo que Plus Jakarta */
  --tracking-normal:  0em;
  --tracking-wide:    0.04em;   /* labels, tags */
  --tracking-wider:   0.08em;   /* ALL CAPS labels */

  /* ─── ESPACIADO ──────────────────────────────
     Base 4px — escala consistente
     ─────────────────────────────────────────── */

  --space-1:  0.25rem;  /* 4px */
  --space-2:  0.5rem;   /* 8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-7:  1.75rem;  /* 28px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-14: 3.5rem;   /* 56px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Secciones verticales */
  --section-py-sm:  var(--space-12);  /* sección compacta */
  --section-py:     var(--space-20);  /* sección normal */
  --section-py-lg:  var(--space-32);  /* sección hero/feature */

  /* ─── CONTENEDORES ───────────────────────────
     Max-widths para alinear con la referencia eRecht24-style
     ─────────────────────────────────────────── */

  --container-text:   42rem;   /* 672px — lectura cómoda */
  --container-sm:     48rem;   /* 768px */
  --container-md:     64rem;   /* 1024px */
  --container-lg:     80rem;   /* 1280px — máximo */
  --container-pad:    var(--space-5);     /* padding horizontal mobile */
  --container-pad-lg: var(--space-8);    /* padding horizontal desktop */

  /* ─── BORDER RADIUS ──────────────────────────
     Ligeramente redondeado — professional, no infantil
     (index2 usa 4px en botones; se mantiene la escala existente
     y se añade --radius-xs para igualar ese matiz puntual)
     ─────────────────────────────────────────── */

  --radius-xs:   0.25rem;   /* 4px — botones tipo index2 */
  --radius-sm:   0.25rem;   /* 4px — inputs, tags */
  --radius-md:   0.5rem;    /* 8px — cards pequeñas */
  --radius-lg:   0.75rem;   /* 12px — cards normales */
  --radius-xl:   1rem;      /* 16px — cards grandes */
  --radius-2xl:  1.5rem;    /* 24px — sections, modals */
  --radius-full: 9999px;    /* botones pill, badges */

  /* ─── SOMBRAS ────────────────────────────────
     Navy-tinted — coherente con el azul marino de marca
     ─────────────────────────────────────────── */

  --shadow-xs:  0 1px 2px rgba(0, 41, 61, 0.06);
  --shadow-sm:  0 1px 3px rgba(0, 41, 61, 0.08),
                0 1px 2px rgba(0, 41, 61, 0.06);
  --shadow-md:  0 4px 12px rgba(0, 41, 61, 0.10),
                0 2px 4px rgba(0, 41, 61, 0.06);
  --shadow-lg:  0 16px 40px rgba(0, 41, 61, 0.12),
                0 6px 16px rgba(0, 41, 61, 0.08);
  --shadow-xl:  0 24px 64px rgba(0, 41, 61, 0.16),
                0 8px 24px rgba(0, 41, 61, 0.10);

  /* ─── Z-INDEX SCALE ──────────────────────────
     Semántico — nunca 999 o 9999
     ─────────────────────────────────────────── */

  --z-below:          -1;
  --z-base:            0;
  --z-raised:         10;
  --z-dropdown:      100;
  --z-sticky:        200;
  --z-modal-backdrop: 300;
  --z-modal:         400;
  --z-toast:         500;
  --z-tooltip:       600;

  /* ─── TRANSICIONES ───────────────────────────
     Ease-out siempre — feedback inmediato, aterrizaje suave
     ─────────────────────────────────────────── */

  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);        /* expo out */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}


/* ─────────────────────────────────────────────
   RESET MÍNIMO — solo lo necesario
   ───────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  word-break: break-word;
}

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

a {
  color: var(--navy-500);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--navy-700);
}


/* ─────────────────────────────────────────────
   TIPOGRAFÍA BASE — headings con tracking correcto
   ───────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--navy-800);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 { font-size: var(--text-5xl); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); letter-spacing: var(--tracking-normal); }
h5 { font-size: var(--text-lg); letter-spacing: var(--tracking-normal); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

p {
  line-height: var(--leading-normal);
  max-width: 65ch;
  text-wrap: pretty;
}


/* ─────────────────────────────────────────────
   LAYOUT UTILITIES
   ───────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-lg);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--text {
  max-width: var(--container-text);
}

.container--md {
  max-width: var(--container-md);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--container-pad-lg);
  }
}


/* ─────────────────────────────────────────────
   COMPONENTES BASE
   ───────────────────────────────────────────── */

/* Botón primario — verde acento (CTA principal, igual que index2) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--color-cta);
  color: var(--color-cta-text);
  border-color: var(--color-cta);
}

.btn-primary:hover {
  background-color: var(--color-cta-hover);
  border-color: var(--color-cta-hover);
  color: var(--color-cta-text);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

/* Botón secundario — navy outline */
.btn-secondary {
  background-color: transparent;
  color: var(--color-brand);
  border-color: var(--color-brand);
}

.btn-secondary:hover {
  background-color: var(--color-brand);
  color: var(--color-ink-inverted);
  text-decoration: none;
}

/* Botón accent — verde (alias de primary en esta identidad de 2 colores) */
.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-cta-text);
  border-color: var(--color-accent);
}

.btn-accent:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-cta-text);
  text-decoration: none;
}

/* Tamaños de botones */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}


/* Badge / chip */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background-color: var(--claro-100);
  color: var(--claro-700);
}

.badge-warm {
  background-color: var(--claro-100);
  color: var(--claro-700);
}

.badge-navy {
  background-color: var(--navy-100);
  color: var(--navy-700);
}


/* Card */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
}


/* Section base */
.section {
  padding-block: var(--section-py);
}

.section-subtle {
  background-color: var(--color-bg-subtle);
}

.section-brand {
  background-color: var(--navy-800);
  color: white;
}

.section-brand h1,
.section-brand h2,
.section-brand h3 {
  color: white;
}


/* ─────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────── */

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