/*
 * Formularis de pressupost de Zero Brossa.
 * Hereta els colors del tema; els fallbacks són per si el plugin s'usa sol.
 */

.zbp {
	--zbp-blau: var(--zb-blau, #2e6b85);
	--zbp-verd: var(--zb-verd, #6fa945);
	--zbp-fosc: var(--zb-fosc, #1d2b33);
	--zbp-suau: var(--zb-suau, #f4f4f1);
	--zbp-vora: var(--zb-vora, #dfe2df);
	--zbp-gris: var(--zb-gris, #667079);

	max-width: 44rem;
	margin-inline: auto;
	color: var(--zbp-fosc);
	font-size: 1rem;
	line-height: 1.6;
}

/* ---------------------------------------------------------------- passos */

.zbp-step {
	border: 1px solid var(--zbp-vora);
	border-radius: 14px;
	padding: 1.5rem;
	margin-bottom: 1.25rem;
	background: #fff;
}

.zbp-step__title {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin: 0 0 1rem;
	font-size: 1.2rem;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.zbp-step__title > span:first-child {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	background: var(--zbp-blau);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 700;
}

.zbp-lead {
	margin: -0.4rem 0 1rem;
	color: var(--zbp-gris);
	font-size: 0.94rem;
}

.zbp-lead--sota {
	margin: 0.9rem 0 0;
}

.zbp .zbp-field--data input {
	max-width: 16rem;
}

/* --------------------------------------------------------------- camps */

.zbp-grid {
	display: grid;
	gap: 1rem 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.zbp-field {
	margin: 0 0 0.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.zbp-field label {
	font-weight: 600;
	font-size: 0.92rem;
}

.zbp-req {
	color: var(--zbp-verd);
}

.zbp .zbp-field input[type="text"],
.zbp .zbp-field input[type="email"],
.zbp .zbp-field input[type="tel"],
.zbp .zbp-field input[type="number"],
.zbp .zbp-field select,
.zbp .zbp-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--zbp-vora);
	border-radius: 9px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.4;
}

.zbp .zbp-field input:focus-visible,
.zbp .zbp-field select:focus-visible,
.zbp .zbp-field textarea:focus-visible {
	outline: 2px solid var(--zbp-blau);
	outline-offset: 1px;
	border-color: var(--zbp-blau);
}

.zbp-help {
	color: var(--zbp-gris);
	font-size: 0.83rem;
	line-height: 1.5;
}

.zbp-help--center {
	text-align: center;
	display: block;
	margin-top: 0.6rem;
}

/* ------------------------------------------------- vegetació i arbres */

.zbp-veg {
	display: grid;
	gap: 0.6rem;
}

.zbp-veg__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--zbp-vora);
	border-radius: 11px;
	background: var(--zbp-suau);
	cursor: text;
}

.zbp-veg__item:focus-within {
	border-color: var(--zbp-blau);
	background: #fff;
}

.zbp-veg__head {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.zbp-veg__name {
	font-weight: 650;
	font-size: 0.97rem;
}

.zbp-veg__desc {
	color: var(--zbp-gris);
	font-size: 0.84rem;
	line-height: 1.45;
}

.zbp-veg__input {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.9rem;
	color: var(--zbp-gris);
}

.zbp .zbp-veg__input input {
	width: 6rem;
	padding: 0.55rem 0.6rem;
	border: 1px solid var(--zbp-vora);
	border-radius: 8px;
	background: #fff;
	font: inherit;
	font-weight: 600;
	text-align: end;
	color: var(--zbp-fosc);
}

/* ------------------------------------------------------------- targetes */

.zbp-cards {
	display: grid;
	gap: 0.6rem;
	grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
	margin-bottom: 1rem;
}

.zbp-cards--wide {
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.zbp-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3rem;
	padding: 0.9rem 0.7rem;
	border: 1px solid var(--zbp-vora);
	border-radius: 11px;
	background: #fff;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.12s, background 0.12s;
}

.zbp-card--text {
	align-items: flex-start;
	text-align: start;
}

.zbp-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.zbp-card:hover {
	border-color: var(--zbp-blau);
}

.zbp-card:has(input:checked) {
	border-color: var(--zbp-blau);
	background: #eef4f7;
	box-shadow: inset 0 0 0 1px var(--zbp-blau);
}

.zbp-card:has(input:focus-visible) {
	outline: 2px solid var(--zbp-blau);
	outline-offset: 2px;
}

.zbp-card__ico {
	font-size: 1.5rem;
	line-height: 1;
}

.zbp-card__name {
	font-weight: 650;
	font-size: 0.95rem;
}

.zbp-card__desc {
	color: var(--zbp-gris);
	font-size: 0.82rem;
	line-height: 1.45;
}

/* ------------------------------------------------------------ casselles */

.zbp-check {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin-top: 0.9rem;
	font-size: 0.93rem;
	line-height: 1.5;
	cursor: pointer;
}

.zbp-check input {
	flex: 0 0 auto;
	margin-top: 0.25rem;
	width: 1.05rem;
	height: 1.05rem;
	accent-color: var(--zbp-blau);
}

.zbp-check--big {
	padding: 0.9rem 1rem;
	border: 1px solid var(--zbp-vora);
	border-radius: 11px;
	background: var(--zbp-suau);
}

.zbp-check--big:has(input:checked) {
	border-color: var(--zbp-blau);
	background: #eef4f7;
}

.zbp-check--big span strong {
	display: block;
}

.zbp-check--big span em {
	display: block;
	margin-top: 0.15rem;
	color: var(--zbp-gris);
	font-size: 0.85rem;
	font-style: normal;
}

/* ------------------------------------------------------------- fitxers */

.zbp-file input[type="file"] {
	width: 100%;
	box-sizing: border-box;
	padding: 0.75rem;
	border: 1px dashed var(--zbp-vora);
	border-radius: 10px;
	background: var(--zbp-suau);
	font: inherit;
	font-size: 0.88rem;
	cursor: pointer;
}

.zbp-file__list {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
	color: var(--zbp-gris);
}

.zbp-file__list li {
	display: flex;
	justify-content: space-between;
	gap: 0.8rem;
	padding: 0.25rem 0;
	border-bottom: 1px solid var(--zbp-vora);
}

.zbp-file__list li[data-error] {
	color: #b3261e;
}

/* --------------------------------------------------------------- avís */

.zbp-note {
	margin-top: 1rem;
	padding: 0.9rem 1rem;
	border-inline-start: 4px solid var(--zbp-verd);
	border-radius: 8px;
	background: #f2f7f4;
	font-size: 0.88rem;
	line-height: 1.6;
}

.zbp-errors {
	margin-bottom: 1.25rem;
	padding: 1rem 1.2rem;
	border-inline-start: 4px solid #b3261e;
	border-radius: 8px;
	background: #fdeceb;
	font-size: 0.92rem;
}

.zbp-errors ul {
	margin: 0.4rem 0 0;
	padding-inline-start: 1.2rem;
}

/* --------------------------------------------------------------- botó */

.zbp .zbp-submit {
	display: block;
	width: 100%;
	margin-top: 1.4rem;
	padding: 1rem 1.5rem;
	border: 0;
	border-radius: 11px;
	background: var(--zbp-verd);
	color: #fff;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.12s;
}

.zbp .zbp-submit:hover {
	filter: brightness(1.06);
}

.zbp .zbp-submit:focus-visible {
	outline: 3px solid var(--zbp-blau);
	outline-offset: 2px;
}

.zbp .zbp-submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* --------------------------------------------------------------- honeypot */

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

/* --------------------------------------------------------------- gràcies */

.zbp-gracies {
	padding: 2.25rem;
	border: 1px solid var(--zbp-vora);
	border-radius: 16px;
	background: #fff;
	text-align: center;
}

.zbp-gracies__eyebrow {
	margin: 0;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--zbp-gris);
}


.zbp-gracies__titol {
	margin: 0.4rem 0 0;
	font-size: clamp(1.5rem, 4.5vw, 2.1rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--zbp-blau);
}

.zbp-gracies__iva,
.zbp-gracies__motiu {
	margin: 0.4rem 0 0;
	color: var(--zbp-gris);
	font-size: 0.9rem;
}

.zbp-gracies__lines {
	margin: 1.6rem 0 0;
	padding: 0;
	list-style: none;
	text-align: start;
}

.zbp-gracies__lines li {
	display: flex;
	justify-content: space-between;
	gap: 1.2rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--zbp-vora);
}

.zbp-gracies__lines em {
	display: block;
	color: var(--zbp-gris);
	font-size: 0.85rem;
	font-style: normal;
	line-height: 1.45;
}

.zbp-gracies__lines b {
	white-space: nowrap;
}

.zbp-gracies__next {
	margin: 1.5rem 0 0;
	font-size: 0.98rem;
	line-height: 1.6;
}

.zbp-gracies__tel {
	margin: 1rem 0 0;
	font-size: 0.92rem;
	color: var(--zbp-gris);
}

.zbp-gracies__tel a {
	color: var(--zbp-blau);
	font-weight: 700;
}

/* -------------------------------------------------------------- amagats */

[data-zbp-only],
[data-zbp-hide-planta] {
	transition: opacity 0.12s;
}

.zbp-hidden {
	display: none !important;
}

@media (max-width: 34rem) {
	.zbp-step {
		padding: 1.15rem;
	}

	.zbp-veg__item {
		flex-direction: column;
		align-items: stretch;
		gap: 0.6rem;
	}

	.zbp .zbp-veg__input input {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zbp * {
		transition: none !important;
	}
}
