/* =========================================================
   LEGEX — Sitio web
   Tokens derivados del Design System V3 (Manual Maestro)
   Sin fuentes ni scripts de terceros.
   ========================================================= */

:root {
  /* Marca */
  --navy: #00488F;
  --navy-600: #003A75;
  --navy-700: #002C5A;
  --navy-900: #001A36;
  --azure: #0063A6;
  --steel: #8D9297;

  /* Neutros (escala Apple HIG) */
  --ink: #1D1D1F;
  --ink-2: #424245;
  --muted: #6E6E73;
  --line: #E5E5EA;
  --line-2: #D2D2D7;
  --surface: #FFFFFF;
  --surface-2: #F5F5F7;
  --surface-3: #F2F2F7;
  --bg: #FFFFFF;

  /* Semántica */
  --ok: #10B981;
  --warn: #F59E0B;
  --danger: #EF4444;

  --badge-ok-bg: rgba(16, 185, 129, .10);   --badge-ok-fg: #065F46;
  --badge-warn-bg: rgba(245, 158, 11, .12); --badge-warn-fg: #92400E;
  --badge-danger-bg: rgba(239, 68, 68, .10);--badge-danger-fg: #991B1B;
  --badge-info-bg: rgba(0, 72, 143, .08);   --badge-info-fg: #00488F;

  --accent: var(--navy);
  --logo-l: #00488F;
  --accent-hover: var(--navy-600);
  --accent-soft: rgba(0, 72, 143, .07);
  --on-accent: #FFFFFF;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 26, 54, .07);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .04), 0 24px 60px rgba(0, 26, 54, .14);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --container: 1200px;
  --gutter: 24px;
  --header-h: 68px;

  color-scheme: light;
}

/* ---------- Modo oscuro ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F5F5F7;
    --ink-2: #D2D2D7;
    --muted: #A1A1A6;
    --line: #2C2C2E;
    --line-2: #3A3A3C;
    --surface: #1C1C1E;
    --surface-2: #161618;
    --surface-3: #2C2C2E;
    --bg: #0E0E10;
    --accent: #4C9BE8;
    --logo-l: #3D8FDB;
    --accent-hover: #6AAEF0;
    --accent-soft: rgba(76, 155, 232, .12);
    --on-accent: #001A36;
    --badge-ok-bg: rgba(16, 185, 129, .16);   --badge-ok-fg: #6EE7B7;
    --badge-warn-bg: rgba(245, 158, 11, .16); --badge-warn-fg: #FCD34D;
    --badge-danger-bg: rgba(239, 68, 68, .16);--badge-danger-fg: #FCA5A5;
    --badge-info-bg: rgba(76, 155, 232, .16); --badge-info-fg: #93C5FD;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F5F5F7;
  --ink-2: #D2D2D7;
  --muted: #A1A1A6;
  --line: #2C2C2E;
  --line-2: #3A3A3C;
  --surface: #1C1C1E;
  --surface-2: #161618;
  --surface-3: #2C2C2E;
  --bg: #0E0E10;
  --accent: #4C9BE8;
  --logo-l: #3D8FDB;
  --accent-hover: #6AAEF0;
  --accent-soft: rgba(76, 155, 232, .12);
  --on-accent: #001A36;
  --badge-ok-bg: rgba(16, 185, 129, .16);   --badge-ok-fg: #6EE7B7;
  --badge-warn-bg: rgba(245, 158, 11, .16); --badge-warn-fg: #FCD34D;
  --badge-danger-bg: rgba(239, 68, 68, .16);--badge-danger-fg: #FCA5A5;
  --badge-info-bg: rgba(76, 155, 232, .16); --badge-info-fg: #93C5FD;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.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; left: 16px; top: -100px; z-index: 1000; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 600px) { :root { --gutter: 16px; } body { font-size: 16px; } }

.section { padding: 104px 0; }
.section--tint { background: var(--surface-2); }
.section--tight { padding: 72px 0; }
@media (max-width: 768px) { .section { padding: 72px 0; } .section--tight { padding: 56px 0; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }

.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); margin-top: 14px; }
.section-head p { margin-top: 16px; font-size: 19px; color: var(--muted); }
@media (max-width: 600px) { .section-head { margin-bottom: 40px; } .section-head p { font-size: 17px; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--light { background: #FFFFFF; color: var(--navy); }
.btn--light:hover { background: #EAF2FB; }
.btn--outline-light { background: transparent; color: #FFFFFF; border-color: rgba(255,255,255,.35); }
.btn--outline-light:hover { background: rgba(255,255,255,.08); }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .15s; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Barra legal superior (Disp. 954/2025) ---------- */
.legalbar { background: var(--navy-900); color: #C9D6E6; font-size: 13px; }
.legalbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding-top: env(safe-area-inset-top); }
.legalbar__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legalbar__actions { display: flex; gap: 8px; flex-shrink: 0; }
.legal-btn {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px;
  border: 1px solid rgba(255,255,255,.28); border-radius: 6px;
  color: #FFFFFF; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.legal-btn:hover { background: rgba(255,255,255,.1); text-decoration: none; }
@media (max-width: 760px) {
  .legalbar__text { display: none; }
  .legalbar .container { justify-content: center; }
  .legal-btn { font-size: 11px; padding: 0 10px; min-height: 32px; }
}

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header__inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 38px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .08em; color: var(--ink); }
.brand__tag { font-size: 10.5px; letter-spacing: .14em; text-transform: lowercase; color: var(--muted); margin-top: 4px; font-variant: small-caps; }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--ink-2); font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav a:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.header__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.menu-toggle { display: none; }
.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .nav, .header__actions .hide-md { display: none; }
  .menu-toggle { display: inline-grid; }
  .mobile-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    background: var(--bg); padding: 16px var(--gutter) calc(32px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .mobile-nav.is-open { display: block; }
  .mobile-nav a:not(.btn) { display: flex; align-items: center; min-height: 52px; font-size: 19px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
  .mobile-nav .btn { width: 100%; margin-top: 20px; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 96px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 760px; z-index: -1;
  background:
    radial-gradient(50% 50% at 75% 30%, rgba(0, 99, 166, .12), transparent 70%),
    radial-gradient(40% 40% at 15% 10%, rgba(141, 146, 151, .14), transparent 70%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.pill__tag { background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); margin-top: 22px; letter-spacing: -0.035em; }
.hero h1 .accent { color: var(--accent); }
.hero__lead { margin-top: 22px; font-size: 20px; color: var(--muted); max-width: 540px; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 28px; font-size: 14px; color: var(--muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__meta svg { width: 16px; height: 16px; color: var(--steel); }
@media (max-width: 960px) {
  .hero { padding: 48px 0 72px; }
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__lead { font-size: 18px; }
}
@media (max-width: 480px) { .hero__ctas .btn { width: 100%; } }

/* ---------- Mockup de la app (ventana macOS) ---------- */
.window {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  font-size: 13px; line-height: 1.4; color: var(--ink);
}
.window__bar { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.dots i:nth-child(2) { background: #FEBC2E; }
.dots i:nth-child(3) { background: #28C840; }
.segmented { display: flex; margin: 0 auto; padding: 2px; border-radius: 8px; background: var(--surface-3); }
.segmented span { padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.segmented span.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.window__toolbar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--surface); }
.tb-btn--primary { background: var(--navy); border-color: var(--navy); color: #FFF; }
.tb-btn svg { width: 14px; height: 14px; }
.tb-input { flex: 1; height: 30px; border-radius: 7px; background: var(--surface-3); display: flex; align-items: center; padding: 0 10px; color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; white-space: nowrap; }
.window__split { display: grid; grid-template-columns: 38% 1fr; min-height: 330px; }
.explorer { border-right: 1px solid var(--line); background: var(--surface-2); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.explorer__label { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 8px 6px; }
.case { padding: 9px 10px; border-radius: 8px; display: grid; gap: 5px; }
.case.is-on { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.case__title { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case__meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.viewer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.viewer__title { font-weight: 700; font-size: 14px; }
.viewer__sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ai-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); }
.ai-card__label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.ai-card__label svg { width: 13px; height: 13px; }
.ai-card p { color: var(--ink-2); font-size: 12px; }
.fojas { display: grid; gap: 6px; }
.foja { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.foja b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foja time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.window__footer { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; border-top: 1px solid var(--line); }
.window__footer .tb-input { height: 32px; }
.send { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.send svg { width: 14px; height: 14px; }

.skeleton { height: 9px; border-radius: 5px; background: var(--surface-3); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { background: #F2F2F7; } 50% { background: #E5E5EA; } }
:root[data-theme="dark"] .skeleton { animation-name: pulse-dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .skeleton { animation-name: pulse-dark; } }
@keyframes pulse-dark { 0%, 100% { background: #2C2C2E; } 50% { background: #3A3A3C; } }

.toast {
  position: absolute; right: -14px; bottom: 64px; z-index: 2;
  display: flex; align-items: center; gap: 10px; max-width: 280px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--ink);
  animation: toast-in .5s .6s both cubic-bezier(.2,.8,.2,1);
}
.toast svg { width: 18px; height: 18px; color: var(--ok); flex-shrink: 0; }
.toast small { display: block; color: var(--muted); font-size: 11.5px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero__visual { position: relative; }
@media (max-width: 600px) {
  .window__split { grid-template-columns: 1fr; }
  .explorer { display: none; }
  .segmented span:not(.is-on) { display: none; }
  .toast { right: 8px; bottom: 60px; }
  .hide-sm { display: none !important; }
}

/* ---------- Badges procesales ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; width: fit-content; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--badge-ok-bg); color: var(--badge-ok-fg); }
.badge--warn { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge--danger { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.badge--info { background: var(--badge-info-bg); color: var(--badge-info-fg); }

/* ---------- Franja de confianza ---------- */
.trust { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.trust__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.trust__item { display: flex; align-items: center; gap: 14px; padding: 26px 24px; }
.trust__item + .trust__item { border-left: 1px solid var(--line); }
.trust__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.trust__icon svg { width: 20px; height: 20px; }
.trust__item b { display: block; font-size: 15px; }
.trust__item span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 960px) {
  .trust__grid { grid-template-columns: 1fr 1fr; }
  .trust__item:nth-child(3) { border-left: 0; }
  .trust__item:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .trust__grid { grid-template-columns: 1fr; }
  .trust__item { padding: 18px 0; }
  .trust__item + .trust__item { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Tarjetas de problema ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__num { font-family: var(--mono); font-size: 13px; color: var(--steel); }
.card h3 { font-size: 21px; margin-top: 18px; }
.card p { margin-top: 12px; color: var(--muted); font-size: 16px; }
.card__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.card__icon svg { width: 24px; height: 24px; stroke-width: 1.5; }

/* ---------- Funcionalidades con pestañas ---------- */
.tabs { display: flex; gap: 6px; padding: 5px; margin: 0 auto 48px; width: fit-content; max-width: 100%; border-radius: 14px; background: var(--surface-3); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
@media (max-width: 760px) { .tabs { width: auto; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; padding: 5px var(--gutter); background: transparent; } .tab { background: var(--surface-3); } }

.panel { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.panel[hidden] { display: none; }
.panel.is-entering { animation: fade-up .35s both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel h3 { font-size: clamp(26px, 3vw, 34px); margin-top: 12px; }
.panel__lead { margin-top: 14px; color: var(--muted); font-size: 18px; }
.checks { margin-top: 26px; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 36px; color: var(--ink-2); font-size: 16px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300488F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
:root[data-theme="dark"] .checks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234C9BE8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .checks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234C9BE8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); } }
.panel .link-arrow { margin-top: 28px; }
.panel__visual { background: linear-gradient(160deg, var(--accent-soft), transparent 70%); border-radius: var(--radius-xl); padding: 32px; }
@media (max-width: 960px) { .panel { grid-template-columns: 1fr; gap: 36px; } .panel__visual { padding: 16px; } }

/* mini UI: chat */
.chat { padding: 16px; display: grid; gap: 12px; min-height: 300px; align-content: start; }
.bubble { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 12.5px; }
.bubble--me { justify-self: end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.bubble--ai { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink-2); }
.bubble--ai ul { margin-top: 6px; display: grid; gap: 3px; padding-left: 14px; list-style: disc; }
.tool-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 4px 9px; border: 1px dashed var(--line-2); border-radius: 999px; }
.tool-chip svg { width: 12px; height: 12px; }
.cite { font-size: 10.5px; color: var(--badge-warn-fg); background: var(--badge-warn-bg); padding: 6px 9px; border-radius: 7px; margin-top: 8px; }

/* mini UI: documento */
.doc { padding: 20px 24px; min-height: 300px; font-family: Georgia, "Times New Roman", serif; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 10px; align-content: start; }
.doc h5 { margin: 0; font-family: var(--font); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-align: center; color: var(--ink); }
.doc mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--accent); }
.jur { display: grid; gap: 6px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); font-family: var(--font); background: var(--surface-2); }
.jur b { font-size: 12px; color: var(--ink); }
.jur span { font-size: 11px; color: var(--muted); }

/* mini UI: agenda */
.agenda { padding: 14px; display: grid; gap: 8px; min-height: 300px; align-content: start; }
.agenda__day { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.event { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border-left: 3px solid var(--navy); }
.event--warn { border-left-color: var(--warn); }
.event--danger { border-left-color: var(--danger); }
.event--ok { border-left-color: var(--ok); }
.event time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.event b { font-size: 12.5px; font-weight: 600; display: block; }
.event small { font-size: 11px; color: var(--muted); }

/* mini UI: maletín */
.files { padding: 14px; display: grid; gap: 6px; min-height: 300px; align-content: start; }
.file { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.file:nth-child(odd) { background: var(--surface-2); }
.file__ic { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; background: #B91C1C; }
.file__ic--doc { background: #1D4ED8; }
.file__ic--img { background: var(--steel); }
.file b { font-size: 12.5px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { font-size: 11px; color: var(--muted); }
.lock { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--badge-danger-fg); background: var(--badge-danger-bg); padding: 2px 7px; border-radius: 999px; }
.lock svg { width: 11px; height: 11px; }

/* ---------- Más funciones ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1020px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: border-color .2s, box-shadow .2s; }
.fcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.fcard svg { width: 26px; height: 26px; color: var(--accent); stroke-width: 1.5; }
.fcard h3 { font-size: 17px; margin-top: 18px; letter-spacing: -0.01em; }
.fcard p { font-size: 14.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Comparativa ---------- */
.compare { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.compare__row { display: grid; grid-template-columns: 0.8fr 1fr 1fr; }
.compare__row + .compare__row { border-top: 1px solid var(--line); }
.compare__cell { padding: 26px 28px; font-size: 15.5px; color: var(--muted); }
.compare__cell--label { font-weight: 700; color: var(--ink); font-size: 16px; }
.compare__cell--legex { background: var(--accent-soft); color: var(--ink-2); }
.compare__head .compare__cell { padding-top: 20px; padding-bottom: 20px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.compare__head .compare__cell--legex { color: var(--accent); display: flex; align-items: center; gap: 8px; }
.compare__head .compare__cell--legex svg { width: 22px; height: 22px; }
.mark { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; vertical-align: -4px; margin-right: 8px; align-items: center; justify-content: center; }
.mark svg { width: 12px; height: 12px; }
.mark--no { background: var(--badge-danger-bg); color: var(--badge-danger-fg); }
.mark--yes { background: var(--badge-ok-bg); color: var(--badge-ok-fg); }
@media (max-width: 760px) {
  .compare__head { display: none; }
  .compare__row { grid-template-columns: 1fr; }
  .compare__cell { padding: 16px 20px; }
  .compare__cell--label { padding-bottom: 4px; padding-top: 22px; }
  .compare__cell:not(.compare__cell--label)::before { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
  .compare__cell--old::before { content: "Forma tradicional"; color: var(--muted); }
  .compare__cell--legex::before { content: "Con LEGEX"; color: var(--accent); }
}

/* ---------- Banda IA (navy) ---------- */
.band { background: var(--navy-900); color: #DCE6F2; position: relative; overflow: hidden; }
.band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 85% 20%, rgba(0, 99, 166, .45), transparent 60%), radial-gradient(40% 60% at 0% 100%, rgba(141,146,151,.18), transparent 60%); }
.band .container { position: relative; }
.band h2, .band h3 { color: #FFFFFF; }
.band .eyebrow { color: #8FC1EE; }
.band__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.band__lead { margin-top: 18px; font-size: 19px; color: #B7C7DA; }
.band .checks li { color: #DCE6F2; }
.band .checks li::before { background-color: rgba(143, 193, 238, .16); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238FC1EE' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") !important; }
.ai-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-tool { padding: 20px; border-radius: var(--radius); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.ai-tool svg { width: 22px; height: 22px; color: #8FC1EE; stroke-width: 1.5; }
.ai-tool b { display: block; color: #fff; margin-top: 12px; font-size: 15.5px; }
.ai-tool span { display: block; color: #9FB2C8; font-size: 13.5px; margin-top: 4px; }
.notice { display: flex; gap: 12px; margin-top: 28px; padding: 14px 16px; border-radius: 10px; background: rgba(245, 158, 11, .1); border-left: 3px solid var(--warn); color: #FDE7B0; font-size: 14.5px; }
.notice svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--warn); }
@media (max-width: 960px) { .band__grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 480px) { .ai-tools { grid-template-columns: 1fr; } }

/* ---------- Integraciones ---------- */
.integrations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .integrations { grid-template-columns: repeat(2, 1fr); } }
.integration { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.integration__logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; flex-shrink: 0; }
.integration b { display: block; font-size: 15.5px; }
.integration span { font-size: 13px; color: var(--muted); }
@media (max-width: 420px) { .integrations { grid-template-columns: 1fr; } }

/* ---------- Pasos ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; position: relative; }
.steps::before { content: ""; position: absolute; top: 24px; left: 24px; right: 24px; height: 1px; background: var(--line-2); }
.step { position: relative; }
.step__n { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-2); font-weight: 700; color: var(--accent); font-family: var(--mono); position: relative; }
.section--tint .step__n { background: var(--surface-2); }
.step h3 { font-size: 19px; margin-top: 22px; }
.step p { margin-top: 10px; color: var(--muted); font-size: 15.5px; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps::before { top: 24px; bottom: 24px; left: 24px; right: auto; width: 1px; height: auto; }
  .step { display: grid; grid-template-columns: 48px 1fr; column-gap: 20px; padding-bottom: 32px; }
  .step h3 { margin-top: 10px; }
  .step p { grid-column: 2; }
}

/* ---------- Seguridad ---------- */
.security { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
.security__list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sec-item { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.sec-item svg { width: 22px; height: 22px; color: var(--accent); stroke-width: 1.5; }
.sec-item b { display: block; margin-top: 14px; font-size: 16px; }
.sec-item p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.security__aside { position: sticky; top: calc(var(--header-h) + 32px); }
.security__aside p { margin-top: 16px; color: var(--muted); font-size: 18px; }
.security__links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; }
@media (max-width: 960px) { .security { grid-template-columns: 1fr; gap: 40px; } .security__aside { position: static; } }
@media (max-width: 560px) { .security__list { grid-template-columns: 1fr; } }

/* ---------- Precios ---------- */
.pricing { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: stretch; max-width: 1000px; margin: 0 auto; }
.price-card { position: relative; padding: 40px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.price-card--main { border: 2px solid var(--accent); }
.price-card__tag { position: absolute; top: -13px; left: 40px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; letter-spacing: .02em; }
.price-card h3 { font-size: 22px; }
.price-card__desc { margin-top: 8px; color: var(--muted); font-size: 15.5px; }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: 24px; }
.price__amount { font-family: var(--font-display); font-size: 52px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.price__per { color: var(--muted); font-size: 16px; }
.price__tax { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.price-card .checks { margin-top: 24px; }
.price-card .btn { width: 100%; margin-top: 30px; }
.price-legal { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.price-legal div { display: flex; gap: 8px; }
.price-legal svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--steel); }
.price-legal strong { color: var(--ink-2); font-weight: 600; }
.draft { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--badge-warn-fg); background: var(--badge-warn-bg); padding: 3px 9px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; } .price-card { padding: 32px 24px; } .price-card__tag { left: 24px; } }

/* ---------- Descargas ---------- */
.downloads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 960px) { .downloads { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .downloads { grid-template-columns: 1fr; } }
.dl { display: flex; flex-direction: column; gap: 6px; padding: 28px 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .2s; }
a.dl:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.dl svg { width: 34px; height: 34px; margin-bottom: 12px; color: var(--ink); }
.dl b { font-size: 18px; }
.dl span { font-size: 14px; color: var(--muted); }
.dl em { font-style: normal; margin-top: 14px; font-size: 14.5px; font-weight: 600; color: var(--accent); }
.dl--soon { background: transparent; border-style: dashed; }
.dl--soon svg, .dl--soon b { color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 72px; padding: 18px 0; cursor: pointer; list-style: none;
  font-size: 18px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D9297' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 52px 24px 0; color: var(--muted); font-size: 16.5px; }
.faq details > div p + p { margin-top: 10px; }
@media (max-width: 600px) { .faq summary { font-size: 16.5px; } .faq details > div { padding-right: 0; } }

/* ---------- CTA final ---------- */
.cta {
  position: relative; overflow: hidden; border-radius: 28px; padding: 72px 56px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 60%, var(--navy-900) 100%);
  color: #DCE6F2; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center;
}
.cta::after { content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.02); }
.cta h2 { color: #fff; font-size: clamp(30px, 3.6vw, 42px); }
.cta p { margin-top: 14px; color: #B7C7DA; font-size: 18px; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; position: relative; z-index: 1; }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; padding: 48px 28px; border-radius: 22px; } .cta__actions { justify-content: flex-start; } }
@media (max-width: 480px) { .cta__actions .btn { width: 100%; } }

/* ---------- Footer ---------- */
.footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 72px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 14.5px; color: var(--muted); }
.footer__top { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 40px; }
.footer__brand p { margin-top: 16px; max-width: 300px; }
.footer h4 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: 16px; }
.footer__col a { display: block; color: var(--muted); padding: 5px 0; }
.footer__col a:hover { color: var(--ink); }
.footer__legal { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; }
.footer__company { display: grid; gap: 4px; font-size: 13.5px; }
.footer__company strong { color: var(--ink-2); }
.footer__buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.footer__buttons .legal-btn { color: var(--ink); border-color: var(--line-2); background: var(--surface); min-height: 44px; padding: 0 16px; }
.footer__buttons .legal-btn:hover { background: var(--surface-3); }
.consumer { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.consumer:hover { text-decoration: none; border-color: var(--accent); }
.consumer svg { width: 18px; height: 18px; color: var(--accent); }
.footer__bottom { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; }
.lang { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.lang svg { width: 16px; height: 16px; }
.lang select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 32px 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.lang::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.placeholder { background: var(--badge-warn-bg); color: var(--badge-warn-fg); border-radius: 4px; padding: 0 4px; }
@media (max-width: 1020px) { .footer__top { grid-template-columns: repeat(2, 1fr); } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 760px) { .footer__legal { grid-template-columns: 1fr; } .footer__buttons { justify-content: flex-start; } }
@media (max-width: 420px) { .footer__top { grid-template-columns: 1fr; } .footer__buttons .legal-btn { width: 100%; justify-content: center; } }

/* ---------- Revelado al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Ajustes de desborde en grillas ---------- */
.hero__grid > *, .panel > *, .band__grid > *, .security > *, .pricing > *, .cta > * { min-width: 0; }
@media (max-width: 760px) {
  .legalbar__actions { width: 100%; }
  .legal-btn { flex: 1; justify-content: center; text-align: center; white-space: normal; line-height: 1.2; padding: 4px 8px; }
}

/* =========================================================
   Logo real (isologo raster) — en oscuro va sobre una placa clara
   ========================================================= */
.brand__mark { border-radius: 8px; }
:root[data-theme="dark"] .brand__mark { background: #FFFFFF; padding: 3px; width: 40px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand__mark { background: #FFFFFF; padding: 3px; width: 40px; } }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-3); }
.mobile-nav a[aria-current="page"] { color: var(--accent); }

/* =========================================================
   SUBPÁGINAS
   ========================================================= */
.page-hero { position: relative; padding: 56px 0 48px; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: -40% -10% auto 40%; height: 420px; background: radial-gradient(50% 50% at 50% 50%, rgba(0, 99, 166, .10), transparent 70%); pointer-events: none; }
.page-hero .container { position: relative; }
.page-hero h1 { font-size: clamp(32px, 4.4vw, 50px); margin-top: 14px; letter-spacing: -0.03em; max-width: 820px; }
.page-hero__lead { margin-top: 16px; font-size: 19px; color: var(--muted); max-width: 680px; }
.page-hero--center { text-align: center; }
.page-hero--center h1, .page-hero--center .page-hero__lead { margin-left: auto; margin-right: auto; }
.page-hero--center .eyebrow { justify-content: center; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { color: var(--line-2); }
@media (max-width: 600px) { .page-hero { padding: 40px 0 36px; } .page-hero__lead { font-size: 17px; } }

.page-section { padding: 64px 0 96px; }
@media (max-width: 600px) { .page-section { padding: 40px 0 64px; } }

/* ---------- Alertas (paleta semántica del manual) ---------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); border-left: 3px solid var(--navy); background: var(--surface); font-size: 15px; color: var(--ink-2); }
.alert > svg { width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.alert p + p { margin-top: 6px; }
.alert strong { color: var(--ink); }
.alert--ok { border-left-color: var(--ok); }
.alert--ok > svg { color: var(--ok); }
.alert--warn { border-left-color: var(--warn); background: #FFFBEB; }
.alert--warn > svg { color: var(--warn); }
.alert--danger { border-left-color: var(--danger); }
.alert--danger > svg { color: var(--danger); }
:root[data-theme="dark"] .alert--warn { background: rgba(245, 158, 11, .08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alert--warn { background: rgba(245, 158, 11, .08); } }
.alert--strong { padding: 18px 20px; font-size: 15.5px; }

/* ---------- Formularios ---------- */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow); }
.form-card h2 { font-size: 24px; }
.form-card > p { margin-top: 8px; color: var(--muted); font-size: 15.5px; }
@media (max-width: 600px) { .form-card { padding: 24px 20px; border-radius: var(--radius-lg); } }
.form { display: grid; gap: 18px; margin-top: 24px; }
.field { display: grid; gap: 7px; }
.field label, .field .label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.field .optional { font-weight: 400; color: var(--muted); }
.field small { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; padding: 12px 14px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field__error { font-size: 13px; color: var(--badge-danger-fg); display: none; }
.field.has-error .field__error { display: block; }
.input--code { font-family: var(--mono); font-size: 24px; letter-spacing: .5em; text-align: center; padding-left: .5em; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); cursor: pointer; }
.form .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.form-note { font-size: 13.5px; color: var(--muted); text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Diseño de dos columnas (formulario + info) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.split > * { min-width: 0; }
.split--wide-right { grid-template-columns: 0.9fr 1.1fr; }
@media (max-width: 900px) { .split, .split--wide-right { grid-template-columns: 1fr; gap: 40px; } }
.info-block + .info-block { margin-top: 36px; }
.info-block h2 { font-size: 24px; }
.info-block h3 { font-size: 18px; }
.info-block p { margin-top: 10px; color: var(--muted); }
.info-block .checks { margin-top: 18px; }

/* pasos numerados verticales */
.vsteps { display: grid; gap: 0; margin-top: 20px; counter-reset: vs; }
.vsteps li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 16px; padding-bottom: 22px; counter-increment: vs; }
.vsteps li::before { content: counter(vs); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-family: var(--mono); font-size: 14px; }
.vsteps li:not(:last-child)::after { content: ""; position: absolute; left: 17.5px; top: 40px; bottom: 4px; width: 1px; background: var(--line-2); }
.vsteps b { display: block; font-size: 16px; color: var(--ink); margin-top: 6px; }
.vsteps span { display: block; font-size: 15px; color: var(--muted); margin-top: 4px; }

/* ---------- Resumen de compra (checkout) ---------- */
.summary { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.summary__row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; font-size: 15px; }
.summary__row + .summary__row { border-top: 1px solid var(--line); }
.summary__row dt { color: var(--muted); }
.summary__row dd { margin: 0; text-align: right; font-weight: 600; color: var(--ink); }
.summary__row--total { background: var(--surface-2); }
.summary__row--total dd { font-size: 20px; }
.revoke-box { margin-top: 4px; padding: 18px 20px; border-radius: 12px; background: var(--accent-soft); border: 1.5px solid var(--accent); }
.revoke-box b { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 16px; }
.revoke-box b svg { width: 20px; height: 20px; color: var(--accent); }
.revoke-box p { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.mp-btn { background: #009EE3; color: #fff; }
.mp-btn:hover { background: #0089C6; }

/* ---------- Documento legal ---------- */
.doc-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 1000px) { .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.toc { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-right: 8px; font-size: 14px; }
.toc h2 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); line-height: 1.35; }
.toc a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.toc a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toc__annex { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) {
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--surface); }
  .toc details summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; }
  .toc details summary::-webkit-details-marker { display: none; }
  .toc details summary::after { content: "+"; color: var(--muted); }
  .toc details[open] summary::after { content: "–"; }
  .toc details > div { padding: 0 8px 12px; max-height: 50vh; overflow-y: auto; }
  .toc h2 { display: none; }
}
@media (min-width: 1001px) { .toc details > summary { display: none; } }

.doc-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 24px; }
.doc-meta dl { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; font-size: 14px; }
.doc-meta dt { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.doc-meta dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }
.doc-meta__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-meta__actions .btn { min-height: 40px; font-size: 14px; padding: 0 16px; }

.prose { font-size: 16.5px; line-height: 1.7; color: var(--ink-2); }
.prose > * + * { margin-top: 14px; }
.prose h2 { font-size: 24px; margin-top: 52px; padding-top: 8px; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; margin-top: 30px; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose .annex-title { margin-top: 72px; padding-top: 32px; border-top: 2px solid var(--line); }
.prose .clause { display: grid; grid-template-columns: 44px 1fr; gap: 8px; }
.prose .clause__n { font-family: var(--mono); font-size: 13.5px; color: var(--accent); padding-top: 3px; }
.prose strong { color: var(--ink); }
.prose ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }
.prose .alert { font-size: 14.5px; line-height: 1.55; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap th { background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { font-weight: 600; color: var(--ink); }
@media (max-width: 600px) { .prose { font-size: 16px; } .prose .clause { grid-template-columns: 1fr; gap: 0; } .table-wrap table { min-width: 560px; } }

.versions { margin-top: 12px; display: grid; gap: 8px; }
.version { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 14.5px; }
.version b { font-family: var(--mono); }
.version span { color: var(--muted); }

/* ---------- Tarjetas genéricas en grilla ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.tile > svg { width: 26px; height: 26px; color: var(--accent); }
.tile h3 { font-size: 18px; margin-top: 16px; }
.tile p { margin-top: 8px; font-size: 15px; color: var(--muted); }
.tile .link-arrow { margin-top: 16px; }

/* ---------- Descargas detalladas ---------- */
.platform { display: grid; grid-template-columns: 64px 1fr auto; gap: 24px; align-items: center; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); scroll-margin-top: calc(var(--header-h) + 24px); }
.platform + .platform { margin-top: 16px; }
.platform:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.platform__icon { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); }
.platform__icon svg { width: 32px; height: 32px; color: var(--ink); }
.platform h2 { font-size: 22px; }
.platform p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.platform ul { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); }
.platform ul li::before { content: "·"; margin-right: 8px; color: var(--steel); }
.platform ul li:first-child::before { display: none; }
.platform__actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.platform--soon { border-style: dashed; background: transparent; }
@media (max-width: 760px) { .platform { grid-template-columns: 1fr; gap: 16px; padding: 22px; } .platform__actions .btn { width: 100%; } }

/* ---------- Estado vacío / éxito ---------- */
.state { max-width: 560px; margin: 0 auto; text-align: center; }
.state__icon { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--badge-ok-bg); color: var(--ok); }
.state__icon svg { width: 34px; height: 34px; }
.state__icon--info { background: var(--accent-soft); color: var(--accent); }
.state h1, .state h2 { margin-top: 24px; font-size: clamp(30px, 4vw, 42px); }
.state > p { margin-top: 12px; color: var(--muted); font-size: 18px; }
.state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.code-box { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 10px 16px; border-radius: 10px; background: var(--surface-3); font-family: var(--mono); font-size: 18px; font-weight: 700; letter-spacing: .08em; color: var(--ink); }

/* ---------- Panel de cuenta ---------- */
.account { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .account { grid-template-columns: 1fr; } }
.account__nav { display: grid; gap: 2px; position: sticky; top: calc(var(--header-h) + 24px); }
.account__nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.account__nav a svg { width: 18px; height: 18px; color: var(--muted); }
.account__nav a:hover { background: var(--surface-3); text-decoration: none; }
.account__nav a.is-active { background: var(--accent-soft); color: var(--accent); }
.account__nav a.is-active svg { color: var(--accent); }
@media (max-width: 900px) { .account__nav { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; } .account__nav a { white-space: nowrap; background: var(--surface-3); } }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; scroll-margin-top: calc(var(--header-h) + 24px); }
.panel-card + .panel-card { margin-top: 20px; }
.panel-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.panel-card h2 { font-size: 20px; }
.panel-card > p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 20px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv div { background: var(--surface); padding: 16px 18px; }
.kv dt { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 4px 0 0; font-weight: 600; color: var(--ink); }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .panel-card { padding: 22px 18px; } }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn--danger-ghost { background: transparent; border-color: var(--line-2); color: var(--badge-danger-fg); }
.btn--danger-ghost:hover { background: var(--badge-danger-bg); }
.list-rows { margin-top: 16px; border-top: 1px solid var(--line); }
.list-rows > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.list-rows span { color: var(--muted); }
.demo-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-3); font-size: 13px; }
.demo-switch button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; min-height: 32px; }
.demo-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Toasts (abajo a la derecha, estilo macOS) ---------- */
.toasts { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast-msg { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--navy); box-shadow: var(--shadow-lg); font-size: 14.5px; color: var(--ink); animation: toast-in .2s both; }
.toast-msg svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-msg--ok { border-left-color: var(--ok); } .toast-msg--ok svg { color: var(--ok); }
.toast-msg--warn { border-left-color: var(--warn); } .toast-msg--warn svg { color: var(--warn); }
.toast-msg--danger { border-left-color: var(--danger); } .toast-msg--danger svg { color: var(--danger); }
.toast-msg--info svg { color: var(--accent); }
@media (max-width: 600px) { .toasts { right: 16px; left: 16px; width: auto; } }

/* ---------- Diálogo (Términos completos antes de aceptar) ---------- */
.dialog { width: min(920px, calc(100vw - 32px)); height: min(86vh, 900px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(0, 26, 54, .45); backdrop-filter: blur(3px); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.dialog__head h2 { font-size: 17px; }
.dialog iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---------- Modo incrustado (?embed=1) ---------- */
.is-embed .header, .is-embed .footer, .is-embed .mobile-nav, .is-embed .page-hero .crumbs, .is-embed .toc, .is-embed .skip-link { display: none !important; }
.is-embed .doc-layout { grid-template-columns: 1fr; }
.is-embed .page-hero { padding: 28px 0 20px; }
.is-embed .page-section { padding: 24px 0 48px; }

/* ---------- Footer: el pie compartido en subpáginas ---------- */
.footer__col span.static { display: block; padding: 5px 0; }

/* ---------- Impresión / PDF de documentos legales ---------- */
@media print {
  .header, .footer, .mobile-nav, .toc, .doc-meta__actions, .skip-link, .crumbs, .toasts { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-hero { background: none; border: 0; padding: 0 0 12pt; }
  .page-hero::before { display: none; }
  .doc-layout { display: block; }
  .page-section { padding: 0; }
  .prose { font-size: 10.5pt; color: #000; }
  .prose h2 { break-after: avoid; }
  .table-wrap { overflow: visible; }
  a { color: inherit; }
}
