/* GRS Give: form di donazione. Eredita font e colori del tema; il colore principale arriva da --grs-give-accent. */

.grs-give-form {
	--grs-give-accent: #1d4ed8;
	--grs-give-text: #1f2329;
	--grs-give-muted: #5b6270;
	--grs-give-line: #d6dae1;
	--grs-give-bg: #ffffff;
	--grs-give-soft: #f5f7fa;
	--grs-give-error: #b42318;
	--grs-give-ok: #067647;
	--grs-give-radius: 10px;
	container-type: inline-size;
	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	color: var(--grs-give-text);
	font: inherit;
	line-height: 1.5;
	text-align: start;
}

.grs-give-form *,
.grs-give-form *::before,
.grs-give-form *::after {
	box-sizing: border-box;
}

.grs-give-form--card {
	padding: clamp(20px, 4vw, 32px);
	background: var(--grs-give-bg);
	border: 1px solid var(--grs-give-line);
	border-radius: calc(var(--grs-give-radius) + 4px);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

.grs-give-form .grs-give-form__heading {
	margin: 0 0 6px;
	padding: 0;
	font-size: 1.5em;
	line-height: 1.25;
}

.grs-give-form .grs-give-form__intro {
	margin: 0 0 20px;
	padding: 0;
	color: var(--grs-give-muted);
}

.grs-give-form .grs-give-form__section {
	margin: 0 0 22px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.grs-give-form .grs-give-form__section > legend {
	display: block;
	margin: 0 0 10px;
	padding: 0;
	font-weight: 600;
	font-size: 0.95em;
	color: var(--grs-give-text);
}

/* Importi. */
.grs-give-form .grs-give-form__chips {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.grs-give-form .grs-give-chip {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}

.grs-give-form .grs-give-chip input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.grs-give-form .grs-give-chip span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 8px 6px;
	border: 1.5px solid var(--grs-give-line);
	border-radius: var(--grs-give-radius);
	background: var(--grs-give-bg);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.grs-give-form .grs-give-chip:hover span {
	border-color: var(--grs-give-accent);
}

.grs-give-form .grs-give-chip input:checked + span {
	border-color: var(--grs-give-accent);
	background: var(--grs-give-accent);
	color: #ffffff;
}

.grs-give-form .grs-give-chip input:focus-visible + span {
	outline: 3px solid color-mix(in srgb, var(--grs-give-accent) 40%, transparent);
	outline-offset: 2px;
}

.grs-give-form .grs-give-chip--custom {
	grid-column: 1 / -1;
}

/* Campi. */
.grs-give-form .grs-give-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 14px;
}

.grs-give-form .grs-give-field {
	margin: 0;
	padding: 0;
}

.grs-give-form .grs-give-field--wide {
	grid-column: 1 / -1;
}

.grs-give-form .grs-give-field label {
	display: block;
	margin: 0 0 4px;
	font-size: 0.875em;
	font-weight: 500;
	color: var(--grs-give-text);
}

.grs-give-form .grs-give-req {
	color: var(--grs-give-error);
}

.grs-give-form input[type="text"],
.grs-give-form input[type="email"],
.grs-give-form input[type="tel"],
.grs-give-form select,
.grs-give-form textarea {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 12px;
	border: 1.5px solid var(--grs-give-line);
	border-radius: var(--grs-give-radius);
	background: var(--grs-give-bg);
	color: var(--grs-give-text);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
}

.grs-give-form textarea {
	min-height: 84px;
	resize: vertical;
}

.grs-give-form input:focus,
.grs-give-form select:focus,
.grs-give-form textarea:focus {
	border-color: var(--grs-give-accent);
	outline: 3px solid color-mix(in srgb, var(--grs-give-accent) 25%, transparent);
	outline-offset: 0;
}

.grs-give-form [aria-invalid="true"] {
	border-color: var(--grs-give-error) !important;
}

.grs-give-form .grs-give-field--upper input {
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.grs-give-form .grs-give-form__error-field {
	display: block;
	margin: 4px 0 0;
	min-height: 0;
	color: var(--grs-give-error);
	font-size: 0.85em;
}

.grs-give-form .grs-give-form__error-field:empty {
	display: none;
}

/* Pagamento. */
.grs-give-form .grs-give-form__methods {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin: 0 0 14px;
}

.grs-give-form .grs-give-method {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.grs-give-form .grs-give-method input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.grs-give-form .grs-give-method span {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid var(--grs-give-line);
	border-radius: var(--grs-give-radius);
	font-weight: 500;
}

.grs-give-form .grs-give-method span::before {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border: 2px solid var(--grs-give-line);
	border-radius: 50%;
}

.grs-give-form .grs-give-method input:checked + span {
	border-color: var(--grs-give-accent);
	background: color-mix(in srgb, var(--grs-give-accent) 6%, var(--grs-give-bg));
}

.grs-give-form .grs-give-method input:checked + span::before {
	border-color: var(--grs-give-accent);
	background: radial-gradient(var(--grs-give-accent) 0 45%, transparent 50%);
}

.grs-give-form .grs-give-method input:focus-visible + span {
	outline: 3px solid color-mix(in srgb, var(--grs-give-accent) 40%, transparent);
	outline-offset: 2px;
}

.grs-give-form .grs-give-form__stripe {
	min-height: 40px;
}

.grs-give-form .grs-give-form__stripe-preview,
.grs-give-form .grs-give-form__bank-note {
	padding: 14px 16px;
	border: 1.5px dashed var(--grs-give-line);
	border-radius: var(--grs-give-radius);
	background: var(--grs-give-soft);
	color: var(--grs-give-muted);
	font-size: 0.9em;
}

.grs-give-form .grs-give-form__bank-note {
	border-style: solid;
}

/* Consensi. */
.grs-give-form .grs-give-form__consents {
	margin: 0 0 18px;
}

.grs-give-form .grs-give-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
	font-size: 0.9em;
	cursor: pointer;
}

.grs-give-form .grs-give-check input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--grs-give-accent);
}

.grs-give-form .grs-give-check a {
	color: var(--grs-give-accent);
}

/* Trappola per i bot: fuori schermo, mai visibile. */
.grs-give-form .grs-give-form__hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Invio ed esiti. */
.grs-give-form .grs-give-form__message {
	margin: 0 0 12px;
	font-size: 0.92em;
}

.grs-give-form .grs-give-form__message:empty {
	display: none;
}

.grs-give-form .grs-give-form__message.is-error {
	padding: 10px 14px;
	border-radius: var(--grs-give-radius);
	background: color-mix(in srgb, var(--grs-give-error) 8%, #ffffff);
	color: var(--grs-give-error);
}

.grs-give-form .grs-give-form__submit {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 12px 20px;
	border: 0;
	border-radius: var(--grs-give-radius);
	background: var(--grs-give-accent);
	color: #ffffff;
	font: inherit;
	font-size: 1.05em;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.05s ease;
}

.grs-give-form .grs-give-form__submit:hover {
	filter: brightness(1.08);
}

.grs-give-form .grs-give-form__submit:active {
	transform: translateY(1px);
}

.grs-give-form .grs-give-form__submit:disabled {
	opacity: 0.7;
	cursor: progress;
}

.grs-give-form .grs-give-form__test {
	margin: 10px 0 0;
	color: #b54708;
	font-size: 0.85em;
	text-align: center;
}

.grs-give-form .grs-give-form__notice {
	margin: 0;
	color: var(--grs-give-muted);
}

.grs-give-form .grs-give-form__done:focus {
	outline: none;
}

.grs-give-result {
	padding: 18px 20px;
	border-radius: var(--grs-give-radius, 10px);
	background: #f5f7fa;
}

.grs-give-result p {
	margin: 0;
}

.grs-give-result--ok {
	border-inline-start: 4px solid var(--grs-give-ok, #067647);
	background: #ecfdf3;
}

.grs-give-result--wait {
	border-inline-start: 4px solid #b54708;
	background: #fffaeb;
}

.grs-give-result--error {
	border-inline-start: 4px solid var(--grs-give-error, #b42318);
	background: #fef3f2;
}

.grs-give-bank p {
	margin: 0 0 12px;
}

.grs-give-bank .grs-give-bank__table {
	width: 100%;
	margin: 0 0 12px;
	border-collapse: collapse;
	font-size: 0.95em;
}

.grs-give-bank .grs-give-bank__table th,
.grs-give-bank .grs-give-bank__table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--grs-give-line, #d6dae1);
	text-align: start;
	vertical-align: top;
}

.grs-give-bank .grs-give-bank__table th {
	width: 38%;
	color: var(--grs-give-muted, #5b6270);
	font-weight: 500;
}

.grs-give-bank .grs-give-bank__table td {
	font-weight: 600;
	word-break: break-word;
}

.grs-give-form.is-busy {
	cursor: progress;
}

.grs-give-form .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Telefono: una colonna (container query, così funziona anche nell'anteprima del costruttore). */
@container (max-width: 460px) {
	.grs-give-form .grs-give-form__chips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.grs-give-form .grs-give-form__grid,
	.grs-give-form .grs-give-form__methods {
		grid-template-columns: minmax(0, 1fr);
	}
}

.grs-give-form .grs-give-form__loading {
	margin: 0;
	padding: 14px 0;
	font-size: 0.9em;
	opacity: 0.7;
}

.grs-give-form [hidden] {
	display: none !important;
}

.grs-give-form .grs-give-form__paypal-hint {
	margin: 0;
	font-size: 0.9em;
	opacity: 0.75;
}

.grs-give-form .grs-give-form__paypal-button {
	min-height: 48px;
}

.grs-give-form .grs-give-form__paypal-button paypal-button {
	display: block;
	width: 100%;
}
