/* FateFinger web: mismos colores que la app (src/theme.ts). Claro/oscuro según el sistema. */
:root {
  --bg: #F6F5F2; --card: #FFFFFF; --fill: #ECEBE7; --text: #0E0E10; --muted: #5E5E66;
  --line: rgba(14, 14, 16, 0.08); --cta: #0E0E10; --cta-text: #FFFFFF;
  --brand: #5B3DF5; --brand-soft: rgba(91, 61, 245, 0.10); --shadow: 0 1px 2px rgba(14,14,16,.04), 0 8px 24px rgba(14,14,16,.06);
  --todo-bg: #FFF1B8; --todo-text: #5C4500;
  --radius: 24px; --max: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0D; --card: #1B1B1F; --fill: #2A2A30; --text: #FFFFFF; --muted: #A6A6B0;
    --line: rgba(255, 255, 255, 0.08); --cta: #FFFFFF; --cta-text: #0E0E10;
    --brand: #A08BFF; --brand-soft: rgba(160, 139, 255, 0.14); --shadow: none;
    --todo-bg: #4A3B00; --todo-text: #FFE27A;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
img, svg { display: block; max-width: 100%; }

/* Idioma: el html lleva data-lang; se oculta el otro idioma. */
html[data-lang="es"] [data-l="en"], html[data-lang="en"] [data-l="es"] { display: none !important; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.logo b { color: var(--brand); font-weight: 800; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; padding: 10px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--fill); }
.lang { display: inline-flex; background: var(--fill); border-radius: 999px; padding: 3px; margin-left: 6px; }
.lang button { appearance: none; border: 0; background: none; color: var(--muted); font: 700 13px/1 inherit; font-family: inherit; padding: 9px 11px; border-radius: 999px; cursor: pointer; min-width: 40px; min-height: 34px; }
.lang button[aria-pressed="true"] { background: var(--cta); color: var(--cta-text); }
@media (max-width: 640px) { .nav a.hide-sm { display: none; } .top .wrap { gap: 8px; } .nav a { padding: 10px 8px; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px; border-radius: 999px; font-weight: 700; font-size: 17px; text-decoration: none; border: 0; cursor: pointer; transition: transform .16s ease, opacity .16s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--cta); color: var(--cta-text); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line), inset 0 0 0 1.5px color-mix(in srgb, var(--text) 18%, transparent); }
.btn svg { width: 20px; height: 20px; }
.btn[aria-disabled="true"] { cursor: default; }
.btn small { display: block; font-size: 12px; font-weight: 600; opacity: .7; line-height: 1.1; }
.btn .two { text-align: left; line-height: 1.15; }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero { padding-top: 36px; } .hero .wrap { grid-template-columns: 1fr; gap: 36px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 7px 14px; border-radius: 999px; }
h1 { font-size: clamp(44px, 7vw, 76px); line-height: 1.0; letter-spacing: -0.04em; font-weight: 800; margin: 18px 0 18px; }
h1 b { color: var(--brand); font-weight: 800; }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 34ch; margin: 0 0 30px; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* Móvil de muestra */
.phone { position: relative; width: min(320px, 82vw); aspect-ratio: 9 / 18.5; margin: 0 auto; border-radius: 48px; background: var(--card); box-shadow: var(--shadow), 0 0 0 10px var(--fill), 0 0 0 11px var(--line); overflow: hidden; }
.phone .screen { position: absolute; inset: 0; padding: 26px 22px; }
.phone .ph-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.phone .ph-top b { color: var(--brand); }
.phone .pill { font-size: 11px; font-weight: 700; background: var(--fill); padding: 6px 10px; border-radius: 999px; color: var(--muted); }
.phone .hint { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.tok { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center; transition: opacity .4s ease, transform .45s cubic-bezier(.2,.9,.3,1.3); animation: pop .5s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: var(--d, 0s); }
.tok svg { width: 44px; height: 44px; }
.tok::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid var(--text); opacity: 0; transform: scale(.85); transition: opacity .12s ease, transform .12s ease; }
.tok.on::after { opacity: 1; transform: scale(1); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.phone.done .tok:not(.on) { opacity: .22; }
.phone.done .tok.on { transform: scale(1.18); }
.phone.done .tok.on::after { border-color: var(--brand); }
.phone .result { position: absolute; left: 0; right: 0; bottom: 26px; text-align: center; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.phone.done .result { opacity: 1; transform: none; }
.phone.done .hint { opacity: 0; }
.phone .hint { transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .tok { animation: none; } .tok, .tok::after, .phone .result { transition: none; } }

/* Secciones */
section { padding: 40px 0; }
h2 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.03em; line-height: 1.08; font-weight: 800; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 18px; margin: 0 0 28px; max-width: 52ch; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 340px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid { gap: 10px; } .grid .card { padding: 18px; } .grid .card h3 { font-size: 18px; } .grid .card p { font-size: 15px; } }
.card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card h3 { font-size: 20px; letter-spacing: -0.02em; margin: 14px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.ico svg { width: 26px; height: 26px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }
.fact { display: flex; gap: 14px; align-items: flex-start; }
.fact .ico { flex: none; }
.fact strong { display: block; font-size: 17px; }
.fact span { color: var(--muted); font-size: 15px; }

/* Páginas de texto (privacidad, términos, soporte) */
.doc { padding: 48px 0 24px; }
.doc h1 { font-size: clamp(38px, 6vw, 56px); margin: 0 0 8px; }
.doc .meta { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.doc h2 { font-size: 24px; margin: 40px 0 10px; letter-spacing: -0.02em; scroll-margin-top: 84px; }
.doc p, .doc li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.summary { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 12px; }
.summary h2 { margin: 0 0 12px; font-size: 18px; }
.summary ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.summary li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.summary li svg { flex: none; width: 22px; height: 22px; color: var(--brand); margin-top: 2px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--text); background: var(--fill); padding: 8px 12px; border-radius: 999px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; background: var(--card); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--fill); }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.todo { background: var(--todo-bg); color: var(--todo-text); padding: 1px 6px; border-radius: 6px; font-weight: 700; }

/* Soporte: preguntas */
details { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin: 10px 0; box-shadow: var(--shadow); }
summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-weight: 700; position: relative; min-height: 56px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
details > div { padding: 0 20px 18px; color: var(--muted); }
details > div p { margin: 0 0 8px; }
.contact { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--cta); color: var(--cta-text); border-radius: var(--radius); padding: 28px; margin: 36px 0 8px; }
.contact h2 { color: inherit; margin: 0 0 4px; font-size: 26px; }
.contact p { margin: 0; color: inherit; opacity: .75; }
.contact .btn-primary { background: var(--cta-text); color: var(--cta); }

/* Pie */
footer { padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; border-top: 1px solid var(--line); padding-top: 28px; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
footer a { color: var(--muted); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--text); }
