/* ============================================================================
   antesdelafirma · Design System 2026
   Paleta grafito + acentos premium · inspirada en Linear, Vercel, Stripe
   ============================================================================ */

:root {
  /* ─── Grafito · sustituye los negros puros (#0a0a0a) por tonos más cálidos ── */
  --ink-0: #1a1d23;          /* grafito casi negro · titulares */
  --ink-1: #2d3138;          /* grafito oscuro · texto principal */
  --ink-2: #4a4f57;          /* grafito medio · texto secundario */
  --ink-3: #6b7280;          /* gris medio · texto terciario */
  --ink-4: #9ca3af;          /* gris suave · hints, captions */
  --ink-5: #d1d5db;          /* gris muy claro · líneas finas */

  /* ─── Superficies y papel ───────────────────────────────────────── */
  --paper: #fbfbfa;          /* off-white cálido · fondo principal */
  --paper-2: #f5f5f4;        /* fondo seccional sutil */
  --surface: #ffffff;        /* cards, modales */
  --surface-elev: #ffffff;   /* cards elevados con shadow */
  --line: #e5e7eb;           /* divisor estándar */
  --line-2: #d4d4d8;         /* borde de input */
  --line-3: #f0f0ef;         /* divisor muy sutil */

  /* ─── Teal profundo de marca (2026-06-21 · migrado de esmeralda) ── */
  /*     Se conservan los nombres --green* para que cascadeen solos.   */
  --green: #14b8a6;          /* teal vivo · acentos brillantes */
  --green-dk: #0f766e;       /* TEAL PROFUNDO · color primario de marca */
  --green-darker: #134e4a;   /* teal muy oscuro · fondos/tinta */
  --green-50: #f0fdfa;       /* teal casi blanco · fondos suaves */
  --green-100: #ccfbf1;      /* teal claro */
  --green-glow: rgba(20, 184, 166, 0.18);

  /* ─── Acentos premium ───────────────────────────────────────────── */
  --amber: #f59e0b;          /* CTAs secundarios, warnings positivos */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;

  --rose: #f43f5e;           /* alertas, errores estilizados */
  --rose-50: #fff1f2;

  --blue: #3b82f6;           /* info, datos oficiales */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;

  --violet: #8b5cf6;         /* premium, beta features */
  --violet-50: #f5f3ff;

  /* ─── Gradientes (úsalos con cuidado) ───────────────────────────── */
  --grad-hero: linear-gradient(135deg, #1a1d23 0%, #2d3138 60%, #3a3f47 100%);
  --grad-green: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  --grad-paper: linear-gradient(180deg, #fbfbfa 0%, #f5f5f4 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, var(--green-glow), transparent 60%);

  /* ─── Tipografía dual · Sans (UI / data) + Serif (autoridad editorial) ── */
  /* Sans: cuerpo, UI, tablas, listas, formularios · neutral, ultra legible */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Display: titulares grandes, KPIs, números · tracking más cerrado */
  --font-display: 'Inter Tight', 'Inter', sans-serif;
  /* Serif: titulares editoriales · transmite autoridad notarial. Newsreader
     tiene optical sizes verdaderos · diseñado para texto largo en web. */
  --font-serif: 'Newsreader', 'Charter', 'Georgia', serif;
  /* Mono: refcats, código, números fijos */
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Escala tipográfica responsive (clamp) */
  --text-xs: clamp(11px, 0.7vw, 12px);
  --text-sm: clamp(12px, 0.85vw, 13px);
  --text-base: clamp(14px, 1vw, 15px);
  --text-md: clamp(15px, 1.1vw, 17px);
  --text-lg: clamp(17px, 1.3vw, 20px);
  --text-xl: clamp(20px, 1.6vw, 24px);
  --text-2xl: clamp(24px, 2vw, 32px);
  --text-3xl: clamp(32px, 3vw, 44px);
  --text-4xl: clamp(40px, 4vw, 64px);
  --text-hero: clamp(44px, 5vw, 76px);

  /* ─── Espaciado ──────────────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* ─── Radios ─────────────────────────────────────────────────────── */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 9999px;

  /* ─── Sombras ────────────────────────────────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(26, 29, 35, 0.04);
  --shadow-sm: 0 2px 4px rgba(26, 29, 35, 0.06), 0 1px 2px rgba(26, 29, 35, 0.04);
  --shadow-md: 0 4px 8px rgba(26, 29, 35, 0.06), 0 2px 4px rgba(26, 29, 35, 0.04);
  --shadow-lg: 0 12px 24px rgba(26, 29, 35, 0.08), 0 4px 8px rgba(26, 29, 35, 0.04);
  --shadow-xl: 0 20px 40px rgba(26, 29, 35, 0.10), 0 8px 16px rgba(26, 29, 35, 0.06);
  --shadow-glow-green: 0 0 0 4px var(--green-glow);
  --shadow-elev: 0 1px 0 rgba(26, 29, 35, 0.04), 0 0 0 1px rgba(26, 29, 35, 0.04), 0 4px 16px rgba(26, 29, 35, 0.04);

  /* ─── Transiciones ───────────────────────────────────────────────── */
  --t-fast: 0.12s ease;
  --t-base: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  --t-bounce: 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset minimal ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'ss01', 'kern';
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--paper);
  color: var(--ink-1);
  line-height: 1.55;
  font-size: 16px;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
ul, ol { padding-left: 1.2em; }

/* ─── Utility · tipografía ───────────────────────────────────────────── */
.t-hero { font-family: var(--font-display); font-size: var(--text-hero); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; color: var(--ink-0); }
.t-4xl  { font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; color: var(--ink-0); }
.t-3xl  { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.022em; line-height: 1.12; color: var(--ink-0); }
.t-2xl  { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.018em; line-height: 1.2; color: var(--ink-0); }
.t-xl   { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; color: var(--ink-0); }
/* Serif editorial · para autoridad jurídica · titulares "magistrado, no bloguero" */
.t-serif-3xl { font-family: var(--font-serif); font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; color: var(--ink-0); font-feature-settings: 'lnum', 'ss01'; }
.t-serif-2xl { font-family: var(--font-serif); font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; color: var(--ink-0); }
.t-serif-xl  { font-family: var(--font-serif); font-size: var(--text-xl); font-weight: 500; letter-spacing: -0.005em; line-height: 1.35; color: var(--ink-1); }
.t-lg   { font-size: var(--text-lg); font-weight: 500; line-height: 1.4; color: var(--ink-1); }
.t-md   { font-size: var(--text-md); font-weight: 400; line-height: 1.55; color: var(--ink-2); }
.t-base { font-size: var(--text-base); line-height: 1.55; color: var(--ink-2); }
.t-sm   { font-size: var(--text-sm); line-height: 1.5; color: var(--ink-3); }
.t-xs   { font-size: var(--text-xs); line-height: 1.5; color: var(--ink-4); }
.t-mono { font-family: var(--font-mono); }
.t-green { color: var(--green-dk); }
.t-strong { color: var(--ink-0); font-weight: 600; }

/* ─── Botones · primarios y secundarios ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-base), background var(--t-base), color var(--t-base);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink-0); color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--ink-1); box-shadow: var(--shadow-md); }

.btn-green {
  background: var(--green); color: white;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 4px 12px rgba(20,184,166,0.25);
}
.btn-green:hover { background: var(--green-dk); box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 6px 20px rgba(20,184,166,0.35); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; color: var(--ink-1);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-5); }

.btn-link {
  background: transparent; color: var(--ink-1); padding: 6px 10px;
  border-radius: var(--r-sm);
}
.btn-link:hover { background: var(--paper-2); color: var(--ink-0); }

.btn-lg { padding: 16px 28px; font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 28px;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.card-elev { box-shadow: var(--shadow-elev); border-color: transparent; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--ink-5); }
.card-paper { background: var(--paper-2); border-color: var(--line); }

/* ─── Pills / Badges ─────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pill-green { background: var(--green-50); color: var(--green-darker); }
.pill-blue { background: var(--blue-50); color: #1e40af; }
.pill-amber { background: var(--amber-50); color: #92400e; }
.pill-ink { background: var(--paper-2); color: var(--ink-1); }
.pill-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 0.6; }
  50% { box-shadow: 0 0 0 8px transparent; opacity: 0; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 0; }
}

/* ─── Inputs ────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--ink-0);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:hover { border-color: var(--ink-5); }
.input:focus { outline: none; border-color: var(--green); box-shadow: var(--shadow-glow-green); }
.input::placeholder { color: var(--ink-4); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink-1); text-transform: uppercase;
}
.field-hint { font-size: 12px; color: var(--ink-4); line-height: 1.45; }

/* ─── Container ──────────────────────────────────────────────────────── */
.container {
  width: 100%; max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 880px; }
.container-wide { max-width: 1400px; }

/* ─── Skip-to-content (a11y) ────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink-0); color: white; padding: 12px 20px;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ─── Animaciones reutilizables ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.anim-fadeUp { animation: fadeUp 0.6s var(--t-base) both; }
.anim-fadeIn { animation: fadeIn 0.6s ease both; }
.anim-scaleIn { animation: scaleIn 0.4s var(--t-bounce) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── Selección de texto en grafito (no azul navegador) ─────────────── */
::selection { background: var(--green-100); color: var(--green-darker); }

/* ─── Scrollbar fino ────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }
