/* =========================================================
   MODUŁ: Formularz konsultacji
   ========================================================= */

.sp-form {
	/* Default fallbacks — nadpisywane inline z PHP */
	--spfm-font:         'Inter', sans-serif;
	--spfm-size-tytul:   28px;
	--spfm-size-label:   14px;
	--spfm-size-input:   16px;
	--spfm-size-cta:     17px;
	--spfm-max-width:    560px;
	--spfm-padding:      40px;
	--spfm-radius:       20px;
	--spfm-pole-radius:  12px;
	--spfm-bg:           #FFFFFF;
	--spfm-tytul:        #1A2540;
	--spfm-opis:         #5A5A5A;
	--spfm-label:        #1A2540;
	--spfm-input-bg:     #F8F3E0;
	--spfm-input-text:   #1A2540;
	--spfm-input-border: #E8DFCB;
	--spfm-input-focus:  #D4A017;
	--spfm-ikona:        #D4A017;
	--spfm-cta-bg:       #D4A017;
	--spfm-cta-text:     #FFFFFF;
	--spfm-sukces:       #E8F5E9;
	--spfm-blad:         #FFEBEE;

	font-family: var(--spfm-font);
	background: var(--spfm-bg);
	border-radius: var(--spfm-radius);
	padding: var(--spfm-padding);
	max-width: var(--spfm-max-width);
	margin: 0 auto;
	box-shadow: 0 20px 60px rgba(26,37,64,.10);
	border: 1px solid rgba(26,37,64,.06);
}
.sp-form * { box-sizing: border-box; }

/* ===== HEADER ===== */
.sp-form__head { text-align: center; margin-bottom: 1.75rem; }
.sp-form__tytul {
	font-size: var(--spfm-size-tytul);
	color: var(--spfm-tytul);
	font-weight: 800;
	margin: 0 0 .5em;
	line-height: 1.2;
	letter-spacing: -0.01em;
}
.sp-form__opis {
	color: var(--spfm-opis);
	font-size: 15px;
	margin: 0;
	line-height: 1.5;
}

/* ===== POLA ===== */
.sp-form__fields {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.sp-form__field { display: flex; flex-direction: column; gap: .35em; }

.sp-form__label {
	color: var(--spfm-label);
	font-size: var(--spfm-size-label);
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
}
.sp-form__req { color: var(--spfm-input-focus); }

.sp-form__input-wrap {
	position: relative;
	display: flex;
	align-items: stretch;
}
.sp-form__input-wrap--with-icon { padding-left: 0; }

.sp-form__icon {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--spfm-ikona);
	pointer-events: none;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
}
.sp-form__icon svg { width: 22px; height: 22px; display: block; }

.sp-form__field--textarea .sp-form__icon {
	top: 20px;
	transform: none;
}

.sp-form input[type="text"],
.sp-form input[type="email"],
.sp-form input[type="tel"],
.sp-form input[type="number"],
.sp-form textarea,
.sp-form select {
	width: 100%;
	font-family: inherit;
	font-size: var(--spfm-size-input);
	color: var(--spfm-input-text);
	background: var(--spfm-input-bg);
	border: 1.5px solid var(--spfm-input-border);
	border-radius: var(--spfm-pole-radius);
	padding: 0.85em 1em;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
	line-height: 1.4;
}
/* Padding-left z !important — nadpisuje wszystkie style motywu (Astra, Hello, etc.) */
.sp-form .sp-form__input-wrap--with-icon input,
.sp-form .sp-form__input-wrap--with-icon input[type="text"],
.sp-form .sp-form__input-wrap--with-icon input[type="email"],
.sp-form .sp-form__input-wrap--with-icon input[type="tel"],
.sp-form .sp-form__input-wrap--with-icon input[type="number"],
.sp-form .sp-form__input-wrap--with-icon textarea,
.sp-form .sp-form__input-wrap--with-icon select {
	padding-left: 60px !important;
}

.sp-form input:focus,
.sp-form textarea:focus,
.sp-form select:focus {
	outline: none;
	border-color: var(--spfm-input-focus);
	box-shadow: 0 0 0 4px rgba(212,160,23,.15);
	background: #fff;
}
.sp-form input::placeholder,
.sp-form textarea::placeholder {
	color: #9ca3af;
	opacity: 1;
}

.sp-form textarea {
	resize: vertical;
	min-height: 110px;
}

.sp-form select {
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D4A017' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
	background-position: right 14px center;
	background-repeat: no-repeat;
	background-size: 18px;
	padding-right: 42px;
}

/* ===== GDPR ===== */
.sp-form__rodo {
	display: flex;
	gap: .65em;
	align-items: flex-start;
	margin: 1.25rem 0 0;
	font-size: 13px;
	color: var(--spfm-opis);
	line-height: 1.4;
	cursor: pointer;
}
.sp-form__rodo input[type="checkbox"] {
	width: 18px; height: 18px;
	margin-top: 2px;
	flex-shrink: 0;
	accent-color: var(--spfm-input-focus);
	cursor: pointer;
}
.sp-form__rodo a {
	color: var(--spfm-input-focus);
	text-decoration: underline;
}

/* ===== HONEYPOT ===== */
.sp-form__honeypot {
	position: absolute;
	left: -9999px;
	opacity: 0;
	height: 0;
	width: 0;
	pointer-events: none;
}

/* ===== CTA ===== */
.sp-form__cta {
	margin-top: 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	width: 100%;
	padding: 1em 1.4em;
	background: var(--spfm-cta-bg);
	color: var(--spfm-cta-text);
	border: none;
	border-radius: var(--spfm-pole-radius);
	font-family: inherit;
	font-weight: 700;
	font-size: var(--spfm-size-cta);
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
	box-shadow: 0 8px 20px rgba(212,160,23,.30);
}
.sp-form__cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(212,160,23,.40);
	filter: brightness(1.05);
}
.sp-form__cta[disabled] {
	opacity: 0.7;
	cursor: wait;
	transform: none;
}

/* ===== MSG ===== */
.sp-form__msg {
	margin-top: 1rem;
	padding: 0;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
}
.sp-form__msg:empty { display: none; }
.sp-form__msg--sukces {
	background: var(--spfm-sukces);
	color: #2E7D32;
	padding: .85em 1.1em;
	border: 1px solid rgba(46,125,50,.25);
}
.sp-form__msg--blad {
	background: var(--spfm-blad);
	color: #C62828;
	padding: .85em 1.1em;
	border: 1px solid rgba(198,40,40,.25);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
	.sp-form {
		--spfm-padding: 24px;
		--spfm-size-tytul: 22px;
		border-radius: 16px;
	}
}
