/* Formularz wyceny etykiet – styl zgodny ze strefadrukarek.pl (Roboto, #333, pola 50 px, ramka #c4c7c8) */
.sdw {
	--sdw-text: #333;
	--sdw-muted: #747474;
	--sdw-placeholder: #a9acae;
	--sdw-border: #c4c7c8;
	--sdw-blue: #0090f6;
	--sdw-error: #e10404;
	--sdw-success: #10ac82;
	--sdw-yellow: #f9dd35;
	--sdw-yellow-hover: #f0cf12;
	--sdw-bg-soft: #f1f1f1;
	max-width: 760px;
	margin: 0 auto;
	color: var(--sdw-text);
	font-size: 1.4rem;
	line-height: 1.3;
}
.sdw *, .sdw *::before, .sdw *::after { box-sizing: border-box; }
.sdw [hidden] { display: none !important; }

.sdw-form fieldset { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
.sdw-legend {
	display: block;
	width: 100%;
	padding: 0 0 1rem;
	margin: 1rem 0 1.5rem;
	font-size: 1.8rem;
	font-weight: 600;
	color: var(--sdw-text);
	border-bottom: 1px solid var(--sdw-border);
}

.sdw-field { margin-bottom: 2rem; }
.sdw-field > label,
.sdw-label,
.sdw-other > label {
	display: block;
	margin-bottom: .7rem;
	font-size: 1.4rem;
	font-weight: 500;
	color: var(--sdw-text);
}
.sdw-req { color: var(--sdw-error); font-weight: 400; }
.sdw-opt { color: var(--sdw-muted); font-weight: 400; }

.sdw input[type="text"],
.sdw input[type="email"],
.sdw input[type="tel"],
.sdw select {
	display: block;
	width: 100%;
	height: 50px;
	padding: 6px 20px;
	font: inherit;
	font-size: 1.4rem;
	color: var(--sdw-text);
	background: #fff;
	border: 1px solid var(--sdw-border);
	border-radius: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.sdw input::placeholder { color: var(--sdw-placeholder); opacity: 1; }
.sdw input:focus,
.sdw select:focus {
	outline: 0;
	border-color: var(--sdw-blue);
	box-shadow: 0 0 0 3px rgba(0, 144, 246, .15);
}
.sdw [aria-invalid="true"] { border-color: var(--sdw-error) !important; }
.sdw [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(225, 4, 4, .12); }

/* Lista rozwijana ze strzałką */
.sdw-select { position: relative; }
.sdw-select::after {
	content: "";
	position: absolute;
	right: 20px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border: solid var(--sdw-blue);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	pointer-events: none;
}
.sdw select { padding-right: 50px; cursor: pointer; }
.sdw select:invalid,
.sdw select.is-empty { color: var(--sdw-placeholder); }
.sdw select option { color: var(--sdw-text); }

/* Jednostka „mm” w polu */
.sdw-suffix { position: relative; }
.sdw-suffix input { padding-right: 55px; }
.sdw-suffix span {
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sdw-muted);
	pointer-events: none;
}

.sdw-hint { margin: .6rem 0 0; font-size: 1.2rem; color: var(--sdw-muted); }
.sdw-error {
	margin: .6rem 0 0;
	font-size: 1.3rem;
	color: var(--sdw-error);
}
.sdw-error::before { content: "! "; font-weight: 700; }

/* Pole pojawiające się po wyborze „inne/inny” lub „Tak” */
.sdw-other {
	margin-top: 1.2rem;
	padding: 1.5rem 1.5rem 1.6rem;
	background: var(--sdw-bg-soft);
	border-left: 3px solid var(--sdw-blue);
	animation: sdw-in .2s ease-out;
}
@keyframes sdw-in { from { opacity: 0; transform: translateY(-4px); } }

/* Dwa pola obok siebie */
.sdw-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.sdw-other > .sdw-row > .sdw-field { margin-bottom: 0; }

/* Wymiary: pola po lewej, schemat po prawej */
.sdw-dims {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 220px;
	gap: 0 3rem;
	align-items: center;
	margin-bottom: 2rem;
}
.sdw-dims .sdw-field { margin-bottom: 0; }
.sdw-dims .sdw-row { align-self: center; }

/* Schemat wymiarów */
.sdw-diagram { margin: 0; width: 100%; max-width: 220px; text-align: center; justify-self: center; }
.sdw-diagram--circle { max-width: 140px; }
.sdw-diagram svg { display: block; width: 100%; height: auto; font-family: inherit; }
.sdw-diagram figcaption { margin-top: .8rem; font-size: 1.2rem; line-height: 1.35; color: var(--sdw-muted); }

/* Tak / Nie – dwa kwadratowe pola, można zaznaczyć tylko jedno */
.sdw-yesno { display: flex; gap: 3rem; }
.sdw-yesno .sdw-check { display: inline-flex; align-items: center; gap: 1rem; margin: 0; font-size: 1.4rem; cursor: pointer; }
.sdw-yesno input {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	background: #fff;
	border: 1px solid var(--sdw-border);
	border-radius: 0;
	cursor: pointer;
	display: grid;
	place-content: center;
	transition: border-color .15s, background-color .15s;
}
.sdw-yesno input::before {
	content: "";
	width: 6px;
	height: 11px;
	margin-top: -3px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform .1s;
}
.sdw-yesno input:checked { background: var(--sdw-blue); border-color: var(--sdw-blue); }
.sdw-yesno input:checked::before { transform: rotate(45deg) scale(1); }
.sdw-yesno input:hover { border-color: var(--sdw-blue); }
.sdw-yesno input:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(0, 144, 246, .25); }
.sdw-yesno input[aria-invalid="true"] { border-color: var(--sdw-error); }

/* Wybór pliku */
.sdw-upload__info { margin: 0 0 1rem; }
.sdw-drop {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 1rem;
	background: #fff;
	border: 1px dashed var(--sdw-border);
	cursor: pointer;
	transition: border-color .15s;
}
.sdw-drop:hover, .sdw-drop.is-over { border-color: var(--sdw-blue); }
.sdw-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sdw-drop__btn {
	flex: none;
	padding: 1rem 1.6rem;
	border: 1px solid var(--sdw-blue);
	color: var(--sdw-blue);
	font-weight: 500;
}
.sdw-drop__name { color: var(--sdw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdw-drop.has-file .sdw-drop__name { color: var(--sdw-text); font-weight: 500; }
.sdw-drop:has(input:focus-visible) { border-color: var(--sdw-blue); box-shadow: 0 0 0 3px rgba(0, 144, 246, .15); }
.sdw-upload.has-error .sdw-drop { border-color: var(--sdw-error); }

/* Zgoda */
.sdw-field > .sdw-check { display: flex; margin: 0; font-weight: 400; gap: 1.2rem; align-items: flex-start; cursor: pointer; font-size: 1.3rem; line-height: 1.45; }
.sdw-check input {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--sdw-blue);
	cursor: pointer;
}
.sdw-check a { color: var(--sdw-blue); }
.sdw-check a:hover { color: var(--sdw-text); }
.sdw-required-note { margin: 0 0 1.5rem; font-size: 1.2rem; color: var(--sdw-muted); }

/* Przyciski */
.sdw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .8rem;
	min-height: 50px;
	padding: 1.2rem 3rem;
	font: inherit;
	font-size: 1.6rem;
	font-weight: 500;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}
.sdw-btn--submit {
	min-width: 240px;
	background: var(--sdw-yellow);
	color: var(--sdw-text);
}
.sdw-btn--submit:hover { background: var(--sdw-yellow-hover); }
.sdw-btn--submit:focus-visible { outline: 3px solid var(--sdw-blue); outline-offset: 2px; }
.sdw-btn--submit[disabled] { opacity: .7; cursor: progress; }
.sdw-btn--submit.is-loading span::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 1rem;
	vertical-align: -2px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: sdw-spin .7s linear infinite;
}
@keyframes sdw-spin { to { transform: rotate(360deg); } }
.sdw-btn--blue { background: var(--sdw-blue); color: #fff; }
.sdw-btn--blue:hover { background: var(--sdw-text); color: #fff; }
.sdw-btn--outline { background: #fff; border-color: var(--sdw-blue); color: var(--sdw-blue); }
.sdw-btn--outline:hover { border-color: var(--sdw-text); color: var(--sdw-text); }

/* Komunikaty */
.sdw-alert {
	margin-bottom: 2rem;
	padding: 1.4rem 1.8rem;
	background: #fdeceb;
	border-left: 3px solid var(--sdw-error);
	color: var(--sdw-error);
}
.sdw-success {
	padding: 4rem 2rem;
	text-align: center;
	border: 1px solid var(--sdw-border);
	outline: 0;
	animation: sdw-in .25s ease-out;
}
.sdw-success__icon { width: 56px; height: 56px; color: var(--sdw-success); margin-bottom: 1.5rem; }
.sdw-success h2 { margin: 0 0 1.5rem; font-size: 2.2rem; font-weight: 600; color: var(--sdw-text); }
.sdw-success p { margin: 0 auto 1rem; max-width: 560px; font-size: 1.5rem; line-height: 1.5; }
.sdw-success__actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2.5rem !important; }
.sdw-success__actions .sdw-btn { font-size: 1.4rem; padding: 1rem 2rem; }

@media (max-width: 560px) {
	/* Marka i PN jeden pod drugim; wymiary zostają obok siebie */
	.sdw-other > .sdw-row { grid-template-columns: 1fr; }
	.sdw-other > .sdw-row > .sdw-field + .sdw-field { margin-top: 2rem; }
	.sdw-dims .sdw-row { gap: 0 1.2rem; }
	.sdw-dims .sdw-row label { min-height: 2.6em; }
}

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

@media (max-width: 756px) {
	.sdw-dims { grid-template-columns: 1fr; gap: 1.5rem; }
	.sdw-btn--submit { width: 100%; }
	.sdw-choice label { max-width: none; }
	.sdw input[type="text"], .sdw input[type="email"], .sdw input[type="tel"], .sdw select { font-size: 16px; } /* bez powiększania na iPhone */
}

/* Baner zgody na cookies (GA4) */
.sdw-cookie {
	--sdw-text: #333;
	--sdw-blue: #0090f6;
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 9999;
	max-width: 760px;
	margin: 0 auto;
	padding: 1.8rem 2rem;
	display: flex;
	gap: 1.5rem 2.4rem;
	align-items: center;
	background: #fff;
	color: #333;
	border: 1px solid #c4c7c8;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
	font-size: 1.4rem;
	line-height: 1.45;
}
.sdw-cookie[hidden] { display: none; }
.sdw-cookie p { margin: 0; }
.sdw-cookie a { color: var(--sdw-blue); }
.sdw-cookie__btns { display: flex; gap: 1rem; flex: none; }
.sdw-cookie .sdw-btn { min-height: 44px; padding: 1rem 2rem; font-size: 1.4rem; }
.sdw-cookie__title { display: none; }
.sdw-cookie-backdrop { display: none; }
@media (max-width: 640px) {
	.sdw-cookie { flex-direction: column; align-items: stretch; }
	.sdw-cookie__btns .sdw-btn { flex: 1 1 0; }
}
/* Komputer i tablet: okienko prawie na środku ekranu na przyciemnionym tle,
   żeby nikt nie zaczął wypełniać formularza, zanim wybierze zgody. */
@media (min-width: 768px) {
	.sdw-cookie-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 9998;
		background: rgba(0, 0, 0, .45);
	}
	.sdw-cookie-backdrop[hidden] { display: none; }
	.sdw-cookie {
		left: 50%;
		right: auto;
		top: 45%;
		bottom: auto;
		transform: translate(-50%, -50%);
		width: calc(100% - 48px);
		max-width: 560px;
		flex-direction: column;
		align-items: stretch;
		gap: 1.6rem;
		padding: 2.8rem 3.2rem;
		border: 0;
		border-radius: 8px;
		box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
		font-size: 1.5rem;
	}
	.sdw-cookie__title { display: block; font-size: 2rem; font-weight: 600; line-height: 1.3; color: #333; }
	.sdw-cookie__btns { justify-content: flex-end; }
	.sdw-cookie__btns .sdw-btn { min-width: 150px; }
}
