/* ===========================================================
   suite.css — estilos compartidos de las landings/herramientas
   de la suite para autónomos y pymes. Autocontenido y ligero
   (no depende de styles.css) para Core Web Vitals altos en SEO.
   La marca se controla con las variables de :root.
   =========================================================== */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #16203a;
  --muted: #707d93;
  --line: #e4e9f1;
  --line-soft: #eef1f7;
  --brand: #2563eb;
  --brand-dark: #1e40af;
  --brand-soft: #e7effd;
  --ok: #12936a;
  --ok-soft: #e6f5ef;
  --accent: #e0241b;
  --yellow: #f4b400;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16,30,60,.06);
  --shadow: 0 1px 3px rgba(16,30,60,.06), 0 10px 30px rgba(16,30,60,.06);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }

/* ---------- Header / footer ---------- */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: .9rem 1.4rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.brand-icon { height: 58px; width: auto; display: block; }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand-dark); }
.header-cta { margin-left: auto; }
.btn { cursor: pointer; font: inherit; border-radius: 10px; border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 700; transition: background .15s, box-shadow .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; padding: .7rem 1.3rem; font-size: .95rem; box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #cfe0f6; padding: .7rem 1.3rem; }
.btn-ghost:hover { background: #e1ecfb; }

.site-footer { background: var(--panel); border-top: 1px solid var(--line); margin-top: 3rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.site-footer p, .site-footer a { color: var(--muted); font-size: .82rem; margin: 0; }
.footer-links { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }

/* ---------- Layout de página ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }
.breadcrumb { font-size: .78rem; color: var(--muted); padding: 1rem 0 .2rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 1.6rem 0 .4rem; }
.hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; line-height: 1.18; margin: .2rem 0 .6rem; letter-spacing: -.01em; }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 640px; margin: 0 auto; }
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); background: var(--brand-soft); padding: .3rem .7rem; border-radius: 99px; }

/* ---------- Tarjeta de calculadora ---------- */
.calc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; margin: 1.4rem 0; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .calc-grid { grid-template-columns: 1fr; } }

/* Segmentado (modo de cálculo) */
.seg { display: inline-flex; background: var(--line-soft); border-radius: 11px; padding: 4px; gap: 3px; margin-bottom: 1.2rem; flex-wrap: wrap; }
.seg label { padding: .5rem 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); transition: background .15s, color .15s; }
.seg input { display: none; }
.seg label:has(input:checked) { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field > span { font-size: .76rem; font-weight: 600; color: var(--muted); }
.field .help { font-weight: 500; color: #97a1b3; }
.input-eur { position: relative; }
.input-eur input { padding-right: 2rem; }
.input-eur::after { content: "€"; position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
input[type="number"], input[type="text"], input[type="email"], select {
  font: inherit; font-size: 1rem; height: 46px; padding: 0 .8rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .88rem; color: var(--ink); margin-bottom: 1rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-width: 18px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }
.check small { display: block; color: var(--muted); font-weight: 500; }
.calc-note { font-size: .78rem; color: var(--muted); margin: .4rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line-soft); }

/* Resultado */
.result { background: linear-gradient(180deg, var(--brand-soft), #f4f8fe); border: 1px solid #cfe0f6; border-radius: 12px; padding: 1.4rem; text-align: center; }
.result-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-dark); }
.result-amount { font-size: clamp(2.2rem, 6vw, 3rem); font-weight: 800; color: var(--brand); line-height: 1.05; margin: .35rem 0; letter-spacing: -.02em; }
.result-amount .per { font-size: 1rem; font-weight: 600; color: var(--muted); }
.result-sub { font-size: .9rem; color: var(--muted); margin: 0; min-height: 1.2em; }
.result-meta { list-style: none; padding: 1.1rem 0 0; margin: 1.1rem 0 0; border-top: 1px solid #cfe0f6; display: grid; gap: .5rem; text-align: left; }
.result-meta li { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; color: var(--muted); }
.result-meta strong { color: var(--ink); }
.result.is-flat { background: linear-gradient(180deg, var(--ok-soft), #f1faf6); border-color: #bfe6d5; }
.result.is-flat .result-amount, .result.is-flat .result-label { color: var(--ok); }
.tag-flat { display: inline-block; margin-top: .3rem; font-size: .76rem; font-weight: 700; color: var(--ok); background: #fff; border: 1px solid #bfe6d5; padding: .2rem .6rem; border-radius: 99px; }

/* ---------- Tabla de tramos ---------- */
.section-h { font-size: 1.3rem; font-weight: 800; margin: 2rem 0 .3rem; }
.section-lead { color: var(--muted); margin: 0 0 1rem; }
.table-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { padding: .7rem .9rem; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tabla th:first-child, .tabla td:first-child { text-align: left; }
.tabla thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfd; position: sticky; top: 0; }
.tabla tbody tr.is-active { background: var(--brand-soft); }
.tabla tbody tr.is-active td { font-weight: 700; color: var(--brand-dark); }
.table-scroll { overflow-x: auto; }
.tabla td .t-num { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; background: var(--line-soft); border-radius: 6px; font-size: .76rem; font-weight: 700; color: var(--muted); margin-right: .5rem; }

/* ---------- Captura de email ---------- */
.lead-box { background: var(--brand-soft); border: 1px solid #cfe0f6; border-radius: var(--radius); padding: 1.4rem 1.5rem; margin: 2rem 0; }
.lead-box h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.lead-box p { margin: 0 0 .9rem; color: var(--muted); font-size: .9rem; }
.lead-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.lead-form input[type="email"] { flex: 1; min-width: 220px; }
.lead-consent { display: flex; align-items: center; gap: .45rem; font-size: .74rem; color: var(--muted); margin-top: .6rem; }
.lead-consent input { width: 16px; height: 16px; accent-color: var(--brand); }
.lead-ok { color: var(--ok); font-weight: 700; margin: .7rem 0 0; font-size: .9rem; }

/* ---------- FAQ ---------- */
.faq { margin: 1rem 0; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 0 1.1rem; margin-bottom: .6rem; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 700; padding: 1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq .faq-a { padding: .9rem 0 1.1rem; color: #44506680; color: #445066; font-size: .92rem; }
.faq .faq-a p { margin: 0 0 .6rem; }

/* ---------- Grid de herramientas ---------- */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.2rem 0; }
@media (max-width: 720px) { .tools { grid-template-columns: 1fr; } }
/* Variante de 4 herramientas (hub): 4 → 2 → 1, sin tarjetas huérfanas */
.tools.is-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .tools.is-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tools.is-4 { grid-template-columns: 1fr; } }
/* Variante de 2 (grupo "documentos"): tarjetas del mismo tamaño que las de 3, alineadas a la izquierda */
.tools.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 718px; }
@media (max-width: 560px) { .tools.is-2 { grid-template-columns: 1fr; max-width: none; } }
.tool-card { display: flex; flex-direction: column; gap: .35rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfe0f6; }
.tool-ico { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; margin-bottom: .4rem; }
.tool-ico img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tool-card strong { font-size: 1rem; }
.tool-card span { font-size: .85rem; color: var(--muted); }

/* ---------- Contenido SEO ---------- */
.prose { max-width: 760px; margin: 1.5rem auto; }
.prose h2 { font-size: 1.3rem; margin: 1.8rem 0 .5rem; }
.prose p { color: #3a4660; }
.disclaimer { font-size: .8rem; color: var(--muted); background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1.1rem; margin: 1.5rem 0; }
