/* Calculadora Finiquito: estilos
   Una familia (Archivo, variable en peso y anchura). El color fuerte va solo en la calculadora;
   el resto de la página queda limpio para leer. */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff") format("woff");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  --paper: #f3f5f9;
  --surface: #ffffff;
  --ink: #0e1630;
  --muted: #59627c;
  --line: #dce1ec;
  --cobalt: #2340ff;
  --cobalt-deep: #1a2fc2;
  --on-cobalt: #ffffff;
  --on-cobalt-soft: #c9d1ff;
  --signal: #ffd23f;
  --on-signal: #0e1630;
  --error-on-cobalt: #ffe08a;
  --focus: #ffd23f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1326; --surface: #151d36; --ink: #eef1f8; --muted: #a2abc4; --line: #27304d;
    --cobalt: #3352ff; --cobalt-deep: #2a44d6; --on-cobalt-soft: #cdd5ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px; line-height: 1.6; font-stretch: 100%;
  font-feature-settings: "tnum" 0;
}
a { color: var(--cobalt); text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { a { color: #8ea0ff; } }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Cabecera */
header.site { background: var(--paper); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-weight: 800; font-stretch: 115%; font-size: 17px; letter-spacing: -.01em; }
.logo::before { content: "€"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--cobalt); color: #fff; font-size: 17px; font-stretch: 100%; }
.logo span { font-weight: 800; }
nav a { margin-left: 20px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }

/* Rejilla: contenido + carril lateral de anuncios en pantallas anchas */
.layout { display: block; }
.content { max-width: 760px; margin: 0 auto; min-width: 0; }
.rail { display: none; }
@media (min-width: 1180px) {
  .layout { display: grid; grid-template-columns: minmax(0, 760px) 300px; gap: 72px; justify-content: center; }
  .content { margin: 0; }
  .rail { display: block; padding-top: 150px; }
  .rail .ad-slot { position: sticky; top: 24px; margin: 0; min-height: 600px; }
}

/* Portada de cada página */
.hero { padding: 40px 0 26px; }
h1 {
  font-size: clamp(38px, 9.5vw, 72px); line-height: .95; margin: 0 0 18px;
  font-weight: 850; font-stretch: 118%; letter-spacing: -.035em; text-wrap: balance;
}
.lead { color: var(--muted); font-size: 19px; line-height: 1.5; margin: 0; max-width: 34em; }
.updated { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

/* La calculadora: el único bloque de color fuerte */
form.card {
  background: var(--cobalt); color: var(--on-cobalt);
  border-radius: 22px; padding: 26px 22px 24px; margin: 8px 0 22px;
  box-shadow: 0 24px 48px -24px rgba(35, 64, 255, .55);
}
@media (min-width: 640px) { form.card { padding: 34px 34px 30px; } }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
form.card label { font-weight: 650; font-size: 15px; }
form.card .hint { font-size: 13px; color: var(--on-cobalt-soft); line-height: 1.4; font-weight: 400; }
input, select {
  font: inherit; font-size: 17px; color: #0e1630; background: #ffffff;
  border: 2px solid transparent; border-radius: 12px; padding: 11px 13px; width: 100%; min-height: 50px;
  font-variant-numeric: tabular-nums;
}
input:focus, select:focus { outline: none; border-color: var(--signal); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #0e1630 50%), linear-gradient(135deg, #0e1630 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.check { flex-direction: row; align-items: center; gap: 12px; }
.check input { width: 22px; min-height: 22px; height: 22px; padding: 0; accent-color: var(--signal); flex: none; }
form.card .check label { font-weight: 500; }
.hidden { display: none !important; }

button.primary {
  margin-top: 24px; width: 100%; font: inherit; font-weight: 800; font-stretch: 112%; font-size: 19px;
  background: var(--signal); color: var(--on-signal); border: 0; border-radius: 14px;
  padding: 17px; cursor: pointer; transition: transform .12s ease;
}
button.primary:hover { filter: brightness(1.04); }
button.primary:active { transform: scale(.985); }
form.card .error { color: var(--error-on-cobalt); font-weight: 650; margin-top: 12px; }
form.card .error:empty { display: none; }

/* Resultado: un recibo con el total a gran tamaño */
.card.result {
  background: var(--surface); border-radius: 22px; padding: 28px 22px 22px; margin: 0 0 8px;
  border: 1px solid var(--line); animation: aparece .35s ease-out;
}
@media (min-width: 640px) { .card.result { padding: 34px; } }
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card.result { animation: none; } button.primary { transition: none; } }
.result h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; color: var(--muted); }
.total { margin: 0 0 22px; }
.total > div:first-child { font-size: 16px; color: var(--muted); }
.total .big {
  display: inline-block; font-size: clamp(46px, 13vw, 84px); font-weight: 850; font-stretch: 108%;
  line-height: 1; letter-spacing: -.04em; margin: 6px 0 10px; font-variant-numeric: tabular-nums;
  background: linear-gradient(transparent 62%, var(--signal) 62%, var(--signal) 92%, transparent 92%);
  padding: 0 4px; margin-left: -4px;
}
@media (prefers-color-scheme: dark) { .total .big { background: none; color: var(--signal); } }
.total .note { font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
td, th { padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 14px; color: var(--muted); font-weight: 650; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 650; }
td small { color: var(--muted); display: block; font-size: 13px; font-weight: 400; }
tr.sum td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); }
.note { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Textos */
article { max-width: 68ch; }
article h2 { font-size: clamp(26px, 5.5vw, 34px); line-height: 1.1; margin: 56px 0 14px; font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; }
article h3 { font-size: 20px; margin: 30px 0 6px; font-weight: 750; }
article p, article li { color: var(--ink); }
article ul { padding-left: 22px; }
article .tbl { overflow-x: auto; margin: 6px 0 4px; }
article .card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { font-weight: 700; cursor: pointer; list-style: none; position: relative; padding-right: 32px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: -3px; font-size: 24px; font-weight: 400; color: var(--cobalt); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 10px 0 0; color: var(--muted); }

/* Huecos de anuncio: invisibles hasta que se pega el código de AdSense.
   Llevan la etiqueta "Publicidad" y espacio reservado para que la página no salte al cargar. */
.ad-slot { margin: 44px 0; padding-top: 22px; position: relative; min-height: 280px; text-align: center; }
.ad-slot::before { content: "Publicidad"; position: absolute; top: 0; left: 0; font-size: 12px; color: var(--muted); }
.ad-slot:empty { display: none; }

/* Otras calculadoras y guías */
.more { margin-top: 72px; }
.more h2 { font-size: 24px; font-weight: 800; font-stretch: 112%; letter-spacing: -.01em; margin: 0 0 16px; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tools.list { grid-template-columns: 1fr; margin: 4px 0 20px; }
.tool { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  text-decoration: none; color: var(--ink); transition: border-color .15s; }
.tool:hover { border-color: var(--cobalt); }
.tool strong { display: block; font-size: 17px; font-weight: 750; }
.tool span { font-size: 14px; color: var(--muted); line-height: 1.45; display: block; margin-top: 3px; }

/* Pie */
footer.site { margin-top: 80px; padding: 40px 0 48px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 22px; margin-bottom: 24px; }
footer.site .cols div { display: flex; flex-direction: column; gap: 7px; }
footer.site .cols strong { color: var(--ink); font-weight: 750; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); text-decoration: underline; }

.legal h2 { font-size: 22px; margin: 32px 0 8px; }
@media (max-width: 440px) {
  .logo { font-size: 15px; font-stretch: 100%; gap: 8px; }
  .logo::before { width: 28px; height: 28px; font-size: 15px; }
  nav a { margin-left: 14px; font-size: 14px; }
}
.logo span { white-space: nowrap; }
@media (max-width: 380px) { nav a:first-child { display: none; } }
