/* ==========================================================================
   Okei: sistema de diseño compartido (web pública, panel, legales y manual)
   --------------------------------------------------------------------------
   Reglas de forma (manual §5): botones y chips en píldora; tarjetas y fotos
   con radio 20 px; campos con radio 12 px. Nada fuera de esa escala.
   Un solo acento: Menta Okei. Sobre oscuro puede ser texto (14,7:1); sobre
   claro solo relleno (botón principal, punto, sellos).
   ========================================================================== */

/* Marca oscura de entrada ("Menta nocturna", elegida el 25/10/2026).
   El modo claro existe para el panel y se activa con data-theme="light"
   (o "auto" cuando el sistema está en claro). */
:root {
  /* Marca */
  --verde: #3DFFB0;          /* Menta Okei: el sí (el nombre de la variable se conserva) */
  --verde-hondo: #22EB9B;    /* hover/pressed de la menta */
  --tinta: #0E0F12;          /* casi negro */
  --papel: #EDEDE8;          /* casi blanco */

  /* Superficies y texto (modo oscuro, el de la marca) */
  --bg: var(--tinta);
  --surface: #17181D;
  --surface-2: #22242A;
  --line: #2D2F36;
  --text: var(--papel);      /* 16,3:1 */
  --text-2: #B4B6BC;         /* 9,5:1 */
  --text-3: #9295A0;         /* 6,4:1: solo texto secundario */
  --inv: var(--papel);       /* bloque invertido: resalta sobre el fondo */
  --inv-t: var(--tinta);
  --inv-2: #4A4C54;          /* texto secundario dentro del bloque invertido, 7,3:1 */
  --on-verde: var(--tinta);  /* 14,7:1 */
  --cambio: #FF7A5C;         /* estado: pidió cambio (semántico, no decorativo) */
  --shadow: 0 1px 0 rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .6);

  /* Tipografía */
  --f-display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
  --f-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Forma */
  --r-card: 20px;
  --r-field: 12px;
  --r-pill: 999px;

  /* Ritmo */
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

/* Modo claro: la menta sigue siendo relleno, nunca texto (1,2:1 sobre papel) */
:root[data-theme="light"] {
  --bg: #F2F2EE; --surface: #FFFFFF; --surface-2: #E8E8E2; --line: #D9D9D2;
  --text: var(--tinta); --text-2: #55575F; --text-3: #6E7079;
  --inv: var(--tinta); --inv-t: var(--papel); --inv-2: #B4B6BC;
  --cambio: #B93A20;
  --shadow: 0 1px 0 rgb(14 15 18 / .04), 0 12px 32px -12px rgb(14 15 18 / .18);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #F2F2EE; --surface: #FFFFFF; --surface-2: #E8E8E2; --line: #D9D9D2;
    --text: var(--tinta); --text-2: #55575F; --text-3: #6E7079;
    --inv: var(--tinta); --inv-t: var(--papel); --inv-2: #B4B6BC;
    --cambio: #B93A20;
    --shadow: 0 1px 0 rgb(14 15 18 / .04), 0 12px 32px -12px rgb(14 15 18 / .18);
    color-scheme: light;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--f-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--verde); color: var(--tinta); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; letter-spacing: -.025em; line-height: 1.04; margin: 0; text-wrap: balance; }
.h-xl { font-size: clamp(44px, 6.2vw, 84px); font-weight: 800; letter-spacing: -.04em; line-height: .98; }
.h-l  { font-size: clamp(34px, 4.4vw, 58px); font-weight: 800; letter-spacing: -.035em; }
.h-m  { font-size: clamp(24px, 2.4vw, 32px); }
.h-s  { font-size: 20px; letter-spacing: -.015em; line-height: 1.2; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--text-2); max-width: 46ch; text-wrap: pretty; }
p { margin: 0; text-wrap: pretty; }
.muted { color: var(--text-2); }
.tiny { font-size: 13px; color: var(--text-3); }
.etiqueta { font: 600 13px/1 var(--f-text); letter-spacing: .02em; color: var(--text-2); }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Logo (lo pinta okei.js en [data-logo]) ---------- */
.okei-logo { height: 1em; width: auto; color: var(--text); overflow: visible; }
.okei-logo__dot { fill: var(--verde); }
[data-logo] { display: inline-flex; line-height: 0; }

/* ---------- Botones ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 22px; border-radius: var(--r-pill);
  font: 600 16px/1 var(--f-text); white-space: nowrap; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--verde { background: var(--verde); color: var(--on-verde); }
.btn--verde:hover { background: var(--verde-hondo); }
.btn--tinta { background: var(--text); color: var(--bg); }
.btn--tinta:hover { opacity: .88; }
.btn--borde { border-color: var(--line); background: transparent; }
.btn--borde:hover { border-color: var(--text); }
.btn--sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 56px; padding: 0 28px; font-size: 17px; }
.btn i { font-size: 1.15em; }

/* El sello: la marca en acción (el "okei" que aparece al aprobar) */
.sello {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px; border-radius: var(--r-pill);
  background: var(--verde); color: var(--tinta);
  font: 700 14px/1 var(--f-display); letter-spacing: -.01em;
}
.sello i { font-size: 16px; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: border-color .2s, background-color .2s, color .2s;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* Campos (etiqueta arriba, ayuda y error abajo) */
.campo { display: grid; gap: 8px; }
.campo label { font-weight: 600; font-size: 15px; }
.campo input, .campo textarea, .campo select {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-field);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  transition: border-color .2s;
}
.campo textarea { min-height: 96px; resize: vertical; }
.campo input::placeholder, .campo textarea::placeholder { color: var(--text-3); }
.campo input:focus, .campo textarea:focus, .campo select:focus { outline: none; border-color: var(--text); }
.campo .ayuda { font-size: 14px; color: var(--text-2); }
.campo .error { font-size: 14px; color: var(--cambio); display: none; }
.campo[data-invalido] input { border-color: var(--cambio); }
.campo[data-invalido] .error { display: block; }

/* ---------- Navegación pública ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav[data-scrolled] { border-bottom-color: var(--line); }
.nav__in { height: 68px; display: flex; align-items: center; gap: 28px; }
.nav__logo { font-size: 27px; text-decoration: none; }
.nav__links { display: flex; gap: 26px; margin-left: 12px; }
.nav__links a { text-decoration: none; font-size: 15px; color: var(--text-2); }
.nav__links a:hover { color: var(--text); }
.nav__cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nav__entrar { font-size: 15px; font-weight: 600; text-decoration: none; padding: 0 8px; }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__entrar { display: none; }
}

/* ---------- Pie ---------- */
.pie { border-top: 1px solid var(--line); padding: 64px 0 40px; margin-top: 0; }
.pie__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.pie__logo { font-size: 34px; margin-bottom: 16px; }
.pie h3 { font: 600 14px/1 var(--f-text); color: var(--text-3); margin-bottom: 16px; letter-spacing: 0; }
.pie ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pie ul a { text-decoration: none; color: var(--text-2); font-size: 15px; }
.pie ul a:hover { color: var(--text); }
.pie__base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-3); }
@media (max-width: 760px) { .pie__grid { grid-template-columns: 1fr 1fr; } .pie__grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Aviso de cookies ---------- */
.cookies {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 440px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow); padding: 20px;
  transform: translateY(16px); opacity: 0; pointer-events: none;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}
.cookies[data-visible] { transform: none; opacity: 1; pointer-events: auto; }
@media (min-width: 861px) { .cookies { left: auto; right: 24px; bottom: 24px; } }
.cookies p { font-size: 15px; color: var(--text-2); margin-bottom: 16px; }
.cookies p strong { color: var(--text); }
.cookies__acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.cookies__acciones .btn { flex: 1; }

/* ---------- Tarjeta de aprobación (el componente que define el producto) ---------- */
.aprobar {
  width: 100%; max-width: 340px; background: var(--surface); color: var(--text);
  border-radius: var(--r-card); box-shadow: var(--shadow); border: 1px solid var(--line);
  overflow: hidden;
}
.aprobar__cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.aprobar__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.aprobar__cuenta { font-weight: 600; font-size: 14px; line-height: 1.2; }
.aprobar__cuando { font-size: 12.5px; color: var(--text-3); }
.aprobar__red { margin-left: auto; font-size: 20px; }
.aprobar__foto { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.aprobar__texto { padding: 12px 14px 0; font-size: 14px; line-height: 1.45; }
.aprobar__acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; }
.aprobar__acciones .btn { --h: 44px; padding: 0 12px; font-size: 15px; }

/* ---------- Revelado al hacer scroll (IntersectionObserver en okei.js) ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-revelar] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  [data-revelar][data-visto] { opacity: 1; transform: none; }
}

/* ---------- Páginas de texto (legales) ---------- */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; padding: 56px 0 96px; }
.doc__indice { position: sticky; top: 96px; align-self: start; font-size: 14px; }
.doc__indice p { font-weight: 600; margin-bottom: 12px; }
.doc__indice ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.doc__indice a { text-decoration: none; color: var(--text-2); }
.doc__indice a:hover { color: var(--text); }
.doc__cuerpo { max-width: 70ch; }
.doc__cuerpo h1 { font-size: clamp(38px, 5vw, 56px); font-weight: 800; letter-spacing: -.035em; margin-bottom: 16px; }
.doc__cuerpo .fecha { color: var(--text-3); font-size: 15px; margin-bottom: 32px; }
.doc__resumen { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px 26px; margin: 0 0 48px; }
.doc__cuerpo .doc__resumen h2 { font-size: 20px; margin: 0 0 12px; letter-spacing: -.015em; }
.doc__resumen ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.doc__cuerpo section { scroll-margin-top: 96px; }
.doc__cuerpo h2 { font-size: 26px; margin: 48px 0 14px; }
.doc__cuerpo h3 { font-size: 19px; margin: 28px 0 8px; letter-spacing: -.01em; }
.doc__cuerpo p, .doc__cuerpo li { color: var(--text-2); }
.doc__cuerpo p + p { margin-top: 12px; }
.doc__cuerpo ul, .doc__cuerpo ol { padding-left: 22px; display: grid; gap: 6px; margin: 12px 0; }
.doc__cuerpo strong { color: var(--text); }
.doc__cuerpo table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.doc__cuerpo th { text-align: left; font-weight: 600; padding: 10px 12px; border-bottom: 1.5px solid var(--text); }
.doc__cuerpo td { padding: 12px; vertical-align: top; color: var(--text-2); border-bottom: 1px solid var(--line); }
.doc__tabla { overflow-x: auto; }
@media (max-width: 860px) { .doc { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; } .doc__indice { position: static; } .doc__indice ol { display: none; } }
