/* ===== Reset & Variables ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #1a56db;
  --primary-dark: #1e40af;
  --primary-light:#eff6ff;
  --success:      #059669;
  --success-light:#ecfdf5;
  --text:         #111827;
  --muted:        #6b7280;
  --border:       #e5e7eb;
  --bg:           #f3f6fb;
  --card:         #ffffff;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --radius:       12px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }
sup { font-size: .7em; vertical-align: super; }

.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

/* ===== Site Header ===== */
.site-header {
  background: var(--primary-dark);
  color: #fff;
  padding: .875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.logo .tld { font-weight: 400; opacity: .75; }
.logo:hover { text-decoration: none; }

.header-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.header-nav a {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  white-space: nowrap;
}
.header-nav a:hover { color: #fff; text-decoration: none; }

/* ===== Page Hero ===== */
.page-hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}
.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--primary-dark);
  margin-bottom: .75rem;
}
.hero-desc {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: .35rem;
}
.section-desc {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

/* ===== Calculator Grid ===== */
.calc-card { padding: 2rem; }

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 640px) {
  .calc-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ===== Input Groups ===== */
.input-group { margin-bottom: 1.5rem; }
.input-group:last-child { margin-bottom: 0; }

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .4rem;
}
.input-label-row label {
  font-weight: 600;
  font-size: .95rem;
}
.input-unit {
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
}

/* Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, var(--border) 50%, var(--border) 100%);
  outline: none;
  cursor: pointer;
  display: block;
  margin-bottom: .5rem;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--primary), var(--shadow);
  cursor: pointer;
  transition: box-shadow .15s;
}
.slider::-webkit-slider-thumb:hover,
.slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(26,86,219,.25), var(--shadow);
}
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
  cursor: pointer;
}

/* Number input */
.num-input {
  width: 100%;
  padding: .55rem .75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font);
  transition: border-color .15s;
  background: #fff;
}
.num-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}

/* ===== Results ===== */
.results-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.result-total {
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.result-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.result-value {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.1;
}

.result-breakdown {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.breakdown-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-aportado { background: #93c5fd; }
.dot-ganancia { background: var(--success); }
.bd-label { color: var(--muted); flex: 1; }
.bd-value { font-weight: 700; }
.bd-ganancia { color: var(--success); }

/* Progress bar */
.progress-bar {
  height: 10px;
  background: #bbf7d0;
  border-radius: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #93c5fd;
  border-radius: 5px;
  transition: width .4s ease;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--muted);
  margin-top: .2rem;
}

.multiplicador {
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  padding: .6rem;
  background: #f9fafb;
  border-radius: 8px;
}
.multiplicador strong {
  font-size: 1.1rem;
  color: var(--text);
}

/* ===== Projection Table ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: .5rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
thead th {
  background: var(--primary-dark);
  color: #fff;
  padding: .7rem 1rem;
  text-align: right;
  font-weight: 600;
  font-size: .85rem;
  white-space: nowrap;
}
thead th:first-child { text-align: center; }
tbody tr:nth-child(even) { background: #f9fafb; }
tbody tr:hover { background: var(--primary-light); }
td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
td:first-child { text-align: center; }
.col-total { font-weight: 700; color: var(--primary-dark); }
.col-ganancia { color: var(--success); font-weight: 600; }

/* ===== SEO Section ===== */
.seo-section h2 {
  margin-top: 1.25rem;
  margin-bottom: .5rem;
}
.seo-section h2:first-child { margin-top: 0; }
.seo-section p {
  color: #374151;
  margin-bottom: .75rem;
  line-height: 1.7;
}
.formula-box {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  font-family: 'Courier New', monospace;
  font-size: .9rem;
  margin: .75rem 0;
  overflow-x: auto;
}

/* ===== Nav amounts (prev/next) ===== */
.nav-amounts {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.btn-nav {
  display: inline-block;
  padding: .5rem 1rem;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: .9rem;
}
.btn-nav:hover { background: #dbeafe; text-decoration: none; }

/* ===== Amounts Grid ===== */
.amounts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}
.amount-chip {
  display: inline-block;
  padding: .35rem .75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  background: #f9fafb;
  transition: background .15s, border-color .15s;
}
.amount-chip:hover {
  background: var(--primary-light);
  border-color: #bfdbfe;
  color: var(--primary-dark);
  text-decoration: none;
}
.amount-chip--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  pointer-events: none;
}

/* ===== Footer ===== */
.site-footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer strong { color: #f9fafb; display: block; margin-bottom: .5rem; }
.site-footer p { font-size: .875rem; line-height: 1.6; }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: .25rem; }
.site-footer a { color: #93c5fd; font-size: .875rem; }
.site-footer a:hover { color: #bfdbfe; }
.footer-copy {
  border-top: 1px solid #374151;
  padding-top: 1rem;
  font-size: .8rem;
  color: #6b7280;
  text-align: center;
}

/* ===== Articles Grid (home) ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: .75rem;
}
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.article-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.article-card-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: .5rem;
}
.article-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .6rem;
  line-height: 1.35;
}
.article-card p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}
.article-card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: .85rem;
  color: var(--muted);
  padding: 1rem 0 0;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 .35rem; }

/* ===== Article / Prose ===== */
.article-hero {
  padding: 2rem 0 1.5rem;
}
.article-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--primary-dark);
  margin-bottom: .75rem;
}
.article-hero .hero-desc {
  font-size: 1.1rem;
  color: #374151;
  max-width: 720px;
}
.article-meta {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .75rem;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}
.prose h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 2.25rem 0 .65rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--primary-light);
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.75rem 0 .5rem;
}
.prose p {
  color: #374151;
  margin-bottom: 1rem;
  line-height: 1.8;
}
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.prose li {
  color: #374151;
  margin-bottom: .5rem;
  line-height: 1.75;
}
.prose strong { color: var(--text); font-weight: 700; }
.prose a { font-weight: 500; }
.prose table {
  margin: 1.25rem 0;
  font-size: .9rem;
}

/* Callout boxes */
.callout {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout p { margin-bottom: 0; color: var(--primary-dark); }
.callout strong { color: var(--primary-dark); }
.callout-success {
  border-left-color: var(--success);
  background: var(--success-light);
}
.callout-success p, .callout-success strong { color: #065f46; }
.callout-warning {
  border-left-color: #d97706;
  background: #fffbeb;
}
.callout-warning p, .callout-warning strong { color: #92400e; }
.callout-title {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .4rem;
}

/* CTA box inside article */
.cta-box {
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  text-align: center;
  margin: 2rem 0;
}
.cta-box h3 { color: #fff; font-size: 1.2rem; margin-bottom: .5rem; }
.cta-box p  { color: #bfdbfe; margin-bottom: 1.25rem; }
.cta-btn {
  display: inline-block;
  background: #34d399;
  color: #111827;
  font-weight: 700;
  padding: .75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: background .15s;
}
.cta-btn:hover { background: #6ee7b7; text-decoration: none; }

/* Related articles (inside article pages) */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: .75rem;
}
