/* CPCN – pływający kontakt (mobile) */
:root {
	--cs-main: #234a8f;
	--cs-accent: #8fd8f2;
	--cs-ink: #14233f;
	--cs-muted: #5b6b85;
	--cs-line: #dfe6f1;
	--cs-bg: #ffffff;
	--cs-err: #b42318;
}

#cpcn-sticky[hidden],
#cpcn-sheet[hidden],
#cpcn-sheet [hidden] { display: none !important; }

html.cs-has-bar body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
html.cs-lock, html.cs-lock body { overflow: hidden; }

/* ---------- pasek ---------- */
.cs-bar {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 9990;
	display: grid;
	grid-template-columns: 1.6fr auto 1fr;
	gap: 8px;
	padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
	background: var(--cs-bg);
	box-shadow: 0 -4px 18px rgba(20, 35, 63, .12);
	font-family: inherit;
	transition: transform .2s ease, opacity .2s ease;
}
.cs-bar.cs-off { transform: translateY(110%); opacity: 0; pointer-events: none; }

.cs-btn {
	-webkit-appearance: none; appearance: none;
	display: flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 52px; padding: 6px 12px;
	border: 1.5px solid var(--cs-main);
	border-radius: 14px;
	background: #fff;
	color: var(--cs-main) !important;
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.1;
	text-decoration: none !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.cs-btn:active { transform: scale(.98); }
.cs-btn svg { width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }
.cs-btn:focus-visible { outline: 3px solid var(--cs-accent); outline-offset: 2px; }

.cs-call { flex-direction: column; gap: 2px; }
.cs-call svg { display: none; }
.cs-num { font-size: 12px; font-weight: 500; opacity: .85; white-space: nowrap; }
.cs-sms { padding: 6px 14px; }

/* W godzinach rejestracji: telefon na pierwszym planie */
.cs-bar[data-state="open"] .cs-call { background: var(--cs-main); color: #fff !important; }

/* Poza godzinami: formularz na pierwszym planie, telefon mniejszy */
.cs-bar[data-state="closed"] { grid-template-columns: auto auto 1fr; }
.cs-bar[data-state="closed"] .cs-call { padding: 6px 14px; }
.cs-bar[data-state="closed"] .cs-call .cs-lbl,
.cs-bar[data-state="closed"] .cs-call .cs-num { display: none; }
.cs-bar[data-state="closed"] .cs-call svg { display: block; }
.cs-bar[data-state="closed"] .cs-form { background: var(--cs-main); color: #fff !important; }
.cs-bar[data-state="closed"] .cs-form { flex-wrap: wrap; row-gap: 0; }
.cs-bar[data-state="closed"] .cs-form::after { content: "zostaw numer"; flex-basis: 100%; text-align: center; font-size: 12px; font-weight: 500; opacity: .85; }

@media (max-width: 359px) {
	.cs-num { display: none; }
	.cs-bar[data-state="closed"] .cs-form::after { content: none; }
}

/* ---------- panel z formularzem ---------- */
.cs-sheet { position: fixed; inset: 0; z-index: 9995; }
.cs-backdrop { position: absolute; inset: 0; background: rgba(20, 35, 63, .45); opacity: 0; transition: opacity .2s ease; }
.cs-panel {
	position: absolute; left: 0; right: 0; bottom: 0;
	max-height: 92vh; overflow-y: auto;
	padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
	background: var(--cs-bg);
	border-radius: 20px 20px 0 0;
	color: var(--cs-ink);
	transform: translateY(100%);
	transition: transform .22s ease;
	font-family: inherit;
}
.cs-sheet.cs-in .cs-backdrop { opacity: 1; }
.cs-sheet.cs-in .cs-panel { transform: translateY(0); }

.cs-x {
	position: absolute; top: 10px; right: 10px;
	width: 40px; height: 40px;
	border: 0; border-radius: 50%;
	background: #f1f4f9; color: var(--cs-ink);
	font-size: 24px; line-height: 1; cursor: pointer;
}
.cs-panel h2 { margin: 0 44px 4px 0; font-size: 20px; line-height: 1.25; color: var(--cs-main); }
.cs-sub { margin: 0 0 14px; font-size: 14px; color: var(--cs-muted); }

.cs-formel { display: grid; gap: 12px; margin: 0; }
.cs-formel label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--cs-ink); }
.cs-opt { font-weight: 400; color: var(--cs-muted); }
.cs-formel input[type="text"],
.cs-formel input[type="tel"],
.cs-formel select {
	width: 100%; box-sizing: border-box;
	min-height: 48px; padding: 10px 12px;
	border: 1.5px solid var(--cs-line); border-radius: 12px;
	background: #fff; color: var(--cs-ink);
	font: inherit; font-size: 16px; font-weight: 400; /* 16px = brak zoomu na iOS */
}
.cs-formel input:focus,
.cs-formel select:focus { outline: none; border-color: var(--cs-main); box-shadow: 0 0 0 3px rgba(143, 216, 242, .55); }

.cs-consent { grid-template-columns: 22px 1fr !important; align-items: start; gap: 8px !important; font-weight: 400 !important; font-size: 12.5px !important; color: var(--cs-muted) !important; }
.cs-consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cs-main); }
.cs-consent a { color: var(--cs-main); }

.cs-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.cs-err { margin: 0; padding: 8px 10px; border-radius: 10px; background: #fdecea; color: var(--cs-err); font-size: 14px; }

.cs-submit {
	min-height: 52px; border: 0; border-radius: 14px;
	background: var(--cs-main); color: #fff;
	font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.cs-submit:disabled { opacity: .6; }

.cs-ok { padding: 8px 0 4px; font-size: 15px; }
.cs-ok-h { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--cs-main); }

@media (prefers-reduced-motion: reduce) {
	.cs-bar, .cs-panel, .cs-backdrop { transition: none; }
}
