:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --border: #e7e5e4;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --ok: #16a34a;
  --c1: #db2777;
  --c2: #0d9488;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #e7e5e4;
    --muted: #a8a29e;
    --border: #292524;
    --accent: #60a5fa;
    --accent-soft: #172554;
    --c1: #f472b6;
    --c2: #2dd4bf;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.nav-links { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav-links a:not(.btn) { color: var(--muted); text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding-block: 64px 80px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead { margin: 20px 0 28px; font-size: 18px; color: var(--muted); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Maqueta del editor */

.mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.25);
  overflow: hidden;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.mock-dots { display: inline-flex; gap: 6px; }
.mock-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-url { flex: 1; font-family: ui-monospace, Consolas, monospace; }
.mock-url b { color: var(--text); font-weight: 500; }
.mock-people { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.mock-body {
  padding: 22px 24px 28px;
  font: 15px/2.4 ui-monospace, "Cascadia Code", Consolas, monospace;
}
.mock-line { margin: 0; white-space: nowrap; }
.muted { color: var(--muted); }

.cursor {
  position: relative;
  display: inline-block;
  width: 2px;
  height: 1.2em;
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
.cursor em {
  position: absolute;
  bottom: 100%;
  left: 0;
  padding: 1px 6px;
  border-radius: 4px 4px 4px 0;
  color: #fff;
  font: 600 11px/1.4 system-ui, sans-serif;
  font-style: normal;
}
.c1, .c1 em { background: var(--c1); }
.c2, .c2 em { background: var(--c2); }
.c2 { animation-delay: 0.5s; }

.typing {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  animation: type 4s steps(17) infinite;
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes type {
  0% { width: 0; }
  60%, 100% { width: 17ch; }
}

/* ---------- Secciones ---------- */

.section { padding-block: 56px; }

h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.5vw, 34px);
  letter-spacing: -0.01em;
}
.section-lead { margin: 0 0 32px; color: var(--muted); font-size: 17px; }

h3 { margin: 0 0 6px; font-size: 18px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.steps li, .feature, .plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.steps p, .feature p { margin: 0; color: var(--muted); }

.step-n {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.uses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.use {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.use p { margin: 0; color: var(--muted); }

/* ---------- Pie y páginas legales ---------- */

.footer { flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

.legal {
  max-width: 760px;
  padding-block: 24px 64px;
  line-height: 1.7;
}
.legal h1 { font-size: clamp(30px, 4vw, 40px); margin-bottom: 4px; }
.legal h2 { margin: 36px 0 10px; font-size: 22px; }
.legal h3 { margin: 22px 0 6px; font-size: 17px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent); }
.legal-updated { color: var(--muted) !important; font-size: 14px; margin-top: 0; }
.legal code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--border);
  font-size: 0.9em;
}
.legal table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}
.legal th, .legal td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.legal th { background: var(--surface); }

/* ---------- Selector de idioma ---------- */

.lang-switch { display: flex; gap: 14px; }
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a:hover { color: var(--text); }
html[lang="en"] .lang-switch a[hreflang="en"],
html[lang="es"] .lang-switch a[hreflang="es"] { color: var(--text); font-weight: 600; }

/* ---------- Precios ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 20px;
}

.plan { position: relative; display: flex; flex-direction: column; padding: 28px; }
.plan-pro { border: 2px solid var(--accent); }
.plan ul { flex: 1; margin: 0 0 24px; padding: 0; list-style: none; }
.plan li { padding: 6px 0 6px 26px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan li.limit { color: var(--muted); }
.plan li.limit::before { content: "–"; color: var(--muted); }
.plan .btn { text-align: center; }

.price { margin: 4px 0 20px; font-size: 38px; font-weight: 700; letter-spacing: -0.02em; }
.price span { font-size: 16px; font-weight: 500; color: var(--muted); }

.badge {
  position: absolute;
  top: -12px;
  right: 20px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- FAQ ---------- */

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* ---------- Final ---------- */

.final-cta {
  text-align: center;
  padding-block: 56px 72px;
}
.final-cta h2 { margin-bottom: 20px; }

.footer {
  display: flex;
  justify-content: space-between;
  padding-block: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Login y cuenta ---------- */

.auth-page {
  max-width: 640px;
  padding-block: 32px 72px;
  display: grid;
  gap: 20px;
}
.auth-page > div { display: grid; gap: 20px; }
.auth-page [hidden] { display: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 26px;
}
.card-subtitle { margin: 0 0 12px; font-size: 18px; }
.muted-text { margin: 0 0 16px; color: var(--muted); }

.stack { display: grid; gap: 10px; }
.stack label { font-weight: 600; font-size: 14px; }

input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.success, .error {
  margin: 0;
  padding: 14px 16px;
  border-radius: 8px;
}
.success { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.success p { margin: 6px 0 0; }
.error { background: color-mix(in srgb, #dc2626 14%, var(--surface)); }

.upsell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 18px 20px;
  border: 2px solid var(--accent);
  border-radius: 10px;
}
.checks { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); }
.checks li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

.pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.note-list { margin: 0; padding: 0; list-style: none; }
.note-list li + li { border-top: 1px solid var(--border); }
.note-list a {
  display: grid;
  gap: 2px;
  padding: 12px 4px;
  text-decoration: none;
}
.note-list a:hover .note-preview { color: var(--accent); }
.note-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.note-meta { color: var(--muted); font-size: 13px; }

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

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 32px 48px; }
  .steps, .features, .plans, .uses { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}

@media (max-width: 420px) {
  .mock-body { font-size: 13px; padding-inline: 16px; }
  .mock-people { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .typing { animation: none; width: auto; }
  .cursor { animation: none; }
  html { scroll-behavior: auto; }
}
