/* ==========================================================
   FLIPP — páginas legales
   Misma dirección que la landing: Inter ligera, azul Flipp,
   líneas finas. Pensadas para leerse con calma.
   ========================================================== */

:root {
  --paper: #FAFAF8;
  --ink: #0B1530;
  --ink-70: rgba(11, 21, 48, 0.74);
  --ink-55: rgba(11, 21, 48, 0.56);
  --ink-35: rgba(11, 21, 48, 0.36);
  --line: rgba(11, 21, 48, 0.10);
  --blue: #2E5BFF;
  --blue-800: #1430A8;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 4vw, 40px);
  --nav-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(100% - 2 * var(--gutter), 1180px);
  margin-inline: auto;
}

/* ---------- Barra superior ---------- */

.lbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(250, 250, 248, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border-bottom: 1px solid var(--line);
}

.lbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 1.18rem;
  font-weight: 560;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  margin-left: -8px;
  object-fit: contain;
}

.lbar__links {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 1.8rem);
  font-size: 0.9rem;
}

.lbar__links a {
  text-decoration: none;
  color: var(--ink-55);
  transition: color 200ms ease;
}

.lbar__links a:hover,
.lbar__links a[aria-current="page"] {
  color: var(--ink);
}

.lbar__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- Encabezado ---------- */

.lhead {
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(50% 120% at 100% 0%, rgba(46, 91, 255, 0.07), transparent 70%);
}

.lhead__kicker {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.lhead h1 {
  margin: 0.9rem 0 0;
  max-width: 18ch;
  font-size: clamp(2.3rem, 5.4vw, 4.2rem);
  font-weight: 370;
  letter-spacing: -0.048em;
  line-height: 1.02;
  text-wrap: balance;
}

.lhead__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 1.6rem;
  font-size: 0.88rem;
  color: var(--ink-55);
}

.lhead__lede {
  max-width: 62ch;
  margin-top: 1.4rem;
  font-size: 1.05rem;
  color: var(--ink-70);
}

/* ---------- Cuerpo con índice ---------- */

.ldoc {
  display: grid;
  grid-template-columns: minmax(200px, 0.32fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(4rem, 9vw, 7rem);
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 4rem);
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc__title {
  margin: 0 0 0.8rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-35);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.32rem 0 0.32rem 1rem;
  border-left: 1px solid transparent;
  font-size: 0.86rem;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink-55);
  transition: color 200ms ease, border-color 200ms ease;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.is-active {
  color: var(--ink);
  border-left-color: var(--blue);
}

.prose {
  max-width: 72ch;
  font-size: 1rem;
  color: var(--ink-70);
}

.prose section {
  padding-bottom: 2.2rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
}

.prose section:last-child {
  border-bottom: 0;
}

.prose h2 {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  font-weight: 450;
  letter-spacing: -0.028em;
  line-height: 1.25;
  color: var(--ink);
}

.prose h2 span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

.prose h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 550;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.45rem;
  padding-left: 0.2rem;
}

.prose li::marker {
  color: var(--blue);
}

.prose strong {
  font-weight: 560;
  color: var(--ink);
}

.prose a {
  color: var(--blue);
  text-underline-offset: 3px;
}

/* Tarjeta de datos de contacto / resumen */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 1.2rem 0 1.4rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.facts div {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.facts div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.facts dt {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-35);
}

.facts dd {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  color: var(--ink);
}

/* Nota destacada */
.note {
  margin: 1.2rem 0;
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: rgba(46, 91, 255, 0.05);
  font-size: 0.95rem;
  color: var(--ink-70);
}

/* Tabla de plazos */
.terms {
  width: 100%;
  margin: 1rem 0 1.4rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.terms th,
.terms td {
  padding: 0.75rem 0.8rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.terms th {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-35);
}

.terms td:first-child {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Pie ---------- */

.lfoot {
  padding: 2rem 0 2.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-55);
}

.lfoot__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 2rem;
}

.lfoot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.lfoot a {
  text-decoration: none;
  color: var(--ink-55);
}

.lfoot a:hover {
  color: var(--ink);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .ldoc {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    max-height: none;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--line);
  }

  .toc ol {
    columns: 2;
    column-gap: 1.5rem;
    border-left: 0;
  }

  .toc a {
    padding-left: 0;
    border-left: 0;
    break-inside: avoid;
  }
}

@media (max-width: 560px) {
  .lbar__links .lbar__hide {
    display: none;
  }

  .toc ol {
    columns: 1;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts div:nth-child(odd) {
    border-right: 0;
  }

  .facts div:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .terms th:nth-child(3),
  .terms td:nth-child(3) {
    display: none;
  }
}

@media print {

  .lbar,
  .toc,
  .lfoot {
    display: none;
  }

  .ldoc {
    display: block;
  }

  body {
    background: #fff;
  }
}

/* ==========================================================
   Páginas de contenido (guías y funcionalidades)
   ========================================================== */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--ink-55);
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--ink-35);
}

.crumbs a {
  text-decoration: none;
  color: var(--ink-55);
}

.crumbs a:hover {
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 50px;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 520;
  text-decoration: none;
  box-shadow: 0 14px 30px -14px rgba(46, 91, 255, 0.7);
  transition: background 220ms ease, transform 220ms var(--ease);
}

.btn:hover {
  background: #2149E8;
  transform: translateY(-1px);
}

.lhead .btn {
  margin-top: 1.8rem;
}

.lbar .btn {
  height: 40px;
  padding: 0 1.1rem;
  font-size: 0.86rem;
  box-shadow: none;
  color: #fff;
}

.steps {
  counter-reset: step;
  margin: 1.2rem 0 1.4rem;
  padding: 0;
  list-style: none;
}

.prose .steps li {
  position: relative;
  margin: 0;
  padding: 1rem 0 1rem 3rem;
  border-top: 1px solid var(--line);
}

.prose .steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.05rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
}

.steps strong {
  display: block;
  margin-bottom: 0.2rem;
}

.cta {
  margin: 2.4rem 0 0;
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  border-radius: 22px;
  background:
    radial-gradient(70% 90% at 100% 0%, rgba(46, 91, 255, 0.5), transparent 70%),
    linear-gradient(160deg, #0B1A55, #050A22 75%);
  color: #fff;
}

.prose .cta h2 {
  color: #fff;
  margin-bottom: 0.6rem;
}

.prose .cta p {
  color: rgba(255, 255, 255, 0.72);
}

.cta .btn {
  margin-top: 0.6rem;
  background: #fff;
  color: var(--blue-800);
  box-shadow: none;
}

.cta .btn:hover {
  background: #EEF3FF;
}

.related {
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.prose .related li {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.related a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  text-decoration: none;
  color: var(--ink);
}

.related a:hover {
  color: var(--blue);
}

/* Texto solo para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
