/* ==========================================================================
   NóminaClara — styles.css (single file, sectioned)
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --ink: #142434;
  --ink-soft: #4d5c6b;
  --ink-faint: #8a97a3;
  --line: #dfe6ec;
  --accent: #0f6e4f;         /* verde corporativo — confianza / dinero */
  --accent-ink: #ffffff;
  --accent-soft: #e4f3ec;
  --negative: #b3401f;
  --warn-bg: #fff6e6;
  --warn-line: #f0d9a6;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Manrope", var(--sans);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 36, 52, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 36, 52, 0.08);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1620;
    --surface: #141f2b;
    --surface-2: #1b2836;
    --ink: #eef3f7;
    --ink-soft: #b3c0cb;
    --ink-faint: #7c8a97;
    --line: #26343f;
    --accent: #35c58a;
    --accent-ink: #0b1710;
    --accent-soft: #103023;
    --negative: #ff9270;
    --warn-bg: #2a2210;
    --warn-line: #4a3c15;
  }
}

/* 2. Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, select { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; }
::selection { background: var(--accent-soft); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--surface); color: var(--ink);
  z-index: 9999; border-radius: 8px; font-weight: 600; box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* 3. Header + tabs ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem;
}
.tool-tabs {
  display: flex; gap: 4px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
  padding-bottom: 0;
}
.tool-tabs::-webkit-scrollbar { display: none; }
.tool-tabs a {
  white-space: nowrap;
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.92rem; font-weight: 600; color: var(--ink-soft);
  border: 1px solid transparent;
  transition: background .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out);
}
.tool-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.tool-tabs a.is-active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }

@media (max-width: 719px) {
  .header-row { flex-wrap: wrap; }
  .tool-tabs { width: 100%; order: 3; padding-top: 4px; }
}

/* 4. Hero -------------------------------------------------------------------- */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); }
.hero p { color: var(--ink-soft); margin-top: 8px; max-width: 60ch; font-size: 1.02rem; }
.legal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.82rem; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  margin-bottom: 10px;
}

/* 5. Tool card / layout de 2 columnas ---------------------------------------- */
.tool-section { padding: 18px 0 8px; }
.tool-grid {
  display: grid; grid-template-columns: 1fr; gap: 18px;
}
@media (min-width: 960px) {
  .tool-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card h2 { font-size: 1.15rem; margin-bottom: 4px; }
.card .card-sub { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 16px; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 540px) {
  .field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 0.76rem; color: var(--ink-faint); }
.field input[type="text"], .field input[type="number"], .field input[type="date"], .field select {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 0.96rem;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.field input:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none;
}
.field-check { display: flex; align-items: center; gap: 8px; flex-direction: row; }
.field-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field-check label { font-weight: 500; color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 12px; font-weight: 700; font-size: 0.98rem;
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; margin-top: 6px; }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1 1 auto; }

/* 6. Panel de resultados ------------------------------------------------------ */
.result-card { position: sticky; top: 84px; }
.result-hero {
  background: linear-gradient(135deg, var(--accent) 0%, #0a5540 100%);
  color: var(--accent-ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 14px;
}
.result-hero .label { font-size: 0.86rem; opacity: 0.85; font-weight: 600; }
.result-hero .value { font-family: var(--display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; margin-top: 4px; }
.result-hero .sub { font-size: 0.82rem; opacity: 0.85; margin-top: 6px; }

.breakdown-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.breakdown-table td { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.breakdown-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.breakdown-table tr.row-strong td { font-weight: 800; border-bottom: 2px solid var(--ink-soft); color: var(--ink); }
.breakdown-table tbody tr:last-child td { border-bottom: none; }

.table-title { font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }

.privacy-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border-radius: 10px; padding: 12px 14px;
  font-size: 0.85rem; color: var(--ink-soft); margin-top: 16px;
}

/* 7. Ad slots (placeholders) -------------------------------------------------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--ink-faint); font-size: 0.8rem; font-weight: 600;
  background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
  margin: 22px 0; letter-spacing: 0.03em; text-transform: uppercase;
}
.ad-slot--top { min-height: 70px; margin: 14px 0 22px; }
.ad-slot--sidebar { min-height: 250px; }
.ad-slot--inline { min-height: 90px; }

.ad-modal { border: none; border-radius: var(--radius-lg); padding: 0; max-width: 380px; width: 92vw; box-shadow: var(--shadow-md); }
.ad-modal::backdrop { background: rgba(10, 18, 26, 0.55); }
.ad-modal-inner { padding: 20px; }
.ad-modal-inner .ad-slot { margin: 12px 0 4px; min-height: 220px; }
.ad-modal-head { display: flex; align-items: center; justify-content: space-between; }
.ad-modal-head strong { font-size: 0.95rem; }
.ad-modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); font-size: 1.1rem; line-height: 1; }
.ad-modal-foot { margin-top: 14px; text-align: right; }

.ad-corner {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  max-width: 280px;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.ad-corner.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ad-corner .ad-slot { min-height: 40px; width: 140px; margin: 0; font-size: 0.66rem; }
.ad-corner button { font-size: 1rem; color: var(--ink-faint); flex-shrink: 0; }

/* 8. Contenido SEO / FAQ ------------------------------------------------------ */
.content-section { padding: 34px 0; border-top: 1px solid var(--line); margin-top: 20px; }
.content-section h2 { font-size: 1.4rem; margin-bottom: 14px; }
.content-section h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.content-section p, .content-section li { color: var(--ink-soft); font-size: 0.98rem; }
.content-section ul, .content-section ol { padding-left: 1.2em; margin: 8px 0; }
.content-section li { margin-bottom: 4px; }

.steps { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.step .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; margin-bottom: 8px;
}

.formula-box {
  background: var(--surface-2); border-radius: 10px; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem;
  overflow-x: auto; color: var(--ink); margin: 10px 0;
}

.faq-list details {
  border-bottom: 1px solid var(--line); padding: 14px 0;
}
.faq-list summary {
  cursor: pointer; font-weight: 700; font-size: 0.98rem;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex-shrink: 0; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { margin-top: 8px; }

.more-tools { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
@media (min-width: 720px) { .more-tools { grid-template-columns: repeat(3, 1fr); } }
.more-tools a {
  display: block; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-weight: 700; transition: border-color .15s var(--ease-out), transform .15s var(--ease-out);
}
.more-tools a:hover { border-color: var(--accent); transform: translateY(-2px); }
.more-tools a span { display: block; font-weight: 500; color: var(--ink-faint); font-size: 0.84rem; margin-top: 4px; }

.disclaimer-box {
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px;
  padding: 12px 14px; font-size: 0.85rem; color: var(--ink-soft); margin: 16px 0;
}

/* 9. Footer -------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 30px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--ink-faint); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--accent); }

/* 10. Utilidades ----------------------------------------------------------------- */
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* 11. Impresión ------------------------------------------------------------------ */
@media print {
  .site-header, .ad-slot, .ad-corner, .btn-row, .content-section, .site-footer { display: none !important; }
  body { background: #fff; }
}

/* 12. Simple page (legal pages) --------------------------------------------------- */
.simple-page { padding: 40px 0 60px; max-width: 760px; margin: 0 auto; }
.simple-page h1 { margin-bottom: 14px; }
.simple-page h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.simple-page p, .simple-page li { color: var(--ink-soft); margin-bottom: 8px; }
.simple-page ul { padding-left: 1.2em; }
