/* Derechos en Cifras — estilos base. Sin fuentes externas: carga instantánea. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #18201d;
  --muted: #5b6662;
  --line: #e2e0d8;
  --brand: #0f3d33;
  --brand-2: #1d6b55;
  --brand-soft: #e5efe9;
  --accent: #c8862a;
  --warn-bg: #fff5e6;
  --warn-line: #e7b46a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 8px 24px rgba(16, 24, 20, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--font);
}
a { color: var(--brand-2); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.muted { color: var(--muted); }

/* Cabecera */
.site-header { background: var(--brand); color: #fff; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand:hover { color: #fff; }
.brand em { font-style: normal; font-weight: 400; opacity: .75; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: var(--brand); font-weight: 800;
}
.nav { display: flex; gap: 18px; font-size: 15px; }
.nav a { color: #d8e8e1; text-decoration: none; }
.nav a:hover { color: #fff; }
@media (max-width: 520px) { .nav a:last-child { display: none; } }

/* Portada */
.hero { padding: 48px 0 32px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.12; margin: 0 0 14px; letter-spacing: -.02em; }
.hero p { font-size: 19px; color: var(--muted); max-width: 620px; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; color: var(--brand-2); margin: 0 0 10px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 8px 0 48px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
a.card:hover { transform: translateY(-2px); border-color: var(--brand-2); color: var(--ink); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .tag { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--brand-2); }
.card.soon { opacity: .6; box-shadow: none; }
.card.soon .tag { color: var(--muted); }
.trust { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 56px; }
.trust div { border-top: 3px solid var(--brand-2); padding-top: 12px; }
.trust strong { display: block; margin-bottom: 4px; }
.trust span { color: var(--muted); font-size: 15px; }

/* Página de calculadora */
.page-head { padding: 28px 0 8px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); }
.page-head h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.015em; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 6px; }
.updated { font-size: 14px; color: var(--muted); margin: 0; }

.calc {
  display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 20px 0 36px;
}
@media (min-width: 860px) { .calc { grid-template-columns: 1.1fr 1fr; } }
.calc-form { padding: 22px; }
.calc-result { padding: 22px; background: var(--brand); color: #fff; }
.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.input-wrap { position: relative; }
.input-wrap .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
input[type="number"], input[type="time"], input[type="date"], select {
  width: 100%; font: inherit; font-size: 17px; padding: 11px 44px 11px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); appearance: none; -moz-appearance: textfield;
}
select {
  padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6662' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
}
input[type="time"], input[type="date"] { padding-right: 12px; min-height: 48px; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; text-align: center; padding: 9px 6px; font-size: 15px; cursor: pointer; border-right: 1px solid var(--line); margin: 0; font-weight: 500; }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--brand); font-weight: 700; }
.seg label:has(input:checked) { background: var(--brand-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.result-label { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: #b9d4c9; margin: 0 0 4px; }
.result-big { font: 700 clamp(34px, 7vw, 46px)/1.1 var(--font); margin: 0; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-sub { color: #cfe2da; margin: 4px 0 18px; font-size: 15px; }
.result-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.result-table td { padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.result-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; padding-left: 12px; }
.result-table tr.loss td:last-child { color: #ffd59a; }
.alert { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 14.5px; line-height: 1.5; background: var(--warn-bg); color: #5c3b07; border-left: 4px solid var(--warn-line); }
.alert[hidden] { display: none; }
.steps { margin-top: 18px; background: rgba(255, 255, 255, .07); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }
.steps summary { cursor: pointer; font-weight: 600; }
.steps ol { margin: 10px 0 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; color: #e3efe9; }
.steps code { font-family: var(--num); font-size: 13.5px; background: rgba(0, 0, 0, .2); padding: 1px 5px; border-radius: 5px; }

/* Contenido de la guía */
.article { padding-bottom: 40px; }
.article h2 { font-size: 26px; line-height: 1.25; margin: 40px 0 12px; letter-spacing: -.01em; }
.article h3 { font-size: 20px; margin: 28px 0 8px; }
.article p, .article li { max-width: 72ch; }
.article table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; background: var(--surface); border-radius: 10px; overflow: hidden; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.article th, .article td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.article th { background: var(--brand-soft); font-size: 14.5px; }
.table-scroll { overflow-x: auto; }
.formula { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-2); border-radius: 10px; padding: 14px 16px; font-weight: 600; margin: 14px 0; }
.note { background: var(--brand-soft); border-radius: 10px; padding: 14px 16px; margin: 18px 0; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; }
.sources { font-size: 14.5px; color: var(--muted); }
.related { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 12px 0 0; }

/* Pie */
.site-footer { background: #10201b; color: #c6d3ce; font-size: 15px; padding: 36px 0 20px; }
.site-footer a { color: #e3ece8; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .muted { color: #9fb1aa; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-brand { color: #fff; font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.footer-title { color: #fff; font-weight: 600; margin: 0 0 8px; }
.footer-note { border-top: 1px solid #24382f; margin-top: 24px; padding-top: 16px; font-size: 13.5px; color: #8fa39b; }
.footer-note p { margin: 0 0 4px; }

/* Barra de resultado fija en móvil */
.mini-result {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff; text-decoration: none; padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font-size: 14px;
}
.mini-result:hover { color: #fff; }
.mini-result strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.mini-result .mini-go { margin-left: auto; color: #cfe2da; }
.mini-result[hidden] { display: none; }
@media (min-width: 860px) { .mini-result { display: none !important; } }

/* Tabla de horas extra: tipo · horas · recargo */
.he-grid { display: grid; grid-template-columns: minmax(84px, auto) 1fr 1fr; gap: 8px 10px; align-items: center; }
.he-head { font-size: 13px; color: var(--muted); font-weight: 600; }
.he-type { font-size: 15px; font-weight: 500; }
.he-grid input[type="number"] { padding-right: 30px; }

/* En móviles estrechos, los campos dobles van uno debajo de otro */
@media (max-width: 430px) { .row2 { grid-template-columns: 1fr; } }

/* Casilla de verificación y filas de suma */
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-2); }
.result-table tr.sum td { border-top: 1px solid rgba(255, 255, 255, .4); font-size: 16px; }
.alert strong { font-weight: 700; }
