/**
 * Shared form controls.
 *
 * The amount picker and the primary submit button are used by both the gift
 * box and the monthly giving form, so they live in one stylesheet that both
 * blocks depend on rather than being duplicated.
 */

.tasslyckan-donate__amounts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
	gap: 12px;
	margin-top: 16px;
}

.tasslyckan-donate__option {
	display: block;
	cursor: pointer;
}

/* Visually hidden, still focusable and still announced. */
.tasslyckan-donate__option input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.tasslyckan-donate__option span {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 6px;
	border: 1.5px solid rgba(38, 35, 29, 0.16);
	border-radius: 12px;
	background-color: transparent;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	color: var(--wp--preset--color--contrast, #26231d);
	text-align: center;
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.tasslyckan-donate__option:hover span {
	border-color: var(--wp--preset--color--primary, #889e58);
}

.tasslyckan-donate__option input:checked + span {
	background-color: var(--wp--preset--color--primary, #889e58);
	border-color: var(--wp--preset--color--primary, #889e58);
	color: #fff;
}

.tasslyckan-donate__option input:focus-visible + span {
	outline: 2px solid var(--wp--preset--color--contrast, #26231d);
	outline-offset: 2px;
}

/* The free amount field is visible by default and hidden only while a preset
   is selected. A browser without :has() support therefore shows the field
   rather than hiding it forever, which is the safer way to fail. */
.tasslyckan-donate__custom {
	margin-top: 14px;
}

.tasslyckan-donate:has(.tasslyckan-donate__preset:checked) .tasslyckan-donate__custom {
	display: none;
}

.tasslyckan-donate__custom label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wp--preset--color--contrast-muted, #5f584d);
	margin-bottom: 6px;
}

.tasslyckan-donate__custom input {
	width: 100%;
	padding: 13px 14px;
	border: 1.5px solid rgba(38, 35, 29, 0.16);
	border-radius: 12px;
	background-color: #fff;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: 1.0625rem;
	color: var(--wp--preset--color--contrast, #26231d);
}

.tasslyckan-donate__custom input:focus {
	border-color: var(--wp--preset--color--primary, #889e58);
	outline: 2px solid var(--wp--preset--color--primary-tint, #e9edd9);
	outline-offset: 0;
}

.tasslyckan-donate__submit {
	width: 100%;
	margin-top: 18px;
	padding: 17px;
	border: 0;
	border-radius: 14px;
	background-color: var(--wp--preset--color--contrast, #26231d);
	color: #fff;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.tasslyckan-donate__submit:hover {
	background-color: #3b362d;
}

.tasslyckan-donate__submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary-strong, #6f8446);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Direct giving
   Without a shop the amounts are Swish links rather than radio inputs. They
   keep the same chip shape so the panel looks identical either way.
   -------------------------------------------------------------------------- */

.tasslyckan-donate__option--link {
	text-decoration: none;
}

.tasslyckan-donate__option--link span {
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.tasslyckan-donate__option--link:hover span,
.tasslyckan-donate__option--link:focus-visible span {
	background-color: var(--wp--preset--color--primary, #889e58);
	border-color: var(--wp--preset--color--primary, #889e58);
	color: #fff;
}

.tasslyckan-donate__option--link:focus-visible {
	outline: none;
}

.tasslyckan-donate__option--link:focus-visible span {
	outline: 2px solid var(--wp--preset--color--contrast, #26231d);
	outline-offset: 2px;
}

.tasslyckan-donate__swish-number {
	margin: 18px 0 0;
	font-size: 1.0625rem;
	line-height: 1.4;
	color: var(--wp--preset--color--contrast, #26231d);
}

.tasslyckan-donate__swish-number strong {
	font-weight: 700;
	letter-spacing: 0.02em;
}

.tasslyckan-donate__bankgiro {
	margin: 6px 0 0;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--contrast-muted, #5f584d);
}

.tasslyckan-donate__hint {
	margin: 8px 0 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--wp--preset--color--contrast-soft, #7a7266);
}

/* The hint is only true where tapping can open an app. */
@media (hover: hover) and (pointer: fine) {
	.tasslyckan-donate__hint {
		opacity: 0.85;
	}
}

/* --------------------------------------------------------------------------
   Shared form layout
   Used by the monthly giving form and the volunteer form. These must live in
   the shared stylesheet, not one block's: the honeypot field is hidden here,
   and a form loading without these rules would show it to real people and
   then silently discard anything they typed into it.
   -------------------------------------------------------------------------- */

/* Monthly giving form. Shares the amount picker styling with the gift box. */

.tasslyckan-form {
	max-width: 32rem;
}

.tasslyckan-form__heading {
	margin-top: 0;
}

.tasslyckan-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.tasslyckan-form__field label,
.tasslyckan-form__fieldset legend {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wp--preset--color--contrast-muted, #5f584d);
}

.tasslyckan-form__optional {
	font-weight: 400;
	color: var(--wp--preset--color--contrast-soft, #7a7266);
}

.tasslyckan-form__field input {
	padding: 13px 14px;
	border: 1.5px solid rgba(38, 35, 29, 0.16);
	border-radius: 12px;
	background-color: var(--wp--preset--color--surface, #fffdf8);
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: 1.0625rem;
	color: var(--wp--preset--color--contrast, #26231d);
}

.tasslyckan-form__field input:focus {
	border-color: var(--wp--preset--color--primary, #889e58);
	outline: 2px solid var(--wp--preset--color--primary-tint, #e9edd9);
	outline-offset: 0;
}

.tasslyckan-form__fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 20px;
}

.tasslyckan-form__choice {
	margin: 0 0 8px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.tasslyckan-form__choice label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
}

.tasslyckan-form__consent {
	margin: 20px 0;
	font-size: 0.875rem;
	color: var(--wp--preset--color--contrast-muted, #5f584d);
}

/* Off screen rather than display:none, so bots that skip hidden fields
   still fill it in. */
.tasslyckan-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.tasslyckan-form__success,
.tasslyckan-form__error {
	padding: 14px 18px;
	border-radius: 12px;
	font-size: 0.9375rem;
	margin: 0 0 16px;
}

.tasslyckan-form__success {
	background-color: var(--wp--preset--color--primary-tint, #e9edd9);
	border-left: 3px solid var(--wp--preset--color--primary, #889e58);
}

.tasslyckan-form__error {
	background-color: var(--wp--preset--color--plum-tint, #ede3e6);
	border-left: 3px solid var(--wp--preset--color--plum, #8e6b7a);
}
