:root {
  --bg: #0f1410;
  --bg-alt: #161d17;
  --card: #1b241c;
  --border: #2a352b;
  --text: #eef2ee;
  --text-dim: #a9b6a9;
  --brand: #f2b705;
  --brand-dim: #b98a04;
  --accent: #4caf6e;
  --radius: 14px;
  --maxw: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 20, 16, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

nav.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.92rem;
}

nav.site-nav a {
  text-decoration: none;
  color: var(--text-dim);
}

nav.site-nav a:hover { color: var(--text); }

nav.site-nav a.active {
  color: var(--brand);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.lang-switch-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.lang-switch-header a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 2px 3px;
}

.lang-switch-header a:hover { color: var(--text); }

.lang-switch-header a.active {
  color: var(--brand);
  font-weight: 600;
}

.lang-switch-header span { color: var(--border); }

.hero {
  padding: 72px 0 56px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 10px;
}

.hero .tagline {
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 22px;
  font-size: 1.1rem;
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 1.05rem;
}

section {
  padding: 56px 0;
}

section:nth-of-type(even) {
  background: var(--bg-alt);
}

section > .wrap > h2 {
  font-size: 1.6rem;
  margin: 0 0 6px;
}

section > .wrap > p.section-lead {
  color: var(--text-dim);
  margin: 0 0 32px;
  max-width: 640px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--brand-dim);
  transform: translateY(-2px);
}

.card .emoji { font-size: 1.8rem; }

.card h3 { margin: 0; font-size: 1.15rem; }

.card p { margin: 0; color: var(--text-dim); font-size: 0.94rem; }

.card .status {
  margin-top: auto;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.card .status.pendiente { color: var(--text-dim); }

.cta {
  display: inline-block;
  background: var(--brand);
  color: #16210f;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  margin-top: 8px;
}

.cta:hover { background: #ffc84d; }

.cta.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.book {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.book-cover {
  width: 220px;
  max-width: 40vw;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.book-subtitle {
  color: var(--brand);
  font-weight: 600;
  margin: 0 0 12px;
}

.book-info .section-lead { margin-bottom: 20px; }

@media (max-width: 640px) {
  .book { flex-direction: column; align-items: center; text-align: center; }
}

footer.site {
  background: var(--card);
  padding: 52px 0 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
}

.footer-brand .brand { margin-bottom: 10px; }

.footer-brand p {
  max-width: 320px;
  margin: 0;
  line-height: 1.6;
}

.footer-col h4 {
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

.footer-col a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 0;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* Herramientas (calculadoras) */
.tool-page .wrap { padding-top: 40px; padding-bottom: 64px; }

.tool-back {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .tool-grid { grid-template-columns: 1fr; }
  nav.site-nav { display: none; }
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.86rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}

.field input:focus {
  outline: none;
  border-color: var(--brand-dim);
}

.results {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 90px;
}

.results h3 { margin-top: 0; }

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child { border-bottom: none; }

.result-row .label { color: var(--text-dim); }

.result-row .value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-row .value.positive { color: var(--accent); }
.result-row .value.negative { color: #e05c5c; }

.note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 18px;
}

/* Páginas legales (privacidad, términos, aviso legal, contacto) */
.legal-body {
  max-width: 700px;
}

.legal-body .meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.legal-body h2 {
  font-size: 1.15rem;
  margin: 34px 0 10px;
}

.legal-body h2:first-of-type { margin-top: 0; }

.legal-body p,
.legal-body li {
  color: var(--text-dim);
  margin-bottom: 14px;
}

.legal-body ul {
  padding-left: 20px;
  margin: 0 0 14px;
}

.legal-body strong { color: var(--text); }

.legal-body .placeholder {
  color: #e0a95c;
}
