/*
  global.css — Estilos base compartidos por TODAS las páginas.
  Tipografía, layout de página, utilidades y elementos genéricos
  (botones, badges, enlaces) que no son exclusivos de una sección.
*/

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
}

body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

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

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

.section {
  position: relative;
  padding-block: var(--space-20);
}

/* Secciones secundarias (diff, pilares, stepper, integraciones, IA,
   casos de uso, visión…): mismo ancho, menos aire vertical. */
.section--tight {
  padding-block: var(--space-12);
}

@media (min-width: 721px) and (max-width: 1024px) {
  .section {
    padding-block: var(--space-16);
  }
  .section--tight {
    padding-block: var(--space-12);
  }
}

@media (max-width: 720px) {
  .section {
    padding-block: var(--space-12);
  }
  .section--tight {
    padding-block: var(--space-8);
  }
  .container {
    padding-inline: var(--space-4);
  }
}

.section-eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  max-width: 640px;
  line-height: var(--lh-relaxed);
}

.section-header {
  margin-bottom: var(--space-10);
}

.section--tight .section-header {
  margin-bottom: var(--space-8);
}

.section-header--center {
  text-align: center;
  margin-inline: auto;
}

.section-header--center .section-subtitle {
  margin-inline: auto;
}

/* ---------------------------------------------------------------------
   Botones
------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 26px;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast);
  border: 1px solid transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--gradient-brand);
  color: var(--color-text-on-primary);
  box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
  box-shadow: 0 0 0 1px rgba(61, 124, 255, 0.4), 0 16px 48px rgba(61, 124, 255, 0.28);
}

.btn--secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.btn--secondary:hover {
  border-color: var(--color-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 10px 18px;
  font-size: var(--fs-xs);
}

.btn--danger {
  background: rgba(255, 107, 107, 0.12);
  color: var(--color-danger);
  border-color: rgba(255, 107, 107, 0.35);
}

/* ---------------------------------------------------------------------
   Enlaces de texto e inline
------------------------------------------------------------------------ */
.link {
  color: var(--color-accent);
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--brand {
  background: var(--gradient-brand);
  color: var(--color-text-on-primary);
}

.badge--muted {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge--success {
  background: rgba(47, 217, 124, 0.14);
  color: var(--color-success);
}

.badge--warning {
  background: rgba(255, 194, 75, 0.14);
  color: var(--color-warning);
}

.badge--neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------
   Utilidades
------------------------------------------------------------------------ */
.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;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  z-index: var(--z-toast);
  background: var(--color-accent);
  color: #08101F;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
}

.visually-loading {
  opacity: 0;
}

/* Se aplica a <body> mientras auth.js resuelve el estado de sesión, para
   evitar el parpadeo "no autenticado" -> "autenticado". Ver navigation.js. */
[data-auth-state="pending"] [data-auth-only],
[data-auth-state="pending"] [data-guest-only] {
  visibility: hidden;
}

.eyebrow-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

/* ---------------------------------------------------------------------
   Microinteracciones de entrada — ver animations.js
------------------------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------------
   Prose — texto largo (legal, artículos). Usar dentro de .container--narrow.
------------------------------------------------------------------------ */
.prose h2 {
  font-size: var(--fs-lg);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: var(--fs-md);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.prose p {
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
}

.prose ul,
.prose ol {
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose strong {
  color: var(--color-text);
}

.prose .last-updated {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}
