/* ============================================================
   CompuestoCalc — design v3 (Herramienta primero, editorial finance)
   Fuentes: Fraunces (titulares) + Inter (texto) · self-hosted
   Paleta: verde petróleo profundo + dorado sobre blanco cálido
   ============================================================ */

@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --bg: #f6f5f1; --card: #ffffff;
  --ink: #15231e; --ink2: #40504a; --muted: #71807a;
  --line: #e6e2d6; --line-strong: #d9cfb8; --line-soft: #f0eee8;
  --accent: #0f5d5a; --accent-strong: #0a4543; --accent-soft: #e4f0ee;
  --gold: #c9972c; --gold-soft: #faf3df;
  --good: #3f7d4f;
  --cta: linear-gradient(135deg, #14736f, #0f5d5a);
  --cta-hover: linear-gradient(135deg, #0f5d5a, #0a4543);
  --cta-shadow: 0 8px 22px rgba(15, 93, 90, 0.32);
  --panel-dark: #12201b;
  --panel-ink: #f6f3ea; --panel-muted: #a8b8b1; --panel-gold: #d9a648;
  --hero-glow: rgba(217, 151, 44, 0.22);
  --hero-glow-2: rgba(20, 115, 111, 0.5);
  --banner-bg: linear-gradient(150deg, #faf3df, #fdf6e6);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --r: 16px; --r-sm: 11px;
  --sh-sm: 0 1px 3px rgba(25, 40, 32, 0.05), 0 1px 8px rgba(25, 40, 32, 0.04);
  --sh-md: 0 8px 26px rgba(25, 40, 32, 0.11), 0 2px 6px rgba(25, 40, 32, 0.05);
  --sh-lg: 0 20px 56px rgba(25, 40, 32, 0.17), 0 4px 12px rgba(25, 40, 32, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body); color: var(--ink); background: var(--bg);
  line-height: 1.66; font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--gold-soft); color: var(--ink); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 245, 241, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 1.4rem;
}
.site-header__inner { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: baseline; gap: 0.5rem; line-height: 1.15; }
.brand a { font-family: var(--display); font-weight: 900; font-size: 1.45rem; color: var(--ink); letter-spacing: -0.2px; }
.brand .gold { color: var(--accent); }
.brand small { font-family: var(--body); font-weight: 600; font-size: 0.66rem; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }
.nav { display: flex; gap: 0.1rem; flex-wrap: wrap; }
.nav a { color: var(--ink2); font-size: 0.87rem; font-weight: 600; padding: 0.42rem 0.75rem; border-radius: 8px; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: #eeece6; color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 480px at 75% -15%, var(--hero-glow), transparent 60%),
    radial-gradient(900px 420px at 5% 115%, var(--hero-glow-2), transparent 60%),
    linear-gradient(135deg, #0a4543 0%, #0f5d5a 55%, #14656a 100%);
  color: var(--panel-ink);
  padding: 3.4rem 1.4rem 3.8rem;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 46px 46px; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; }
.hero .chip { display: inline-block; background: rgba(255,255,255,0.14); color: #fff; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; padding: 0.32rem 0.8rem; border-radius: 20px; margin-bottom: 1.1rem; }
.hero h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.1; letter-spacing: -0.5px; max-width: 17ch; }
.hero h1 .gold { color: var(--panel-gold); }
.hero p.lead-txt { font-size: 1.1rem; max-width: 52ch; margin: 0.9rem 0 1.4rem; color: rgba(245, 243, 234, 0.85); }
.hero-meta { display: flex; gap: 1.3rem; margin-top: 1.5rem; flex-wrap: wrap; font-size: 0.85rem; color: rgba(245, 243, 234, 0.7); }

/* Hero con calculadora incrustada */
.hero--tool .hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 2.2rem; align-items: center; }
.hero--tool .hero__copy .btn-ghost { background: rgba(255,255,255,0.12); box-shadow: none; color: #fff; border: 1px solid rgba(255,255,255,0.22); }
@media (max-width: 900px) { .hero--tool .hero-inner { grid-template-columns: 1fr; gap: 1.6rem; } }

/* Calculadora dentro del hero (tarjeta blanca) */
.hero-calc { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-lg); padding: 1.7rem; border-top: 5px solid var(--gold); }
.hero-calc h2 { font-family: var(--display); font-weight: 700; font-size: 1.22rem; margin-bottom: 1.1rem; letter-spacing: -0.2px; color: var(--ink); }

/* ===== Layout ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 2.4rem 1.4rem 4rem; }
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ===== Cards (herramientas / guías) ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.section-head h2 { font-family: var(--display); font-weight: 900; font-size: 1.7rem; letter-spacing: -0.4px; }
.section-head a { font-size: 0.9rem; font-weight: 600; }
.tcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.4rem; box-shadow: var(--sh-sm); transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s; }
.tcard:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--accent); text-decoration: none; }
.tcard .ico { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 0.8rem; }
.tcard h3 { font-family: var(--display); font-weight: 700; font-size: 1.02rem; margin-bottom: 0.3rem; letter-spacing: -0.2px; color: var(--ink); }
.tcard p { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.tcard:hover h3 { color: var(--accent); }

/* ===== Formulario / calculadora ===== */
.calc .field { margin-bottom: 1.05rem; }
.calc label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink2); letter-spacing: 0.2px; }
.calc input, .calc select {
  width: 100%; padding: 0.78rem 0.95rem; font-size: 1rem;
  font-family: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: inset 0 1px 2px rgba(25, 40, 32, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.calc input:focus, .calc select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(15, 93, 90, 0.13); }
.calc .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.calc .hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }

.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--cta); color: #fff;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 0.85rem 1.9rem; border-radius: var(--r-sm);
  box-shadow: var(--cta-shadow);
  transition: transform 0.08s, filter 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--cta-hover); filter: brightness(1.06); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--gold { background: linear-gradient(135deg, #d9a648, #c9972c); color: #33280a; box-shadow: 0 8px 20px rgba(201, 151, 44, 0.35); }
.btn--gold:hover { background: linear-gradient(135deg, #c9972c, #b88720); }
.btn--block { display: block; width: 100%; text-align: center; padding: 0.9rem; font-size: 1.05rem; font-weight: 700; }

/* ===== Resultado ===== */
.result { display: none; margin-top: 1.4rem; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; box-shadow: var(--sh-sm); color: var(--ink); }
.result.show { display: block; }
.result__head { background: linear-gradient(135deg, #0f5d5a, #14656a); color: #fff; padding: 1.35rem 1.6rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; }
.result__head .chip { display: inline-block; background: rgba(255,255,255,0.15); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 0.25rem 0.7rem; border-radius: 20px; margin-bottom: 0.4rem; }
.result__head .big { font-family: var(--display); font-weight: 900; font-size: 2.3rem; letter-spacing: -0.5px; line-height: 1; color: #f2dfae; }
.result__head .side { text-align: right; font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); }
.result__row { display: flex; justify-content: space-between; padding: 0.8rem 1.6rem; border-top: 1px solid var(--line-soft); font-size: 0.95rem; }
.result__row span:first-child { color: var(--ink2); }
.result__row span:last-child { font-weight: 700; }
.result__row .gain { color: var(--good); font-weight: 700; }
.result__table-wrap { padding: 0 0 1.4rem; overflow-x: auto; }
.result__link { display: block; padding: 0.9rem 1.6rem; border-top: 1px solid var(--line-soft); color: var(--accent); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.result__link:hover { color: var(--gold); }
.result table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.result thead th { background: var(--bg); color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.result th, .result td { padding: 0.55rem 1.6rem; text-align: right; border-bottom: 1px solid var(--line-soft); }
.result th:first-child, .result td:first-child { text-align: left; }
.result tbody tr:nth-child(even) { background: #fcfbf8; }

/* ===== Affiliate CTA ===== */
.aff-cta { margin-top: 1.5rem; padding: 1.3rem 1.4rem; border-radius: var(--r); background: var(--banner-bg); border: 1px solid #e8d9a8; box-shadow: var(--sh-sm); }
.aff-cta h3 { font-family: var(--display); font-size: 1.08rem; color: #4a3c0e; margin-bottom: 0.3rem; letter-spacing: -0.2px; }
.aff-cta p { font-size: 0.88rem; color: #7a6520; margin-bottom: 0.9rem; }
.aff-cta .btn { background: linear-gradient(135deg, #d9a648, #c9972c); color: #33280a; box-shadow: 0 8px 20px rgba(201, 151, 44, 0.32); }
.aff-cta .btn:hover { background: linear-gradient(135deg, #c9972c, #b88720); }
.aff-cta .disclosure { font-size: 0.72rem; color: #8a7a3a; margin-top: 0.8rem; font-style: italic; }

/* ===== Lead magnet ===== */
.lead { margin-top: 1.5rem; padding: 1.5rem; border-radius: var(--r); background: var(--banner-bg); border: 1px solid #eadbb0; text-align: center; box-shadow: var(--sh-sm); }
.lead h3 { font-family: var(--display); color: #4a3c0e; font-size: 1.2rem; margin-bottom: 0.3rem; letter-spacing: -0.2px; }
.lead p { font-size: 0.88rem; color: #7a6520; margin-bottom: 0.9rem; }
.lead form { display: flex; gap: 0.5rem; max-width: 430px; margin: 0 auto; }
.lead input[type=email] { flex: 1; padding: 0.75rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 0.95rem; font-family: inherit; }
.lead input[type=email]:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 151, 44, 0.18); }
.lead .note { font-size: 0.72rem; color: #8a7a3a; margin-top: 0.6rem; }
.lead .ok { display: none; color: var(--good); font-weight: 700; margin-top: 0.6rem; }

/* ===== Contenido ===== */
.crumb { font-size: 0.83rem; color: var(--muted); margin-bottom: 1rem; }
.crumb a { color: var(--muted); }
.head h1, main.container > h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 4.5vw, 2.9rem); line-height: 1.1; letter-spacing: -0.5px; }
.head p.sub, main.container > p { color: var(--ink2); font-size: 1.08rem; margin-top: 0.5rem; max-width: 62ch; }
.meta { display: flex; gap: 1.2rem; margin-top: 0.9rem; font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; }

.prose { max-width: 760px; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: 1.45rem; margin: 1.9rem 0 0.7rem; letter-spacing: -0.3px; }
.prose h3 { font-family: var(--display); font-size: 1.15rem; margin: 1.4rem 0 0.55rem; }
.prose p, .prose li { color: var(--ink2); }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0.6rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.55rem 0.8rem; text-align: left; }
.prose th { background: var(--bg); font-weight: 600; }
blockquote { border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 0.85rem 1.1rem; margin: 1.1rem 0; border-radius: 0 10px 10px 0; font-size: 0.95rem; color: #5c4a10; }

/* ===== Tool layout (calculadora + lado) ===== */
.tool-wrap { display: grid; grid-template-columns: 1.1fr 0.95fr; gap: 1.6rem; margin-top: 2rem; align-items: start; }
@media (max-width: 880px) { .tool-wrap { grid-template-columns: 1fr; } }
.calc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-md); padding: 1.8rem; border-top: 5px solid var(--accent); }
.calc h2 { font-family: var(--display); font-weight: 700; font-size: 1.25rem; margin-bottom: 1.2rem; letter-spacing: -0.2px; }
.side-col .aff-cta:first-child { margin-top: 0; }

/* ===== FAQ ===== */
.faq { margin-top: 2.2rem; }
.faq h2 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; margin-bottom: 1rem; letter-spacing: -0.3px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: 0.95rem 1.1rem; margin-bottom: 0.6rem; box-shadow: var(--sh-sm); transition: border-color 0.15s; }
.faq details:hover { border-color: var(--line-strong); }
.faq details[open] { border-color: var(--accent); }
.faq summary { font-weight: 600; cursor: pointer; font-size: 0.96rem; color: var(--ink); }
.faq details[open] summary { color: var(--accent); }
.faq details p { margin-top: 0.7rem; font-size: 0.92rem; color: var(--ink2); }

/* ===== Badges ===== */
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 0.74rem; font-weight: 700; padding: 0.22rem 0.7rem; border-radius: 20px; margin-bottom: 0.6rem; letter-spacing: 0.3px; text-transform: uppercase; }
.badge--gold { background: var(--gold-soft); color: #6b5510; }

/* ===== Link cards (vistas en listas) ===== */
.link-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem 1.3rem; box-shadow: var(--sh-sm); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.link-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--accent); text-decoration: none; }
.link-card h3 { font-family: var(--display); font-weight: 700; font-size: 1.02rem; color: var(--ink); margin-bottom: 0.3rem; letter-spacing: -0.2px; }
.link-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.link-card:hover h3 { color: var(--accent); }

/* ===== Footer ===== */
.site-footer { background: var(--panel-dark); color: var(--panel-muted); padding: 2.4rem 1.4rem; font-size: 0.83rem; margin-top: 3rem; }
.site-footer__inner { max-width: 1140px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.site-footer strong { color: var(--panel-ink); font-family: var(--display); }
.site-footer a { color: rgba(246, 243, 234, 0.8); }
.site-footer a:hover { color: var(--panel-gold); }
.site-footer .disclosure { opacity: 0.7; font-style: italic; max-width: 560px; margin-top: 0.5rem; line-height: 1.6; }

/* ===== Utilidades ===== */
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mb-1 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.updated { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 640px) {
  .site-header__inner { flex-direction: column; gap: 0.5rem; }
  .lead form { flex-direction: column; }
  .calc .row2 { grid-template-columns: 1fr; }
  .hero { padding: 2.4rem 1.2rem 2.8rem; }
  .result__head .big { font-size: 1.8rem; }
}
