/* Without JS the form is visible by default. JS adds .js-enabled to activate the toggle. */
#custom-subscription {
	overflow-anchor: none;
	width: 100%;
}

.js-enabled #custom-subscription:not(.visible) {
	display: none;
}

.js-enabled #custom-subscription.visible {
	display: block;
}

#custom-subscription form {
	text-align: left;
}
#custom-subscription label {
	display: block;
	margin-bottom: 0.5rem;
}
#custom-subscription-amount-container {
	margin-bottom: 1rem;
}
.custom-subscription-amount-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.custom-subscription-amount-control {
	align-items: stretch;
	display: inline-flex;
	max-width: 100%;
}
.custom-subscription-amount-step {
	background-color: #f6f7f7;
	border: 1px solid #bbb;
	color: #1d2327;
	cursor: pointer;
	display: none;
	flex: 0 0 auto;
	font-size: 1.5rem;
	line-height: 1;
	min-width: 2.75rem;
	padding: 0.45rem 0.75rem;
}
.custom-subscription-amount-step:hover {
	background-color: #f0f0f1;
}
.custom-subscription-amount-step:focus {
	border-color: #3858e9;
	box-shadow: 0 0 0 1px #3858e9;
	outline: none;
	background-color: transparent;
}
#custom-subscription-amount {
	-moz-appearance: textfield;
	appearance: textfield;
	background-color: #fff;
	border: 1px solid #bbb;
	border-radius: 5px;
	flex: 1 1 auto;
	font-size: 1.9rem;
	line-height: 1.5;
	margin: 0;
	min-width: 6rem;
	padding: 0.35rem 0.5rem;
	text-align: center;
	width: 8ch;
}
#custom-subscription-amount::-webkit-outer-spin-button,
#custom-subscription-amount::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
#custom-subscription-amount:focus {
	border-color: #3858e9;
	box-shadow: 0 0 0 1px #3858e9;
	outline: none;
}
.custom-subscription-amount-row .inline-help {
	color: #50575e;
	font-size: 1.7rem;
	white-space: nowrap;
}
.js-enabled .custom-subscription-amount-step {
	align-items: center;
	display: inline-flex;
	justify-content: center;
}
.js-enabled .custom-subscription-amount-step--decrease {
	border-radius: 5px 0 0 5px;
}
.js-enabled .custom-subscription-amount-control #custom-subscription-amount {
	border-left: 0;
	border-radius: 0;
	border-right: 0;
}
.js-enabled .custom-subscription-amount-step--increase {
	border-radius: 0 5px 5px 0;
}

.controls {
	margin-top: 2rem;
}
.controls button[type="submit"] {
	background-color: #3858e9;
	font-size: 1.6rem;
	margin-right: 1rem;
}
#custom-subscription-description {
	font-size: 1.4rem;
	margin-top: 2rem;
}

.hidden {
	display: none;
}

/* The cancel link has no purpose without JS. */
#custom-subscription-cancel,
.custom-subscription-cancel {
	display: none;
}
.js-enabled #custom-subscription-cancel,
.js-enabled .custom-subscription-cancel {
	display: inline;
}

/* The toggle button has no purpose without JS. */
#custom-subscription-button {
	display: none;
}
.js-enabled #custom-subscription-button {
	display: block;
}

@media screen and (max-width: 880px) {
	.controls button[type="submit"] {
		font-size: 1.2rem;
	}
	#custom-subscription-description {
		font-size: 1.4rem;
	}
}

/* Transition for buttons. */
.wp-block-buttons {
	overflow: hidden;
	max-height: 300px;
	opacity: 1;
	overflow-anchor: none;
	transition: opacity 0.5s ease-in-out, max-height 0.5s ease-in-out;
}

.wp-block-buttons:not(.hidden):has(+ .notice) {
	margin-bottom: 3rem;
}

/* Hidden state for elements toggled by JS. */
.js-enabled .wp-block-buttons.hidden {
	max-height: 0;
	opacity: 0;
}

.js-enabled .wp-block-buttons.hidden.hidden--immediate {
	transition: none;
}

#acknowledgement,
#public_name {
	background-color: white;
	border: 1px solid #bbb;
	border-radius: 5px;
	margin: 0 2px 1rem;
	width: 99%;
}
#acknowledgement {
	padding: 0.5278em;
}
label[for="acknowledgement"] {
	margin-top: 1rem;
}
label[for="public_name"] {
	margin-top: 2rem;
}

#custom-subscription-tier {
	display: none;
	font-size: 1.6rem;
	margin-bottom: 3.5rem;
}
#custom-subscription-tier span {
	font-weight: bold;
}

.notice {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-left-width: 4px;
	box-shadow: 0 1px 1px rgba(0,0,0,.04);
	margin: 0 0 2rem;
	padding: 1rem;
}
.custom-subscription-feedback {
	overflow-anchor: none;
	scroll-margin-top: 8px;
}
html.admin-bar .custom-subscription-feedback {
	scroll-margin-top: 32px;
}
@media screen and (max-width: 782px) {
	html.admin-bar .custom-subscription-feedback {
		scroll-margin-top: 46px;
	}
}
.notice p:last-of-type {
	margin-bottom: 0;
}
.notice-error   { border-left-color: #d63638; }
.notice-info    { border-left-color: #72aee6; }
.notice-success { border-left-color: #00a32a; }
.notice-warning { border-left-color: #dba617; }
