/* ============================================================
   immoHouse Tools — calculators (v2, compact / high-end)
   Namespaced under .imh-calc. Mirrors immohouse-child design tokens
   (azurite #2C4FB0, gold #C9A23B, Archivo, squared/editorial).
   Falls back to local tokens if theme vars are absent.
   One stylesheet styles all 7 calculators (shared markup).
   ============================================================ */

.imh-calc {
	--imh-navy: var(--navy-700, #2C4FB0);
	--imh-navy-d: var(--navy-800, #1E3577);
	--imh-navy-900: var(--navy-900, #14224F);
	--imh-navy-50: var(--navy-50, #EEF2FE);
	--imh-gold: var(--gold-500, #C9A23B);
	--imh-gold-700: var(--gold-700, #8A6A2E);
	--imh-ink: var(--fg-1, #16181D);
	--imh-ink2: var(--fg-2, #585B63);
	--imh-mut: var(--fg-3, #8B8E96);
	--imh-line: var(--line-1, #E8E8E6);
	--imh-line2: var(--line-2, #DADAD7);
	--imh-paper: var(--paper, #F7F7F6);
	--imh-success: var(--color-success, #2E7D5B);
	--imh-error: var(--color-error, #C0432F);
	--imh-rs: 9px;
	--imh-r: 16px;
	--imh-sh-sm: 0 1px 2px rgba(20,34,79,.05);
	--imh-sh: 0 1px 2px rgba(20,34,79,.05), 0 16px 36px -20px rgba(20,34,79,.22);

	font-family: 'Archivo', system-ui, -apple-system, sans-serif;
	color: var(--imh-ink2);
	background: #fff;
	border: 1px solid var(--imh-line);
	border-radius: var(--imh-r);
	box-shadow: var(--imh-sh);
	max-width: 660px;
	margin: 1.75rem auto;
	overflow: hidden;
	position: relative;
}
.imh-calc * { box-sizing: border-box; }

/* Thin brand accent bar on top edge */
.imh-calc::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--imh-navy) 0%, var(--imh-navy-d) 60%, var(--imh-gold) 100%);
	z-index: 1;
}

/* Head — light, refined, compact (was a heavy dark block) */
.imh-calc__head {
	background: #fff;
	color: var(--imh-ink);
	padding: clamp(16px, 2.6vw, 22px) clamp(18px, 3vw, 26px) clamp(13px, 2vw, 16px);
	border-bottom: 1px solid var(--imh-line);
}
.imh-calc__title {
	font-family: 'Archivo', system-ui, sans-serif;
	font-weight: 700;
	letter-spacing: -.025em;
	font-size: clamp(1.05rem, 2vw, 1.28rem);
	line-height: 1.12;
	color: var(--imh-ink);
	margin: 0 0 4px;
}
.imh-calc__sub {
	font-size: .82rem;
	line-height: 1.45;
	color: var(--imh-ink2);
	margin: 0;
	max-width: 58ch;
}

.imh-calc__body { padding: clamp(16px, 3vw, 24px) clamp(18px, 3vw, 26px) clamp(18px, 3vw, 24px); }

/* Grid + fields */
.imh-calc__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 16px;
}
@media (max-width: 560px) { .imh-calc__grid { grid-template-columns: 1fr; } }

.imh-field { display: flex; flex-direction: column; gap: 6px; }
.imh-field--full { grid-column: 1 / -1; }
.imh-field label {
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--imh-mut);
}
.imh-out { color: var(--imh-navy); font-variant-numeric: tabular-nums; font-weight: 700; }
.imh-req { color: var(--imh-error); margin-left: 3px; }

.imh-field input[type="number"],
.imh-field input[type="text"],
.imh-field input[type="email"],
.imh-field input[type="tel"],
.imh-field select {
	border: 1px solid var(--imh-line2);
	border-radius: var(--imh-rs);
	background: #fff;
	font-family: 'Archivo', system-ui, sans-serif;
	font-size: .92rem;
	font-weight: 500;
	color: var(--imh-ink);
	padding: 9px 12px;
	outline: none;
	width: 100%;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .16s, box-shadow .16s;
}
.imh-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238B8E96' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 34px;
}
.imh-field input:focus, .imh-field select:focus {
	border-color: var(--imh-navy);
	box-shadow: 0 0 0 3px rgba(44,79,176,.13);
}

/* Range slider — filled track via accent-color, refined thumb */
.imh-field input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	accent-color: var(--imh-navy);
	width: 100%;
	height: 5px;
	border-radius: 999px;
	background: var(--imh-line2);
	outline: none;
	margin: 9px 0 4px;
	padding: 0;
	cursor: pointer;
}
.imh-field input[type="range"]:focus-visible { box-shadow: 0 0 0 3px rgba(44,79,176,.13); }
.imh-field input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: var(--imh-navy);
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba(20,34,79,.3);
	cursor: pointer;
	transition: transform .14s;
}
.imh-field input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.imh-field input[type="range"]::-moz-range-thumb {
	width: 18px; height: 18px;
	border-radius: 50%;
	background: var(--imh-navy);
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba(20,34,79,.3);
	cursor: pointer;
}

/* Results */
.imh-calc__results {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin: 20px 0 2px;
}
.imh-calc__results--compare { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) {
	.imh-calc__results { grid-template-columns: 1fr 1fr; }
	.imh-calc__results--compare { grid-template-columns: 1fr; }
}

.imh-result {
	border: 1px solid var(--imh-line);
	border-radius: var(--imh-rs);
	background: var(--imh-paper);
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}
/* Primary = full-width hero band, the headline number */
.imh-result--primary {
	grid-column: 1 / -1;
	background: var(--imh-navy-900);
	border-color: var(--imh-navy-900);
	padding: 16px 18px;
}
.imh-result--primary .imh-result__label { color: rgba(255,255,255,.62); }
.imh-result--primary .imh-result__hint { color: rgba(255,255,255,.55); }
.imh-result--accent {
	background: var(--gold-50, #F9F4E8);
	border-color: rgba(201,162,59,.32);
}
.imh-result__label {
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--imh-mut);
	display: flex;
	gap: 6px;
	align-items: baseline;
	flex-wrap: wrap;
}
.imh-result__hint { font-size: .64rem; text-transform: none; letter-spacing: 0; color: var(--imh-navy); font-weight: 500; }
.imh-result__value {
	font-family: 'Archivo', system-ui, sans-serif;
	font-weight: 700;
	font-size: 1.12rem;
	letter-spacing: -.02em;
	color: var(--imh-ink);
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}
.imh-result--primary .imh-result__value {
	color: #fff;
	font-size: clamp(1.6rem, 4vw, 2.1rem);
	letter-spacing: -.03em;
}
.imh-result--accent .imh-result__value { color: var(--imh-gold-700); }
.imh-result__value--text { font-size: .98rem; line-height: 1.3; }
.imh-result--primary .imh-result__value--text { font-size: clamp(1.1rem, 2.6vw, 1.35rem); }

/* Chart (inline SVG) */
.imh-chart {
	margin: 18px 0 2px;
	width: 100%;
	overflow: hidden;
}
.imh-chart svg { display: block; width: 100%; height: auto; }
.imh-chart:empty { display: none; }

/* Tables */
.imh-table-wrap { margin: 16px 0 2px; overflow-x: auto; border: 1px solid var(--imh-line); border-radius: var(--imh-rs); }
.imh-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
}
.imh-table th {
	text-align: right;
	font-weight: 600;
	font-size: .67rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--imh-mut);
	background: var(--imh-paper);
	padding: 9px 13px;
	border-bottom: 1px solid var(--imh-line2);
}
.imh-table th:first-child, .imh-table td:first-child { text-align: left; }
.imh-table td {
	padding: 8px 13px;
	text-align: right;
	border-bottom: 1px solid var(--imh-line);
	color: var(--imh-ink);
}
.imh-table tbody tr:last-child td { border-bottom: 0; }
.imh-table tbody tr:nth-child(even) td { background: rgba(20,34,79,.018); }
.imh-table tr.imh-table__total td { font-weight: 700; background: var(--imh-navy-50); color: var(--imh-navy); }

/* Schedule details */
.imh-schedule { margin-top: 16px; border: 1px solid var(--imh-line); border-radius: var(--imh-rs); }
.imh-schedule > summary {
	cursor: pointer;
	list-style: none;
	font-weight: 600;
	font-size: .88rem;
	color: var(--imh-ink);
	padding: 12px 15px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: background .14s;
}
.imh-schedule > summary:hover { background: var(--imh-paper); }
.imh-schedule > summary::-webkit-details-marker { display: none; }
.imh-schedule > summary::after { content: "+"; font-size: 1.3rem; color: var(--imh-gold-700); line-height: 1; }
.imh-schedule[open] > summary::after { content: "\2013"; }
.imh-schedule .imh-table-wrap { margin: 0; border: 0; border-top: 1px solid var(--imh-line); border-radius: 0; }

/* Services list */
.imh-services { margin-top: 20px; }
.imh-services__title { font-weight: 600; color: var(--imh-ink); font-size: .9rem; margin: 0 0 11px; }
.imh-services__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.imh-services__list li { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; color: var(--imh-ink2); }
.imh-services__list svg { color: var(--imh-navy); flex: 0 0 auto; margin-top: 2px; }

/* Notes */
.imh-note { font-size: .73rem; line-height: 1.5; color: var(--imh-mut); margin: 16px 0 0; }

/* Legal disclaimer (poglądowe) — shown under every calculator */
.imh-disclaimer { display: flex; gap: 9px; align-items: flex-start; margin: 18px 0 4px; padding: 12px 14px; background: #FBF7EC; border: 1px solid #E7DBBF; border-radius: 10px; font-size: .78rem; line-height: 1.5; color: var(--imh-ink2, #585B63); }
.imh-disclaimer svg { flex: 0 0 auto; margin-top: 1px; color: #B6904A; }
.imh-disclaimer strong { color: var(--imh-ink, #16181D); font-weight: 700; }
.imh-disclaimer a { color: var(--imh-navy, #2C4FB0); font-weight: 600; text-decoration: underline; }

/* Buttons */
.imh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: var(--imh-rs);
	font-family: 'Archivo', system-ui, sans-serif;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	padding: 11px 20px;
	border: 0;
	cursor: pointer;
	transition: background .18s, transform .18s, box-shadow .18s;
}
.imh-btn--dark { background: var(--imh-navy); color: #fff; }
.imh-btn--dark:hover { background: var(--imh-navy-d); color: #fff; transform: translateY(-1px); box-shadow: var(--imh-sh); }
.imh-btn--ghost {
	background: #fff;
	color: var(--imh-navy);
	border: 1px solid var(--imh-line2);
}
.imh-btn--ghost:hover { border-color: var(--imh-navy); background: var(--imh-navy-50); color: var(--imh-navy); }

/* Lead capture */
.imh-lead { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--imh-line); }
.imh-lead__form { margin-top: 16px; }
.imh-lead__form[hidden] { display: none; }
.imh-lead__actions { margin-top: 14px; }
.imh-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 14px;
	font-size: .78rem;
	line-height: 1.45;
	color: var(--imh-ink2);
	cursor: pointer;
}
.imh-consent input { margin-top: 2px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--imh-navy); }
.imh-lead__msg { font-size: .84rem; margin: 11px 0 0; min-height: 1em; }
.imh-lead__msg.is-ok { color: var(--imh-success); }
.imh-lead__msg.is-err { color: var(--imh-error); }

/* Wycena CTA block */
.imh-wycena__cta { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--imh-line); }
.imh-wycena__lead { font-size: .9rem; line-height: 1.5; color: var(--imh-ink2); margin: 0 0 14px; }

/* ============================================================
   SEO content block ([imh_calc_seo]) — renders as a sibling of
   .imh-calc on the dedicated calculator pages. Self-contained tokens.
   ============================================================ */
.imh-seo {
	--imh-navy: var(--navy-700, #2C4FB0);
	--imh-gold-700: var(--gold-700, #8A6A2E);
	--imh-ink: var(--fg-1, #16181D);
	--imh-ink2: var(--fg-2, #585B63);
	--imh-line: var(--line-1, #E8E8E6);
	--imh-paper: var(--paper, #F7F7F6);
	font-family: 'Archivo', system-ui, -apple-system, sans-serif;
	max-width: 760px;
	margin: 2.5rem auto 0;
	color: var(--imh-ink2);
}
.imh-seo__section { margin: 0 0 1.75rem; }
.imh-seo__section:last-child { margin-bottom: 0; }
.imh-seo__h2 {
	font-family: 'Archivo', system-ui, sans-serif;
	font-weight: 700;
	letter-spacing: -.02em;
	font-size: clamp(1.15rem, 2.4vw, 1.45rem);
	line-height: 1.18;
	color: var(--imh-ink);
	margin: 0 0 .7rem;
}
.imh-seo__body { font-size: .96rem; line-height: 1.62; }
.imh-seo__body p { margin: 0 0 .9rem; }
.imh-seo__body p:last-child { margin-bottom: 0; }
.imh-seo__body ul { margin: 0 0 .9rem; padding-left: 1.15rem; }
.imh-seo__body li { margin: 0 0 .45rem; }
.imh-seo__body strong { color: var(--imh-ink); font-weight: 600; }
.imh-seo__body code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: .88em;
	background: var(--imh-paper);
	border: 1px solid var(--imh-line);
	border-radius: 5px;
	padding: .1em .4em;
	color: var(--imh-navy);
}

/* FAQ accordion */
.imh-faq__item {
	border-bottom: 1px solid var(--imh-line);
}
.imh-faq__item:first-of-type { border-top: 1px solid var(--imh-line); }
.imh-faq__q {
	cursor: pointer;
	list-style: none;
	font-weight: 600;
	font-size: .98rem;
	color: var(--imh-ink);
	padding: 15px 36px 15px 2px;
	position: relative;
	transition: color .14s;
}
.imh-faq__q::-webkit-details-marker { display: none; }
.imh-faq__q:hover { color: var(--imh-navy); }
.imh-faq__q::after {
	content: "+";
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 1;
	color: var(--imh-gold-700);
}
.imh-faq__item[open] .imh-faq__q::after { content: "\2013"; }
.imh-faq__a {
	font-size: .94rem;
	line-height: 1.6;
	color: var(--imh-ink2);
	padding: 0 2px 16px;
}
.imh-faq__a p { margin: 0; }

/* ============================================================
   /narzedzia/ hub — card grid ([imh_narzedzia_hub])
   ============================================================ */
.imh-tools-hub {
	--imh-navy: var(--navy-700, #2C4FB0);
	--imh-navy-50: var(--navy-50, #EEF2FE);
	--imh-gold-700: var(--gold-700, #8A6A2E);
	--imh-ink: var(--fg-1, #16181D);
	--imh-ink2: var(--fg-2, #585B63);
	--imh-line: var(--line-1, #E8E8E6);
	font-family: 'Archivo', system-ui, -apple-system, sans-serif;
	max-width: 980px;
	margin: 1.5rem auto 0;
}
.imh-tools-hub__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
}
.imh-tools-card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--imh-line);
	border-radius: 14px;
	background: #fff;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(20,34,79,.05);
	transition: border-color .18s, box-shadow .18s, transform .18s;
}
.imh-tools-card:hover {
	border-color: var(--imh-navy);
	box-shadow: 0 1px 2px rgba(20,34,79,.05), 0 16px 32px -20px rgba(20,34,79,.28);
	transform: translateY(-2px);
}
.imh-tools-card__ico {
	flex: 0 0 auto;
	width: 42px; height: 42px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: var(--imh-navy-50);
	color: var(--imh-navy);
}
.imh-tools-card__ico svg { width: 21px; height: 21px; }
.imh-tools-card__body { flex: 1 1 auto; min-width: 0; }
.imh-tools-card__title {
	display: block;
	font-weight: 700;
	font-size: 1.02rem;
	letter-spacing: -.01em;
	color: var(--imh-ink);
	margin-bottom: 3px;
}
.imh-tools-card__desc {
	display: block;
	font-size: .86rem;
	line-height: 1.45;
	color: var(--imh-ink2);
}
.imh-tools-card__arrow {
	flex: 0 0 auto;
	color: var(--imh-gold-700);
	margin-top: 10px;
	transition: transform .18s;
}
.imh-tools-card__arrow svg { width: 18px; height: 18px; }
.imh-tools-card:hover .imh-tools-card__arrow { transform: translateX(3px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.imh-btn, .imh-field input, .imh-field select, .imh-schedule > summary, .imh-faq__q,
	.imh-tools-card, .imh-tools-card__arrow { transition: none; }
}
