/*
 * FM Expert Modern — style motywu.
 * Paleta sprawdzona pod kontrast WCAG 2.2 AA (tekst ≥ 4,5:1).
 */

:root {
	--ink: #182430;
	--muted: #44566a;
	--bg: #ffffff;
	--bg-alt: #f2f6fa;
	--line: #d9e2ea;
	--primary: #12395e;
	--primary-strong: #0b2843;
	--accent: #b45309;
	--accent-strong: #8f3f05;
	--link: #0e4d7e;
	--focus: #b45309;
	--radius: 14px;
	--shadow: 0 10px 30px rgba(11, 40, 67, 0.10);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--ink);
	background: var(--bg);
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; color: var(--primary-strong); }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.18rem; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }

/* Fokus klawiatury — wyraźny na każdym tle (WCAG 2.4.7 / 2.4.11). */
:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: 4px;
}
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible {
	outline-color: #ffb45e;
}

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	clip: rect(0 0 0 0); clip-path: inset(50%);
	overflow: hidden; white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: 1rem; top: -100%;
	z-index: 100;
	padding: 0.7rem 1.2rem;
	background: var(--primary-strong);
	color: #fff;
	border-radius: 0 0 10px 10px;
	transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

.container { max-width: 74rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.container--narrow { max-width: 50rem; }

/* ---------- Nagłówek ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--primary-strong);
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header__inner {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: clamp(1rem, 2.5vw, 2.5rem);
	min-height: 76px;
	padding-block: 0.6rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: #fff; white-space: nowrap; }
.brand__mark {
	display: grid; place-items: center;
	width: 44px; height: 44px;
	background: var(--accent);
	border-radius: 10px;
	color: #fff;
}
.brand__mark svg { width: 26px; height: 26px; }
.brand__name { display: block; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand__name span { color: #ffb45e; }
.brand__tag { display: block; font-size: 0.72rem; opacity: 0.85; }

.primary-nav { flex: 0 1 auto; }
.primary-nav ul { display: flex; gap: clamp(0.6rem, 1.6vw, 1.4rem); list-style: none; margin: 0; padding: 0; }
.primary-nav a {
	display: inline-block;
	padding: 0.55rem 0.35rem;
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
}
.primary-nav a:hover { color: #ffb45e; border-bottom-color: #ffb45e; }

.header-cta { display: flex; align-items: center; gap: 0.9rem; margin-left: auto; }
.header-phone { display: inline-flex; align-items: center; gap: 0.45rem; color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.header-phone svg { width: 19px; height: 19px; }
.header-phone:hover { color: #ffb45e; }

.btn {
	display: inline-block;
	padding: 0.72rem 1.35rem;
	border-radius: 10px;
	font-weight: 700;
	text-decoration: none;
	border: 2px solid transparent;
	cursor: pointer;
	font-size: 1rem;
	white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-strong); color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn--ghost:hover { border-color: #ffb45e; color: #ffb45e; }

.nav-toggle {
	display: none;
	background: transparent;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-radius: 10px;
	color: #fff;
	width: 46px; height: 46px;
	padding: 0.45rem;
	cursor: pointer;
}
.nav-toggle svg { width: 100%; height: 100%; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.header-phone__text { display: none; }
	.header-cta .btn { display: none; }
	.primary-nav {
		display: none;
		position: absolute;
		inset: 100% 0 auto 0;
		background: var(--primary-strong);
		border-bottom: 1px solid rgba(255, 255, 255, 0.15);
		padding: 0.5rem 1rem 1rem;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; gap: 0; }
	.primary-nav a { display: block; padding: 0.8rem 0.4rem; font-size: 1.05rem; }
}

/* ---------- Hero ---------- */

.hero {
	background:
		linear-gradient(115deg, rgba(11, 40, 67, 0.97) 0%, rgba(18, 57, 94, 0.94) 55%, rgba(14, 77, 126, 0.92) 100%),
		repeating-linear-gradient(-45deg, #0b2843 0 26px, #0e3050 26px 52px);
	color: #fff;
	padding-block: clamp(3rem, 8vw, 5.5rem);
}
.hero__inner { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero__kicker { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; font-size: 0.82rem; color: #ffb45e; margin-bottom: 0.6rem; }
.hero h1 { color: #fff; margin: 0 0 0.6em; }
.hero__lead { font-size: 1.13rem; max-width: 34rem; color: #e4ecf4; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

.hero__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.hero__points li {
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius);
	padding: 0.95rem 1.15rem;
}
.hero__points strong { display: block; font-size: 1.02rem; }
.hero__points span { color: #cfdbe7; font-size: 0.92rem; }

@media (max-width: 860px) {
	.hero__inner { grid-template-columns: 1fr; }
}

/* ---------- Sekcje ---------- */

.section { padding-block: clamp(2.8rem, 7vw, 4.8rem); }
.section--alt { background: var(--bg-alt); }
.section__title { margin-top: 0; }
.section__lead { color: var(--muted); max-width: 44rem; margin-bottom: 2rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem; }
.card {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.5rem 1.4rem;
}
.card__icon {
	display: grid; place-items: center;
	width: 52px; height: 52px;
	border-radius: 12px;
	background: var(--bg-alt);
	color: var(--primary);
	margin-bottom: 0.9rem;
}
.card__icon svg { width: 30px; height: 30px; }
.card h3 { margin: 0 0 0.6rem; }
.card ul { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.card li { margin-bottom: 0.45rem; }

.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.benefit {
	background: var(--bg);
	border-left: 4px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	box-shadow: var(--shadow);
	padding: 1.3rem 1.3rem 0.6rem;
}
.benefit h3 { margin-top: 0; }
.benefit p { color: var(--muted); }

/* ---------- Wpisy ---------- */

.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.4rem; }
.post-card {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.35rem 1.3rem;
	display: flex;
	flex-direction: column;
}
.post-card h2, .post-card h3 { margin: 0 0 0.4rem; font-size: 1.14rem; }
.post-card h2 a, .post-card h3 a { text-decoration: none; color: var(--primary-strong); }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--accent-strong); text-decoration: underline; }
.post-card__meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.7rem; }
.post-card p:last-of-type { color: var(--muted); }
.post-card__more { margin-top: auto; font-weight: 700; }

.article__meta { color: var(--muted); }
.article__notice {
	background: #fdf3e7;
	border: 1px solid #ecc89a;
	border-left: 4px solid var(--accent);
	border-radius: 10px;
	padding: 0.85rem 1.1rem;
	color: #6b4a1b;
}
.article__content { font-size: 1.08rem; }
.article__content p { margin-bottom: 1.15em; }

.breadcrumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 1.4rem; display: flex; gap: 0.5rem; }

/* ---------- Kontakt / formularz ---------- */

.section--contact { background: var(--bg-alt); }
.contact__grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(2rem, 5vw, 4rem); }
@media (max-width: 860px) { .contact__grid { grid-template-columns: 1fr; } }

.contact__details p { margin-bottom: 0.4em; font-style: normal; }
.contact__details { font-style: normal; font-size: 1.08rem; }

.contact-form {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.6rem 1.5rem;
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="email"], .field textarea {
	width: 100%;
	padding: 0.7rem 0.85rem;
	border: 1.5px solid #9fb0bf;
	border-radius: 9px;
	font: inherit;
	color: var(--ink);
	background: #fff;
}
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b3261e; }
.field__error { color: #b3261e; font-weight: 600; margin: 0.3rem 0 0; }
.field__hint { color: var(--muted); font-size: 0.9rem; margin-top: -0.4rem; }
.field--consent { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; }
.field--consent input { width: 22px; height: 22px; margin-top: 0.2rem; }
.field--consent label { font-weight: 400; }

.form-status { border-radius: 10px; padding: 0.9rem 1.1rem; font-weight: 600; }
.form-status--ok { background: #e7f3ea; border: 1px solid #9fc9ab; color: #1d5230; }
.form-status--err { background: #fdecea; border: 1px solid #e5a39d; color: #8c1d18; }

.hp-field { position: absolute !important; left: -9999px; }

/* ---------- Stopka ---------- */

.site-footer { background: var(--primary-strong); color: #d9e4ee; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffb45e; }
.site-footer__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem;
	padding-block: 2.6rem 1.6rem;
}
.site-footer h2 { color: #fff; font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer address { font-style: normal; }
.site-footer address p { margin-bottom: 0.35em; }
.site-footer__brand { font-weight: 800; font-size: 1.3rem; color: #fff; margin-top: 0; }
.site-footer__brand span { color: #ffb45e; }
.site-footer__legal {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.8rem;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding-block: 1rem;
	font-size: 0.92rem;
}
.site-footer__legal ul { display: flex; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }

.pagination { margin-top: 2rem; }

/* ---------- Preferencje systemowe ---------- */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   PANEL DOSTĘPNOŚCI — reguły sterowane klasami na <html>
   (ustawia je assets/js/a11y-widget.js, zapis w localStorage)
   ============================================================ */

/* Rozmiar tekstu (rem-y w całym arkuszu skalują się od html). */
html.a11y-font-1 { font-size: 112.5%; }
html.a11y-font-2 { font-size: 125%; }
html.a11y-font-3 { font-size: 140%; }

/* Wysokość linii. */
html.a11y-lineheight body { line-height: 2.05; }
html.a11y-lineheight p, html.a11y-lineheight li { margin-bottom: 1.2em; }

/* Odstępy między znakami i wyrazami (WCAG 1.4.12). */
html.a11y-spacing body { letter-spacing: 0.09em; word-spacing: 0.18em; }

/* Wyśrodkowanie tekstu. */
html.a11y-center main :is(h1, h2, h3, p, .section__lead) { text-align: center; }
html.a11y-center main ul { text-align: left; }

/* Czytelniejsza czcionka. */
html.a11y-readable body,
html.a11y-readable button,
html.a11y-readable input,
html.a11y-readable textarea { font-family: Verdana, Arial, Helvetica, sans-serif; }

/* Podświetlenie odnośników. */
html.a11y-underline main a, html.a11y-underline .site-footer a {
	text-decoration: underline !important;
	text-decoration-thickness: 2px;
	background: #fff3bf;
	color: #123a63 !important;
	padding-inline: 0.15em;
	border-radius: 3px;
}

/* Podświetlenie nagłówków. */
html.a11y-headings :is(h1, h2, h3, h4, h5, h6) {
	background: #fff3bf;
	color: #182430 !important;
	outline: 2px dashed #8f3f05;
	outline-offset: 3px;
	padding-inline: 0.15em;
	width: fit-content;
}
html.a11y-headings .hero h1 { width: auto; }

/* Ukrycie obrazów. */
html.a11y-no-images main img,
html.a11y-no-images main figure,
html.a11y-no-images .card__icon,
html.a11y-no-images .hero { background-image: none; }
html.a11y-no-images main img, html.a11y-no-images main figure { display: none !important; }
html.a11y-no-images .hero { background: var(--primary-strong); }

/* Zatrzymanie animacji i płynnego przewijania. */
html.a11y-no-motion, html.a11y-no-motion * { scroll-behavior: auto !important; }
html.a11y-no-motion *, html.a11y-no-motion *::before, html.a11y-no-motion *::after {
	animation: none !important;
	transition: none !important;
}

/* Powiększony kursor. */
html.a11y-big-cursor, html.a11y-big-cursor body, html.a11y-big-cursor a, html.a11y-big-cursor button, html.a11y-big-cursor input, html.a11y-big-cursor textarea, html.a11y-big-cursor label {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 24 24"><path d="M4 2l16 11-7 1 4 7-3 2-4-7-5 5z" fill="black" stroke="white" stroke-width="1.4"/></svg>') 4 2, auto !important;
}

/* Skala szarości / obniżone nasycenie — filtr na sekcjach, nie na body,
   żeby nie psuć position:fixed przycisku panelu. */
html.a11y-grayscale :is(.site-header, main, .site-footer) { filter: grayscale(1); }
html.a11y-desaturate :is(.site-header, main, .site-footer) { filter: saturate(0.35); }
html.a11y-grayscale.a11y-desaturate :is(.site-header, main, .site-footer) { filter: grayscale(1); }

/* Wysoki kontrast (tryb ciemny o wzmocnionym kontraście). */
html.a11y-contrast {
	--ink: #ffffff;
	--muted: #e8eef4;
	--bg: #000000;
	--bg-alt: #0a0a0a;
	--line: #6b7a88;
	--primary: #0a0a0a;
	--primary-strong: #000000;
	--accent: #ffb000;
	--accent-strong: #ffc94d;
	--link: #7fd0ff;
	--focus: #ffff00;
	--shadow: none;
}
html.a11y-contrast body { background: #000; color: #fff; }
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3 { color: #fff; }
html.a11y-contrast .site-header, html.a11y-contrast .site-footer { border-color: #6b7a88; }
html.a11y-contrast .hero { background: #000; border-block: 1px solid #6b7a88; }
html.a11y-contrast .hero__lead, html.a11y-contrast .hero__points span { color: #e8eef4; }
html.a11y-contrast .hero__kicker { color: #ffb000; }
html.a11y-contrast .card, html.a11y-contrast .post-card, html.a11y-contrast .benefit, html.a11y-contrast .contact-form { background: #000; border-color: #6b7a88; }
html.a11y-contrast .card ul, html.a11y-contrast .post-card p:last-of-type, html.a11y-contrast .benefit p { color: #e8eef4; }
html.a11y-contrast .btn--primary, html.a11y-contrast .btn--accent { background: #ffb000; color: #000; }
html.a11y-contrast .btn--primary:hover, html.a11y-contrast .btn--accent:hover { background: #ffc94d; color: #000; }
html.a11y-contrast .brand__mark { background: #ffb000; color: #000; }
html.a11y-contrast .brand__name span, html.a11y-contrast .site-footer__brand span { color: #ffb000; }
html.a11y-contrast .field input, html.a11y-contrast .field textarea { background: #000; color: #fff; border-color: #9fb0bf; }
html.a11y-contrast .article__notice { background: #1a1200; border-color: #ffb000; color: #ffe1a3; }
html.a11y-contrast .form-status--ok { background: #00230d; color: #9fe0b3; }
html.a11y-contrast .form-status--err { background: #2b0300; color: #ffb4ab; }
html.a11y-contrast .card__icon { background: #1a1a1a; color: #7fd0ff; }

/* Czytnik ekranu (TTS) — podświetlenie czytanego / wskazywanego bloku. */
html.a11y-tts main :is(p, h1, h2, h3, li, a):hover { outline: 3px dashed #b45309; outline-offset: 2px; cursor: pointer; }
.a11y-tts-reading { outline: 3px solid #b45309 !important; background: #fff3bf; color: #182430 !important; }
html.a11y-contrast .a11y-tts-reading { background: #332600; color: #fff !important; }

/* ---------- Widget: przycisk + panel ---------- */

.a11y-fab {
	position: fixed;
	right: 1.1rem; bottom: 1.1rem;
	z-index: 200;
	display: inline-flex; align-items: center; gap: 0.5rem;
	padding: 0.7rem 1.05rem;
	border: 2px solid #fff;
	border-radius: 999px;
	background: var(--primary);
	color: #fff;
	font: inherit; font-weight: 700; font-size: 0.98rem;
	box-shadow: 0 6px 22px rgba(11, 40, 67, 0.35);
	cursor: pointer;
}
.a11y-fab svg { width: 22px; height: 22px; }
.a11y-fab:hover { background: var(--accent-strong); }
html.a11y-contrast .a11y-fab { background: #ffb000; color: #000; border-color: #000; }

.a11y-panel {
	position: fixed;
	right: 1.1rem; bottom: 4.6rem;
	z-index: 201;
	width: min(23.5rem, calc(100vw - 2rem));
	max-height: min(80vh, 40rem);
	overflow: auto;
	background: var(--bg);
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 18px 50px rgba(11, 40, 67, 0.30);
	padding: 1rem 1.1rem 1.2rem;
}
html.a11y-contrast .a11y-panel { border-color: #9fb0bf; }

.a11y-panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.a11y-panel__head h2 { margin: 0; font-size: 1.15rem; }
.a11y-panel__close {
	background: transparent; border: 0; cursor: pointer;
	font-size: 1.7rem; line-height: 1; color: var(--muted);
	padding: 0.2rem 0.5rem; border-radius: 8px;
}
.a11y-panel__close:hover { color: var(--accent-strong); }

.a11y-group { margin-bottom: 0.9rem; }
.a11y-group__label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 0.45rem; }

.a11y-fontbtns { display: flex; align-items: center; gap: 0.6rem; }
.a11y-fontlevel { min-width: 5.5rem; text-align: center; font-weight: 600; color: var(--muted); }

.a11y-btn {
	font: inherit; font-size: 0.93rem; font-weight: 600;
	background: var(--bg-alt);
	color: var(--ink);
	border: 1.5px solid var(--line);
	border-radius: 10px;
	padding: 0.55rem 0.8rem;
	cursor: pointer;
	text-align: left;
	min-height: 44px; /* WCAG 2.5.8 — cel dotykowy */
}
.a11y-btn:hover { border-color: var(--accent); }
.a11y-btn--sq { min-width: 52px; text-align: center; font-weight: 800; }
.a11y-btn--toggle { position: relative; padding-left: 2.15rem; }
.a11y-btn--toggle::before {
	content: "";
	position: absolute; left: 0.7rem; top: 50%;
	translate: 0 -50%;
	width: 0.95rem; height: 0.95rem;
	border: 2px solid var(--muted);
	border-radius: 4px;
	background: var(--bg);
}
.a11y-btn--toggle[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.a11y-btn--toggle[aria-pressed="true"]::before {
	background: var(--accent);
	border-color: #fff;
	content: "";
}
html.a11y-contrast .a11y-btn--toggle[aria-pressed="true"] { background: #ffb000; color: #000; border-color: #fff; }

.a11y-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media (max-width: 420px) { .a11y-toggles { grid-template-columns: 1fr; } }

.a11y-btn--reset { width: 100%; text-align: center; background: var(--bg); border-color: var(--muted); }
.a11y-btn--reset:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.a11y-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
