/* ═══════════════════════════════════════════════════════════════════════════
   SISTEMA DE DISEÑO — quieromivep.com.ar
   Única fuente de verdad: tokens, tipografía y componentes comunes.
   Todas las páginas cargan este archivo; cada herramienta agrega después solo
   sus reglas propias, siempre usando las variables de acá.

   Criterio: es una herramienta de trabajo para contadores, no una landing de
   producto. La referencia es el papel de trabajo — fondo cálido, tinta oscura,
   líneas finas, números tabulares, densidad alta — y no la tarjeta muy
   redondeada con sombra difusa.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Tinta */
  --ink:        #17212e;
  --ink-soft:   #4d5a6b;
  --ink-faint:  #8a94a2;

  /* Superficies: cálidas, de papel, no gris de interfaz */
  --surface:    #ffffff;
  --bg:         #f4f2ee;
  --bg-sunken:  #ebe8e2;
  --line:       #ddd9d1;
  --line-soft:  #ebe8e2;

  /* Acento: verde contable */
  --accent:       #1d5c46;
  --accent-hover: #164534;
  --accent-soft:  #e7efeb;
  --accent-line:  #c2d6cc;

  /* Semánticos */
  --success:      #1d5c46;
  --success-soft: #e7efeb;
  --success-line: #c2d6cc;
  --danger:       #9c2b26;
  --danger-soft:  #fbf0ef;
  --danger-line:  #edcecb;
  --warn-ink:     #8a5a12;
  --warn-soft:    #faf3e4;
  --warn-line:    #e8d9b4;
  --info-ink:     #1e4470;
  --info-soft:    #eef1f6;
  --info-line:    #cdd7e6;

  /* Tipografía */
  --font-title: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-body:  "IBM Plex Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  --font-num:   "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --field-border: #c8c3ba;
  --radius:    4px;
  --radius-lg: 6px;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Encabezado ─────────────────────────────────────────────────────────── */

header {
  background: var(--ink);
  color: #fff;
  position: relative;
  z-index: 100;
  border-bottom: 3px double var(--accent);
}
/* Rayado tenue de papel de libro contable sobre el fondo del encabezado */
header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(255,255,255,.028) 0 1px, transparent 1px 7px);
}
header .header-inner {
  max-width: 900px; margin: 0 auto; padding: 18px 24px 20px;
  display: flex; align-items: flex-start; gap: 15px; position: relative;
}
header h1 {
  font-family: var(--font-title);
  font-size: 25px; font-weight: 600;
  letter-spacing: -0.012em; line-height: 1.15;
}
header p { font-size: 12.5px; color: #9aa6b4; margin-top: 5px; }
header a { color: #9aa6b4; text-decoration: none; }
header a:hover { color: #fff; text-decoration: underline; }

/* Sello: la marca del sitio, con aire de cuño sobre un formulario */
.sello {
  flex-shrink: 0; width: 42px; height: 42px; margin-top: 2px;
  border: 1.5px solid var(--accent); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 16px; font-weight: 600;
  letter-spacing: .04em; color: var(--accent-line);
  text-decoration: none; transform: rotate(-1.5deg);
  transition: border-color .15s, color .15s;
}
.sello:hover { border-color: var(--accent-line); color: #fff; text-decoration: none; }
.marca {
  font-family: var(--font-num); font-size: 10px; font-weight: 500;
  letter-spacing: .19em; text-transform: uppercase;
  color: var(--accent); display: block; margin-bottom: 5px;
}

/* ── Estructura ─────────────────────────────────────────────────────────── */

main { max-width: 780px; margin: 30px auto; padding: 0 20px 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
}
.card + .card { margin-top: 20px; }
.card h2 {
  font-family: var(--font-title);
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.012em; line-height: 1.25;
  color: var(--ink); margin-bottom: 7px;
}
.card .subtitle { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 22px; line-height: 1.55; }

h2 { font-family: var(--font-title); font-weight: 600; letter-spacing: -0.012em; }

/* Cada subtítulo lleva una marca corta al margen, como una anotación */
h3 {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin: 28px 0 9px; padding-left: 15px; position: relative;
}
h3::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 8px; height: 1.5px; background: var(--accent);
}
h3:first-of-type { margin-top: 20px; }

p  { color: var(--ink-soft); margin-bottom: 13px; }
ul { color: var(--ink-soft); margin: 0 0 13px 19px; }
li { margin-bottom: 5px; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

.intro { font-size: 15px; color: var(--ink-soft); line-height: 1.7; }

/* ── Formularios ────────────────────────────────────────────────────────── */

label {
  display: block; font-size: 11px; font-weight: 600; color: var(--ink-soft);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: .07em;
}
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--field-border); border-radius: var(--radius);
  padding: 9px 11px; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,92,70,.13);
}
input[type=number] { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
textarea { resize: vertical; line-height: 1.55; }
::placeholder { color: var(--ink-faint); }
input.error { border-color: var(--danger); }

.field-group { margin-bottom: 18px; }
.field-error { font-size: 12.5px; color: var(--danger); margin-top: 4px; display: none; }
.field-error.visible { display: block; }
.fila { display: flex; gap: 12px; }
.fila > div { flex: 1; }

/* ── Botones ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 10px 18px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--field-border); }
.btn-secondary:hover { background: var(--bg-sunken); border-color: var(--ink-faint); }
.btn-success   { background: var(--ink); color: #fff; }
.btn-success:hover { background: #0f1926; }
.btn-danger {
  background: transparent; color: var(--ink-faint); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 3px 8px; font-size: 12px; cursor: pointer;
  font-family: var(--font-body);
}
.btn-danger:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 10px; }

/* ── Tablas ─────────────────────────────────────────────────────────────── */

/* Las tablas citan al papel de libro contable: bandas verdes tenues en las
   filas pares y doble raya sobre los totales, como en una hoja de trabajo. */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  background: var(--bg-sunken); color: var(--ink-soft); font-weight: 600;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: middle; }
tbody tr:nth-child(even) td { background: rgba(29, 92, 70, .035); }
tbody tr:last-child td { border-bottom: none; }
.num-right, .num {
  text-align: right; font-family: var(--font-num);
  font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap;
}
tfoot td, tr.total-row td {
  background: transparent; font-weight: 600; color: var(--ink);
  border-top: 3px double var(--ink); border-bottom: none; padding-top: 9px;
}
.tabla-scroll { overflow-x: auto; }
.tabla-guia { margin: 4px 0 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* ── Bloques de aviso ───────────────────────────────────────────────────── */

.info-box, .warn-box, .err-box, .detected-box {
  border: 1px solid; border-left-width: 3px; border-radius: var(--radius);
  padding: 11px 14px; font-size: 13.5px; line-height: 1.55; margin-bottom: 16px;
}
.info-box     { background: var(--info-soft);    border-color: var(--info-line);    color: var(--info-ink); }
.warn-box     { background: var(--warn-soft);    border-color: var(--warn-line);    color: var(--warn-ink); margin-top: 20px; margin-bottom: 0; }
.err-box      { background: var(--danger-soft);  border-color: var(--danger-line);  color: var(--danger); display: none; }
.detected-box { background: var(--accent-soft);  border-color: var(--accent-line);  color: var(--accent); }
.info-box p, .warn-box p, .err-box p, .detected-box p { color: inherit; margin: 0; }
.info-box strong, .warn-box strong, .detected-box strong { color: inherit; }

/* ── Guías: elementos editoriales ───────────────────────────────────────── */

.miga { font-size: 12px; color: var(--ink-faint); margin-bottom: 16px; }
.miga a { color: var(--ink-faint); text-decoration: none; }
.miga a:hover { color: var(--accent); text-decoration: underline; }

.ejemplo {
  background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 15px 18px; margin: 16px 0;
}
.ejemplo h4 {
  font-size: 10.5px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 9px;
}
.ejemplo p:last-child, .ejemplo ul:last-child, .ejemplo .tabla-scroll:last-child { margin-bottom: 0; }
.ejemplo .cuenta {
  font-family: var(--font-num); font-size: 12.5px; line-height: 1.8; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; margin: 9px 0 0; overflow-x: auto; font-variant-numeric: tabular-nums;
}

.cta-herramienta {
  display: flex; align-items: flex-start; gap: 13px;
  background: var(--ink); border-radius: var(--radius-lg);
  padding: 17px 20px; margin: 22px 0; text-decoration: none; transition: background .12s;
}
.cta-herramienta:hover { background: #0f1926; }
.cta-herramienta svg { width: 19px; height: 19px; color: var(--accent-line); flex-shrink: 0; margin-top: 2px; }
.cta-herramienta strong { display: block; color: #fff; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.cta-herramienta span { display: block; color: #9aa6b4; font-size: 13px; line-height: 1.5; }

.lista-guias { list-style: none; margin: 0; }
.lista-guias li { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.lista-guias li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.lista-guias a { font-family: var(--font-title); font-size: 16px; font-weight: 600; text-decoration: none; color: var(--ink); }
.lista-guias a:hover { color: var(--accent); }
.lista-guias p { margin: 4px 0 0; font-size: 13.5px; }

.dato-actualizacion { font-size: 12px; color: var(--ink-faint); margin-top: 22px; }

/* Texto explicativo al pie de las herramientas */
.seo-text {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px 30px; font-size: 14.5px; line-height: 1.7;
}
.seo-text h2 { font-size: 17px; margin: 22px 0 7px; }
.seo-text h2:first-child { margin-top: 0; }

/* Listas de enlaces a guías / herramientas */
.lista-simple { list-style: none; margin: 0; }
.lista-simple li { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.lista-simple li:first-child { padding-top: 0; }
.lista-simple li:last-child { border-bottom: none; padding-bottom: 0; }
.lista-simple a { font-weight: 600; text-decoration: none; font-size: 14.5px; }
.lista-simple a:hover { text-decoration: underline; }
.lista-simple span { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; line-height: 1.5; }

/* ── Publicidad ─────────────────────────────────────────────────────────── */

.page-layout { display: flex; gap: 22px; margin: 30px auto; padding: 0 20px 20px; align-items: flex-start; max-width: 1340px; }
.page-layout main { margin: 0; padding: 0; width: 780px; flex-shrink: 0; }
.ad-side { flex: 1; min-width: 120px; max-width: 300px; position: sticky; top: 22px; }
.ad-side-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 8px; text-align: center; color: var(--ink-faint);
  font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  min-height: 380px; display: flex; align-items: center; justify-content: center;
}

/* ── Pie ────────────────────────────────────────────────────────────────── */

.pie-sitio { background: var(--ink); color: #8e9aa8; padding: 34px 24px 28px; font-size: 13px; line-height: 1.65; margin-top: 44px; }
.pie-inner { max-width: 900px; margin: 0 auto; }
.pie-sitio strong { font-family: var(--font-title); color: #fff; font-size: 15px; display: block; margin-bottom: 5px; font-weight: 600; }
.pie-nav { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 15px 0; }
.pie-nav a { color: #b3bcc7; text-decoration: none; font-size: 13px; }
.pie-nav a:hover { color: #fff; text-decoration: underline; }
.pie-legal { border-top: 1px solid #2a3542; padding-top: 13px; margin-top: 15px; font-size: 12px; color: #6f7a88; }

/* ── Menú de herramientas ───────────────────────────────────────────────── */

.nav-herr { position: absolute; top: 0; bottom: 0; right: 24px; display: flex; align-items: stretch; }
.nav-herr-btn {
  background: transparent; color: #9aa6b4; border: none; height: 100%;
  padding: 0 15px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  font-family: var(--font-body); display: flex; align-items: center; gap: 7px;
  transition: background .12s, color .12s;
}
.nav-herr-btn svg { width: 10px; height: 10px; transition: transform .15s; }
.nav-herr:hover .nav-herr-btn, .nav-herr.abierto .nav-herr-btn { background: rgba(255,255,255,.07); color: #fff; }
.nav-herr:hover .nav-herr-btn svg, .nav-herr.abierto .nav-herr-btn svg { transform: rotate(180deg); }
.nav-herr-panel {
  display: none; position: absolute; right: 0; top: 100%; min-width: 300px;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden;
  box-shadow: 0 12px 28px rgba(23,33,46,.16);
}
.nav-herr:hover .nav-herr-panel, .nav-herr.abierto .nav-herr-panel { display: block; }
.nav-herr-panel a { display: block; padding: 11px 16px; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.nav-herr-panel a:last-child { border-bottom: none; }
.nav-herr-panel a:hover { background: var(--accent-soft); }
.nav-herr-panel a strong { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.nav-herr-panel a span { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.nav-herr-panel a.actual strong { color: var(--accent); }
.nav-herr-panel a.actual::after { content: 'estás acá'; font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }

/* ── Adaptación ─────────────────────────────────────────────────────────── */

@media (max-width: 1120px) {
  .ad-side { display: none; }
  .page-layout { justify-content: center; }
  .page-layout main { width: 100%; max-width: 780px; }
}
@media (max-width: 620px) {
  header .header-inner { padding: 18px 20px; }
  header h1 { font-size: 18px; }
  .nav-herr { right: 8px; }
  .nav-herr-btn { padding: 0 11px; font-size: 13px; }
  .nav-herr-panel { min-width: 250px; }
  .card { padding: 22px 18px; }
  main, .page-layout { padding-left: 14px; padding-right: 14px; }
  .fila { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
