/**
 * Assessoria Botey – Calculadora d'indemnització
 * Estil «Expediente»: hereta els colors i les tipografies del tema Botey
 * (variables --brand, --ink, --font-display…) i té valors de reserva.
 */

.bsjcalc {
	--c-brand: var(--brand, #2997ab);
	--c-dark: var(--brand-dark, #145f6e);
	--c-mid: var(--brand-mid, #1c7e90);
	--c-pale: var(--brand-pale, #9ed9e3);
	--c-light: var(--brand-light, #5fc3d4);
	--c-soft: var(--brand-soft, #ebf8fb);
	--c-ink: var(--ink, #212934);
	--c-text: var(--text, #4a4e57);
	--c-muted: var(--muted, #5b616b);
	--c-line: var(--line, #d7e9ed);
	--c-field: var(--field, #9fb7bd);
	--c-focus: var(--focus, #0a6e80);
	--f-body: var(--font-body, "Lora", Georgia, serif);
	--f-display: var(--font-display, "Bebas Neue", "Arial Narrow", Impact, sans-serif);
	--r: var(--radius, 12px);
	--r-sm: var(--radius-sm, 6px);
	--r-tab: var(--tab, 10px);
	color: var(--c-text);
	font-family: var(--f-body);
	font-size: 17px;
	line-height: 1.6;
	max-width: 1160px;
	margin: clamp(48px, 7vw, 88px) auto 0;
	box-sizing: border-box;
}
.bsjcalc *, .bsjcalc *::before, .bsjcalc *::after { box-sizing: border-box; }
/* El tema limita els fills de .entry a 780px: la calculadora ocupa tot l'ample. */
.entry > .wrap > .bsjcalc { max-width: 1160px; }

/* ---------- Botó «T'han acomiadat?» (principi de la pàgina) ---------- */
.bsjcalc .bsjcalc-jump, .bsjcalc-jump { margin: 0 0 clamp(28px, 4vw, 40px); }
.bsjcalc-jump-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
	padding: 0 24px 0 28px;
	background: var(--brand-dark, #145f6e);
	color: #fff;
	border-radius: var(--tab, 10px) var(--tab, 10px) var(--radius-sm, 6px) var(--radius-sm, 6px);
	box-shadow: inset 0 -5px 0 var(--brand-pale, #9ed9e3);
	font: 400 clamp(24px, 2.4vw, 30px)/1 var(--font-display, "Bebas Neue", "Arial Narrow", Impact, sans-serif);
	letter-spacing: .04em;
	text-decoration: none;
	transition: background-color .15s;
}
.bsjcalc-jump-btn:hover, .bsjcalc-jump-btn:focus-visible { background: var(--ink, #212934); color: #fff; }
.bsjcalc-jump-btn svg { flex: none; transition: transform .2s ease; }
.bsjcalc-jump-btn:hover svg { transform: translateY(3px); }
.bsjcalc { scroll-margin-top: 130px; }

/* ---------- Carpeta ---------- */
.bsjcalc-tab {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 24px;
	background: var(--c-dark);
	color: #fff;
	border-radius: var(--r-tab) var(--r-tab) 0 0;
	font: 400 22px/1 var(--f-display);
	letter-spacing: .04em;
}
.bsjcalc-folder-body {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(28px, 4vw, 56px);
	align-items: start;
	background: var(--c-dark);
	color: #fff;
	border-radius: 0 var(--r) var(--r) var(--r);
	padding: clamp(28px, 4.5vw, 56px);
}
.bsjcalc .bsjcalc-title {
	font: 400 clamp(40px, 4.6vw, 62px)/.95 var(--f-display);
	letter-spacing: .01em;
	color: #fff;
	margin: 0 0 .45em;
	padding: 0;
	border: 0;
	background: none;
	text-wrap: balance;
	max-width: none;
}
.bsjcalc-lead { margin: 0 0 28px; color: var(--on-dark-muted, #d5dadf); font-size: 18px; max-width: 34ch; }

.bsjcalc .bsjcalc-rates { list-style: none; margin: 0; padding: 0; max-width: 360px; }
.bsjcalc-rates li {
	display: flex;
	align-items: baseline;
	gap: 16px;
	padding: 10px 0;
	border-top: 1px solid rgba(255, 255, 255, .22);
	margin: 0;
}
.bsjcalc .bsjcalc-rates > li { padding-left: 0 !important; margin-bottom: 0 !important; }
.bsjcalc .bsjcalc-rates > li::before { content: none !important; display: none !important; }
.bsjcalc-rates li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .22); }
.bsjcalc-rates strong { font: 400 52px/1 var(--f-display); color: var(--c-pale); min-width: 1.4em; }
.bsjcalc-rates span { font-size: 16px; color: #fff; }

/* ---------- Full del formulari ---------- */
.bsjcalc-form {
	position: relative;
	background: #fff;
	color: var(--c-text);
	border-radius: var(--r);
	padding: clamp(22px, 3vw, 36px);
	margin: 0;
}
.bsjcalc-form::before {
	/* full de sota, com un expedient */
	content: "";
	position: absolute;
	inset: 0;
	background: var(--c-pale);
	border-radius: var(--r);
	transform: rotate(-2deg) translate(-6px, 4px);
	z-index: -1;
}
.bsjcalc-folder-body { position: relative; z-index: 0; isolation: isolate; }

.bsjcalc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bsjcalc-field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.bsjcalc-field label, .bsjcalc-field legend {
	display: block;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.35;
	color: var(--c-ink);
	margin-bottom: 8px;
	padding: 0;
}
.bsjcalc-field abbr { color: #a3261c; text-decoration: none; border: 0; }
.bsjcalc input[type="date"], .bsjcalc input[type="text"] {
	width: 100%;
	height: 52px;
	padding: 0 14px;
	border: 2px solid var(--c-field);
	border-radius: var(--r-sm);
	font: 400 17px/1.2 var(--f-body);
	color: var(--c-ink);
	background: #fff;
	margin: 0;
	transition: border-color .15s;
}
.bsjcalc input:hover { border-color: var(--c-mid); }
.bsjcalc input:focus { outline: 3px solid var(--c-focus); outline-offset: 2px; border-color: var(--c-dark); }
.bsjcalc-money { position: relative; max-width: 300px; }
.bsjcalc .bsjcalc-money input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.bsjcalc-money span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--c-muted); font-weight: 600; }
.bsjcalc .bsjcalc-help { font-size: 14px; color: var(--c-muted); margin: 8px 0 0; }

/* Diari / Mensual / Anual */
.bsjcalc-seg { display: inline-flex; border: 2px solid var(--c-dark); border-radius: var(--r-sm); overflow: hidden; }
.bsjcalc-seg label { margin: 0; cursor: pointer; position: relative; }
.bsjcalc-seg label + label { border-left: 2px solid var(--c-dark); }
.bsjcalc-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bsjcalc-seg span {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	font: 400 21px/1 var(--f-display);
	letter-spacing: .04em;
	color: var(--c-dark);
	transition: background-color .15s, color .15s;
}
.bsjcalc-seg label:hover span { background: var(--c-soft); }
.bsjcalc-seg input:checked + span { background: var(--c-dark); color: #fff; }
.bsjcalc-seg input:focus-visible + span { outline: 3px solid var(--c-focus); outline-offset: -5px; }

.bsjcalc-error {
	background: #fdeeec;
	color: #7f1d15;
	border-left: 4px solid #a3261c;
	padding: 12px 16px;
	border-radius: var(--r-sm);
	margin-bottom: 20px;
	font-size: 15px;
}

/* ---------- Botons (com els .btn del tema) ---------- */
.bsjcalc-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bsjcalc .bsjcalc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 26px;
	border: 2px solid var(--c-dark);
	border-radius: var(--r-sm);
	font: 400 22px/1 var(--f-display);
	letter-spacing: .04em;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s, color .15s, border-color .15s;
}
.bsjcalc .bsjcalc-btn-primary { background: var(--c-dark); color: #fff; }
.bsjcalc .bsjcalc-btn-primary:hover { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.bsjcalc .bsjcalc-btn-ghost { background: transparent; color: var(--c-dark); }
.bsjcalc .bsjcalc-btn-ghost:hover { background: var(--c-dark); color: #fff; }
.bsjcalc .bsjcalc-btn-link { border-color: transparent; background: transparent; color: var(--link, #0a6e80); padding: 0 8px; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
.bsjcalc .bsjcalc-btn-link:hover { color: var(--c-ink); }
.bsjcalc .bsjcalc-btn:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }

/* ---------- Finestra del resultat (en primer pla) ---------- */
.bsjcalc-dialog {
	width: min(1100px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: auto;
	overscroll-behavior: contain;
}
.bsjcalc-dialog:not([open]) { display: none; }
.bsjcalc-dialog::backdrop { background: rgba(33, 41, 52, .72); }
.bsjcalc .bsjcalc-dialog .bsjcalc-result { margin: 0; }
.bsjcalc .bsjcalc-close {
	position: sticky;
	top: 26px;
	float: right;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 26px 16px -70px 0;
	padding: 0 16px;
	border: 0;
	border-radius: var(--r-sm);
	background: var(--c-ink);
	color: #fff;
	font: 400 20px/1 var(--f-display);
	letter-spacing: .04em;
	cursor: pointer;
}
.bsjcalc .bsjcalc-close:hover { background: var(--c-dark); }
.bsjcalc .bsjcalc-close:focus-visible { outline: 3px solid var(--c-pale); outline-offset: 2px; }
.bsjcalc-dialog .bsjcalc-print-head { padding-right: 130px; }

/* ---------- Resultat: el full de l'expedient ---------- */
.bsjcalc-result {
	position: relative;
	margin-top: clamp(32px, 4vw, 48px);
	background: #fff;
	border: 2px solid var(--c-dark);
	border-radius: var(--r);
	padding: clamp(24px, 4vw, 44px);
	padding-top: calc(clamp(24px, 4vw, 44px) + 14px);
	overflow: hidden;
	scroll-margin-top: 120px;
}
.bsjcalc-result::before {
	/* franja de colors del tema (com sota el títol de la pàgina) */
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 14px;
	background: linear-gradient(90deg, var(--c-pale) 0 16.66%, var(--c-light) 16.66% 33.33%, var(--c-brand) 33.33% 50%, var(--c-mid) 50% 66.66%, var(--c-dark) 66.66% 83.33%, var(--c-ink) 83.33%);
}
.bsjcalc-result:focus { outline: none; }
.bsjcalc-result:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.bsjcalc-result.is-in { animation: bsjcalc-in .4s ease-out; }
@keyframes bsjcalc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bsjcalc-print-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px 24px;
	flex-wrap: wrap;
	padding-bottom: 20px;
	margin-bottom: 24px;
	border-bottom: 2px solid var(--c-ink);
}
.bsjcalc-brand { display: flex; flex-direction: column; color: #000; line-height: 1; }
.bsjcalc-brand-name { font: 400 30px/1 var(--f-body); letter-spacing: -.01em; }
.bsjcalc-brand-name span { color: var(--c-brand); }
.bsjcalc-brand-tag { font: 400 14px/1.1 var(--f-body); word-spacing: .6em; padding-left: .95em; margin-top: 4px; }
.bsjcalc-print-meta { text-align: right; font-size: 14px; color: var(--c-muted); }
.bsjcalc-print-meta strong { display: block; color: var(--c-ink); font-size: 15px; }

.bsjcalc-summary {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	margin-bottom: 28px;
	border-top: 1px solid var(--c-line);
	border-bottom: 1px solid var(--c-line);
}
.bsjcalc-summary > div { padding: 14px 16px; border-left: 1px solid var(--c-line); }
.bsjcalc-summary > div:first-child { border-left: 0; padding-left: 0; }
.bsjcalc-summary span { display: block; font-size: 13px; color: var(--c-muted); margin-bottom: 4px; }
.bsjcalc-summary strong { display: block; font-size: 16px; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.bsjcalc-summary em { display: block; font-style: normal; font-size: 13px; color: var(--c-muted); margin-top: 2px; }

.bsjcalc-cards { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 16px; margin-bottom: 32px; align-items: stretch; }
.bsjcalc-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px 22px;
	border: 2px solid var(--c-line);
	border-radius: var(--r);
	background: #fff;
}
.bsjcalc-card.is-main { background: var(--c-dark); border-color: var(--c-dark); color: #fff; }
.bsjcalc-card-label { font-size: 15px; font-weight: 600; color: var(--c-ink); line-height: 1.3; }
.bsjcalc-card.is-main .bsjcalc-card-label { color: #fff; }
.bsjcalc-card-amount { font: 400 clamp(38px, 3.6vw, 48px)/1 var(--f-display); letter-spacing: .01em; color: var(--c-dark); font-variant-numeric: tabular-nums; margin-top: 4px; }
.bsjcalc-card.is-main .bsjcalc-card-amount { color: #fff; font-size: clamp(52px, 5.4vw, 72px); }
.bsjcalc-card-rule { font-size: 13px; color: var(--c-muted); line-height: 1.4; }
.bsjcalc-card.is-main .bsjcalc-card-rule { color: var(--on-dark-muted, #d5dadf); }

/* «Tope aplicado» com un segell */
.bsjcalc-badge {
	display: inline-block;
	align-self: flex-start;
	margin-top: 6px;
	padding: 3px 10px 1px;
	border: 2px solid currentColor;
	border-radius: 4px;
	color: var(--c-dark);
	font: 400 16px/1.1 var(--f-display);
	letter-spacing: .06em;
	transform: rotate(-3deg);
	white-space: nowrap;
}
.bsjcalc-card.is-main .bsjcalc-badge { color: var(--c-pale); }
td .bsjcalc-badge { margin: 4px 0 0; }

.bsjcalc h4 {
	font: 400 28px/1 var(--f-display);
	letter-spacing: .02em;
	color: var(--c-ink);
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	background: none;
}

.bsjcalc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; border: 0; }
.bsjcalc th, .bsjcalc td { padding: 12px; border: 0; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; background: none; }
.bsjcalc thead th { background: var(--c-soft); color: var(--c-ink); font-size: 14px; font-weight: 600; border-bottom: 2px solid var(--c-brand); }
.bsjcalc td strong { color: var(--c-ink); font-weight: 600; }
.bsjcalc td small { display: block; color: var(--c-muted); font-size: 13px; margin-top: 2px; }
.bsjcalc .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bsjcalc tr.is-hl td { background: #f5fbfc; }
.bsjcalc tr.is-hl td:first-child { box-shadow: inset 4px 0 0 var(--c-brand); }

.bsjcalc-breakdown, .bsjcalc-table-wrap { margin-bottom: 28px; }
.bsjcalc .bsjcalc-note { font-size: 14px; color: var(--c-muted); margin: 10px 0 0; }
.bsjcalc .bsjcalc-footnote { font-size: 14px; color: var(--c-muted); margin: 0 0 24px; }

.bsjcalc-disclaimer {
	background: var(--c-soft);
	border-left: 4px solid var(--c-brand);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
	padding: 16px 20px;
	font-size: 15px;
	margin-bottom: 28px;
}
.bsjcalc-disclaimer p { margin: 0; }
.bsjcalc .bsjcalc-contact-line { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 10px; font-weight: 600; }
.bsjcalc-contact-line a { color: var(--c-ink); }
.bsjcalc-contact-line span { color: var(--c-muted); font-weight: 400; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.bsjcalc-folder-body { grid-template-columns: 1fr; }
	.bsjcalc-lead { max-width: none; }
	.bsjcalc .bsjcalc-rates { display: grid; grid-template-columns: repeat(3, 1fr); max-width: none; gap: 12px; }
	.bsjcalc-rates li, .bsjcalc-rates li:last-child { flex-direction: column; gap: 2px; border-bottom: 0; }
	.bsjcalc-rates strong { font-size: 44px; }
	.bsjcalc-rates span { font-size: 14px; line-height: 1.3; }
	.bsjcalc-cards { grid-template-columns: 1fr; }
	.bsjcalc-summary { grid-template-columns: 1fr 1fr; }
	.bsjcalc-summary > div:nth-child(3) { border-left: 0; padding-left: 0; }
	.bsjcalc-summary > div:nth-child(n+3) { border-top: 1px solid var(--c-line); }
}
@media (max-width: 600px) {
	.bsjcalc { font-size: 16px; }
	.bsjcalc-folder-body { padding: 24px 18px 28px; border-radius: 0 var(--r) var(--r) var(--r); }
	.bsjcalc-form { padding: 20px 16px; }
	.bsjcalc-form::before { transform: rotate(-1.5deg) translate(-3px, 4px); }
	.bsjcalc-grid { grid-template-columns: 1fr; gap: 0; }
	.bsjcalc-seg { display: flex; }
	.bsjcalc-seg label { flex: 1; }
	.bsjcalc-seg span { justify-content: center; padding: 0 8px; }
	.bsjcalc-money { max-width: none; }
	.bsjcalc-result { padding: 30px 16px 20px; }
	.bsjcalc-print-head { flex-direction: column; align-items: flex-start; }
	.bsjcalc-print-meta { text-align: left; }
	.bsjcalc-summary > div { padding: 12px 10px; }
	.bsjcalc-summary > div:nth-child(odd) { border-left: 0; padding-left: 0; }
	.bsjcalc-table thead { display: none; }
	.bsjcalc-table tr { display: block; border-bottom: 1px solid var(--c-line); padding: 8px 0; }
	.bsjcalc .bsjcalc-table td { display: flex; justify-content: space-between; gap: 16px; border: 0; padding: 4px 4px; text-align: right; }
	.bsjcalc-table td::before { content: attr(data-th); font-weight: 600; color: var(--c-muted); text-align: left; font-size: 13px; }
	.bsjcalc .bsjcalc-table td:first-child { display: block; text-align: left; }
	.bsjcalc-table td:first-child::before, .bsjcalc-table td.bsjcalc-c-rule::before { display: none; }
	.bsjcalc .bsjcalc-table td.bsjcalc-c-rule { display: block; text-align: left; color: var(--c-muted); font-size: 14px; }
	.bsjcalc tr.is-hl td:first-child { box-shadow: none; }
	.bsjcalc-breakdown table { font-size: 14px; }
	.bsjcalc-breakdown th, .bsjcalc-breakdown td { padding: 8px 6px; }
	.bsjcalc-actions .bsjcalc-btn { flex: 1 1 100%; }
	.bsjcalc .bsjcalc-rates { display: block; }
	.bsjcalc-rates li, .bsjcalc-rates li:last-child { flex-direction: row; align-items: center; gap: 14px; padding: 6px 0; }
	.bsjcalc-rates li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .22); }
	.bsjcalc-rates strong { font-size: 38px; }
	.bsjcalc-rates span { font-size: 15px; }
	.bsjcalc .bsjcalc-title { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
	.bsjcalc-result.is-in { animation: none; }
}

.bsjcalc-print-root { display: none; }

/* ---------- Impressió / PDF: només el resultat ---------- */
@media print {
	@page { size: A4; margin: 14mm 12mm; }
	html.bsjcalc-printing body > *:not(.bsjcalc-print-root) { display: none !important; }
	html.bsjcalc-printing body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
	html.bsjcalc-printing .bsjcalc-print-root { display: block !important; }
	html.bsjcalc-printing .bsjcalc-dialog { display: none !important; }
	.bsjcalc-print-root .bsjcalc { max-width: none; margin: 0; }
	.bsjcalc-print-root .bsjcalc-result { margin: 0 !important; border: 0 !important; padding: 18px 0 0 !important; animation: none !important; }
	.bsjcalc { font-size: 10.5pt; }
	.bsjcalc-noprint { display: none !important; }
	.bsjcalc-result, .bsjcalc-card, .bsjcalc-disclaimer, .bsjcalc thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.bsjcalc-cards { grid-template-columns: 1.35fr 1fr 1fr !important; }
	.bsjcalc-summary { grid-template-columns: repeat(4, 1fr) !important; }
	.bsjcalc-summary > div { border-left: 1px solid #d7e9ed !important; border-top: 0 !important; padding: 8px 10px !important; }
	.bsjcalc-summary > div:first-child { border-left: 0 !important; padding-left: 0 !important; }
	.bsjcalc-print-head { flex-direction: row !important; align-items: flex-end !important; }
	.bsjcalc-print-meta { text-align: right !important; }
	.bsjcalc-card.is-main .bsjcalc-card-amount { font-size: 44pt !important; }
	.bsjcalc-card-amount { font-size: 28pt !important; }
	.bsjcalc-table thead { display: table-header-group !important; }
	.bsjcalc-table tr { display: table-row !important; page-break-inside: avoid; }
	.bsjcalc .bsjcalc-table td { display: table-cell !important; text-align: left; padding: 6px 8px !important; border-bottom: 1px solid #d7e9ed !important; }
	.bsjcalc .bsjcalc-table td.num { text-align: right !important; }
	.bsjcalc-table td::before { display: none !important; }
	.bsjcalc-disclaimer { page-break-inside: avoid; }
}
