/*
 * SecureChat · landing estática (ADR-021). Sin JavaScript.
 * Marca índigo (ADR-030): primario #4F46E5 (texto blanco 6,3:1, AA), acento #6366F1, sobre
 * la base de Able Pro v11 (secondary #5B6B79, fondo #F8F9FA, Inter var) para que la web
 * pública, el portal /business, la página de invitación y la app se vean como el mismo
 * producto. Variables en :root para reutilizarlas en otras páginas estáticas.
 */
@font-face {
  font-family: 'Inter var';
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
  src: url('/assets/fonts/Inter-roman.var.woff2') format('woff2');
}

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-lighter: #eef2ff;
  --primary-light: #c7d2fe;
  --accent: #6366f1;
  --text: #1d2630;
  --text-2: #5b6b79;
  --muted: #8996a4;
  --border: #dbe0e5;
  --bg: #f8f9fa;
  --paper: #ffffff;
  --success: #2ca87f;
  --success-lighter: #e6f5ef;
  --warning: #e58a00;
  --warning-lighter: #fdf3e2;
  --error: #dc2626;
  --dark: #1d2630;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --font: 'Inter var', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary-dark);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary);
}

/* Foco visible para teclado (WCAG 2.4.7). */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
  color: #fff;
}

.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;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 800px;
}

/* ── Cabecera ─────────────────────────────────────────────────────────── */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

.brand svg {
  width: 32px;
  height: 32px;
  flex: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.nav a {
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.nav .btn {
  border-bottom: 0;
  padding: 8px 14px;
}

/* `.nav a` (0,1,1) gana a `.btn-primary` (0,1,0): sin esto el texto del botón sale gris
   sobre índigo. Blanco sobre #4F46E5 = 6,3:1 (AA); en hover, sobre #4338CA. */
.nav a.btn-primary,
.nav a.btn-primary:hover {
  color: #fff;
}

/* ── Botones ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-outline {
  background: var(--paper);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.btn-outline:hover {
  background: var(--primary-lighter);
}

.btn-dark {
  background: var(--dark);
  color: #fff;
}

.btn-dark:hover {
  background: #131920;
  color: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ── Portada ──────────────────────────────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--primary-lighter), transparent 70%),
    linear-gradient(180deg, var(--paper), var(--bg));
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-lighter);
  color: var(--primary-dark);
  font-size: 0.8125rem;
  font-weight: 600;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--text);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero h1 .accent {
  color: var(--primary);
}

.lead {
  margin: 0;
  font-size: 1.125rem;
  color: var(--text-2);
  max-width: 60ch;
}

.hero-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat li {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.chat .them {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat .me {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat .who {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.75;
}

.chat-caption {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── Secciones ────────────────────────────────────────────────────────── */
.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--paper);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.01em;
}

.section-intro {
  margin: 0 0 32px;
  color: var(--text-2);
  max-width: 70ch;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.card p {
  margin: 0 0 8px;
  color: var(--text-2);
}

.card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--text-2);
}

.card li {
  margin-bottom: 6px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--primary-lighter);
  color: var(--primary-dark);
}

.icon svg {
  width: 24px;
  height: 24px;
}

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 20px 20px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 16px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.cta {
  background: var(--dark);
  color: #fff;
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta h2 {
  color: #fff;
  margin: 0 0 8px;
}

.cta p {
  margin: 0;
  color: #bec8d0;
  max-width: 60ch;
}

/* ── Páginas de texto (legales, seguridad, soporte) ───────────────────── */
.page-head {
  padding: 48px 0 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
}

.page-head p {
  margin: 0;
  color: var(--text-2);
}

.prose {
  padding: 40px 0 64px;
}

.prose h2 {
  margin: 40px 0 12px;
  font-size: 1.375rem;
}

.prose h3 {
  margin: 28px 0 8px;
  font-size: 1.0625rem;
}

.prose p,
.prose li {
  color: #3e4853;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.toc {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.toc h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.toc ol {
  margin: 0;
}

.note,
.warn,
.ok {
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
  border: 1px solid;
}

.note {
  background: var(--primary-lighter);
  border-color: var(--primary-light);
}

.warn {
  background: var(--warning-lighter);
  border-color: #f7dcb3;
}

.ok {
  background: var(--success-lighter);
  border-color: #c0e5d9;
}

.note p,
.warn p,
.ok p {
  margin: 0;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.875em;
}

code {
  background: #f3f5f7;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  word-break: break-word;
}

pre {
  margin: 12px 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--dark);
  color: #f8f9fa;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.key {
  display: block;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px dashed var(--primary-light);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.9375rem;
  word-break: break-all;
  user-select: all;
}

.big-code {
  display: inline-block;
  padding: 10px 16px;
  border: 2px dashed var(--primary-light);
  border-radius: 12px;
  background: #f5f8ff;
  color: var(--primary-dark);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.yes,
.no {
  list-style: none;
  padding-left: 0 !important;
}

.yes li,
.no li {
  position: relative;
  padding-left: 28px;
}

.yes li::before,
.no li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}

.yes li::before {
  content: '✓';
  color: var(--success);
}

.no li::before {
  content: '✕';
  color: var(--error);
}

details {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary {
  margin-bottom: 8px;
}

/* ── Pie ──────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 32px 0 40px;
  background: var(--paper);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-2);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--text-2);
}

.site-footer p {
  margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid-2,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .section {
    padding: 48px 0;
  }

  .cta {
    padding: 28px 22px;
  }

  .actions .btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header nav,
  .skip-link,
  .actions {
    display: none;
  }

  body {
    background: #fff;
  }
}
