/* ==========================================================
   Mi Quincena — estilos del sitio
   ========================================================== */
:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #fcfcfb;
  --surface-2: #efece4;
  --line: #e2ddd2;
  --text: #1b1a17;
  --text-2: #52514e;
  --muted: #7d7b74;
  --accent: #0f5c46;
  --accent-ink: #ffffff;
  --g1: #2a78d6;   /* Necesidades */
  --g2: #1baf7a;   /* Ahorro y futuro */
  --g3: #eb6834;   /* Personal */
  --warn-bg: #fff4dc;
  --warn-ink: #7a4b00;
  --ok-bg: #e5f5ec;
  --ok-ink: #145c37;
  --ad: repeating-linear-gradient(45deg, #ece8de 0 6px, #f3f0e8 6px 12px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --line: #33322f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8e8d86;
    --accent: #4fc79c; --accent-ink: #0b1f17;
    --g1: #3987e5; --g2: #199e70; --g3: #d95926;
    --warn-bg: #3a2c10; --warn-ink: #f3cf8a; --ok-bg: #12301f; --ok-ink: #9be0b9;
    --ad: repeating-linear-gradient(45deg, #20201e 0 6px, #262624 6px 12px);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* ---------- Encabezado y pie ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.logo { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--text-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.site-footer { margin-top: 40px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.site-footer a { color: var(--text-2); }

/* ---------- Títulos de página ---------- */
.page-head { padding: 26px 0 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 30px; line-height: 1.15; margin: 8px 0 8px; letter-spacing: -0.01em; }
.lead { margin: 0 0 18px; color: var(--text-2); font-size: 17px; }

/* ---------- Tarjetas y calculadora ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.card h2 { font-family: Fraunces, Georgia, serif; font-size: 20px; margin: 0 0 12px; font-weight: 600; }
label.field { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.money { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.money span { font-size: 22px; color: var(--muted); }
.money input { border: 0; background: transparent; color: var(--text); width: 100%; font: 600 26px/1.6 Inter, sans-serif; outline: none; padding: 4px 0; }
.money:focus-within { border-color: var(--accent); }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-top: 10px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--text-2); font: 500 13.5px Inter, sans-serif; padding: 9px 6px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.breakdown { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; color: var(--text-2); }
.row b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 16px; color: var(--text); font-weight: 600; }
.row.total b { font-size: 20px; font-weight: 700; color: var(--accent); }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 7px 13px; font: 500 13px Inter, sans-serif; cursor: pointer; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bar { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.bar div { height: 100%; transition: width .2s; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 13px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 8px; opacity: 0; transition: opacity .1s; z-index: 10; }
.group-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); margin: 18px 0 4px; display: flex; align-items: center; gap: 8px; }
.group-title i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cat { padding: 9px 0; border-bottom: 1px solid var(--line); }
.cat:last-child { border-bottom: 0; }
.cat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cat-name { font-weight: 500; font-size: 15px; }
.cat-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cat-val small { color: var(--muted); font-weight: 500; margin-left: 6px; }
input[type=range] { width: 100%; margin: 6px 0 0; accent-color: var(--accent); height: 28px; }
.status { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-top: 12px; font-size: 14px; }
.status.ok { background: var(--ok-bg); color: var(--ok-ink); }
.status.warn { background: var(--warn-bg); color: var(--warn-ink); }
.status button { border: 0; background: var(--accent); color: var(--accent-ink); font: 600 12.5px Inter, sans-serif; border-radius: 8px; padding: 7px 10px; cursor: pointer; white-space: nowrap; }
.alerts { list-style: none; padding: 0; margin: 12px 0 0; }
.alerts li { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 14px; display: flex; gap: 8px; }
.alerts li.good { background: var(--ok-bg); color: var(--ok-ink); }
.num { width: 70px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 6px 8px; font: 600 15px Inter, sans-serif; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .full { grid-column: 1 / -1; }
.btn { display: flex; justify-content: center; align-items: center; gap: 8px; text-decoration: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 12px; padding: 12px; font: 600 14px Inter, sans-serif; cursor: pointer; text-align: center; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
details summary { cursor: pointer; color: var(--text-2); font-size: 13px; margin-top: 10px; }
details p { font-size: 13px; color: var(--text-2); }
.disclaimer { font-size: 12.5px; color: var(--muted); margin-top: 18px; }

/* ---------- Espacios para anuncios ---------- */
.ad { background: var(--ad); border-radius: 12px; min-height: 90px; margin: 18px 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Artículos ---------- */
.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { font-family: Fraunces, Georgia, serif; font-size: 23px; line-height: 1.25; margin: 34px 0 10px; font-weight: 600; }
.prose h3 { font-size: 18px; margin: 24px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 4px 0 18px; }
.prose th, .prose td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.prose td:last-child, .prose th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.prose th { font-size: 13px; color: var(--text-2); font-weight: 600; }
.meta { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin: 20px 0; font-size: 16px; }
.cta { display: block; background: var(--accent); color: var(--accent-ink); text-decoration: none; text-align: center; border-radius: 12px; padding: 14px; font-weight: 600; margin: 24px 0; }
.related { list-style: none; padding: 0; margin: 0; }
.related li { border-bottom: 1px solid var(--line); }
.related a { display: block; padding: 12px 0; text-decoration: none; color: var(--text); font-weight: 500; }
.related a span { display: block; color: var(--muted); font-weight: 400; font-size: 14px; }
.faq h3 { margin-bottom: 4px; }

/* ---------- Pantallas chicas ---------- */
@media (max-width: 420px) {
  .nav { gap: 12px; font-size: 13px; }
  h1 { font-size: 27px; }
}

/* ---------- Impresión / Guardar como PDF ---------- */
@media print {
  :root { color-scheme: light; --bg:#fff; --surface:#fff; --surface-2:#fff; --text:#000; --text-2:#333; --muted:#555; --line:#ccc; --accent:#0f5c46; }
  body { font-size: 12pt; }
  .site-header, .site-footer, .ad, .no-print, .presets, input[type=range], .seg, details, .actions, .tip, .status button, .faq, .seo-text { display: none !important; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .money { border: 0; padding: 0; }
  .print-only { display: block !important; }
  .bar div, .legend i, .group-title i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-only { display: none; }
