/*
 * Account form blocks. Field, label, message and button paint come from the
 * theme's form system (assets/css/forms.css) and its button element; this
 * covers the layout of the forms and the parts the theme has no word for.
 */

.fp-account-form .edd-blocks-form {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40, 1rem);
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.fp-account-form .edd-blocks-form__group {
	margin: 0;
}

.fp-account-form .edd-label {
	display: block;
	margin-block-end: var(--wp--preset--spacing--20, 0.5rem);
}

/*
 * The submit button and any note under it are core blocks. Three classes, because
 * EDD's block styles (always loaded in the editor) set every group to display: block.
 */
.fp-account-form .edd-blocks-form .edd-blocks-form__group-submit {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30, 0.75rem);
}

.fp-account-form .edd-blocks-form__group-submit > * {
	margin-block: 0;
}

.fp-account-form .wp-block-button__width-100,
.fp-account-form .wp-block-button__width-100 .wp-block-button__link {
	inline-size: 100%;
}

.fp-login-link-form__who {
	margin: 0;
}

/* Label with a link on the same row ("Forgot password?"). */
.fp-account-form__label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30, 0.75rem);
	margin-block-end: var(--wp--preset--spacing--20, 0.5rem);
}

.fp-account-form__label-row .edd-label {
	margin-block-end: 0;
}

.fp-account-form__label-row a {
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
}

/* Outranks EDD's ".edd-blocks-form .edd-blocks-form__group > label { display: block }". */
.fp-account-form .edd-blocks-form__group > .fp-account-form__check {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20, 0.5rem);
	min-block-size: 44px;
	cursor: pointer;
}

/* Password field with its show/hide button inside the field's box. */
.fp-account-form .fp-password-control {
	position: relative;
}

.fp-account-form .fp-password-control input {
	padding-inline-end: 5rem;
	inline-size: 100%;
}

.fp-account-form .fp-password-toggle {
	position: absolute;
	inset-block: 0.375rem;
	inset-inline-end: 0.375rem;
	min-inline-size: 3.5rem;
	padding-inline: 0.75rem;
	border: 1px solid var(--wp--custom--form--field--border, currentColor);
	border-radius: 0.375rem;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875em;
	cursor: pointer;
}

.fp-account-form .fp-password-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fp-account-form__error {
	color: var(--wp--custom--form--action--danger, #dc2626);
}

/* Notices above a form. Error and success paint come from the theme's form system. */
.fp-form-notice {
	margin: 0 0 var(--wp--preset--spacing--40, 1rem);
}

.fp-form-notice p {
	margin: 0;
}

.fp-form-notice a {
	font-weight: 600;
}

.fp-form-notice--info {
	padding: 12px 14px;
	border: 1px solid color-mix(in srgb, var(--wp--custom--form--action--accent, #2563eb) 35%, transparent);
	border-radius: var(--wp--custom--form--field--radius, 8px);
	background: color-mix(in srgb, var(--wp--custom--form--action--accent, #2563eb) 8%, transparent);
	font-size: 0.875rem;
}

/* Present for bots, gone for people and assistive tech. */
.fp-account-form .fp-signup-trap {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Editor only: name the state a condition block is shown in. */
.fp-account-condition[data-fp-condition] {
	outline: 1px dashed color-mix(in srgb, currentColor 30%, transparent);
	outline-offset: 4px;
}

.fp-account-condition[data-fp-condition]::before {
	content: attr(data-fp-condition);
	display: block;
	margin-block-end: 0.5rem;
	font-size: 0.75rem;
	opacity: 0.7;
}


/*
 * Plan choice on the signup form (`"plans": true`), inside the site's form card.
 * Free and Pro are rows in the card's own style (light border, the site's
 * accent for the chosen one). Under the chosen row: the account fields for
 * Free, the way to checkout for Pro.
 */
.fp-signup-form:has(> .fp-plan) {
	gap: var(--wp--preset--spacing--40, 1rem);
}

.fp-account-form .fp-signup-form > .fp-plan {
	display: flex;
	align-items: center;
	gap: 14px;
	min-block-size: 64px;
	margin: 0;
	padding: 14px 16px;
	box-sizing: border-box;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: var(--wp--preset--color--custom-base-2, #fff);
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fp-account-form .fp-signup-form > .fp-plan:hover {
	border-color: var(--wp--custom--form--field--border-hover, #64748b);
}

.fp-account-form .fp-signup-form > .fp-plan:has(input:checked) {
	border-color: var(--wp--custom--form--action--accent, #2563eb);
	box-shadow: inset 0 0 0 1px var(--wp--custom--form--action--accent, #2563eb);
}

.fp-account-form .fp-plan input {
	flex-shrink: 0;
	inline-size: 18px;
	block-size: 18px;
	margin: 0;
	accent-color: var(--wp--custom--form--action--accent, #2563eb);
}

.fp-account-form .fp-plan:has(input:focus-visible) {
	outline: 2px solid var(--wp--custom--form--action--accent, #2563eb);
	outline-offset: 2px;
}

.fp-plan__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 3px;
	min-inline-size: 0;
}

.fp-plan__name {
	font-weight: 600;
	line-height: 1.2;
}

.fp-plan__desc,
.fp-plan__price span,
.fp-plan-note {
	color: var(--wp--custom--form--field--muted, #64748b);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	line-height: 1.45;
}

.fp-plan__price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	white-space: nowrap;
}

.fp-plan__price span {
	font-size: 0.75rem;
}

/* The PRO mark, as on the site's Pro badge; darker amber for contrast on white. */
.fp-plan__badge {
	display: inline-flex;
	align-items: center;
	block-size: 22px;
	padding-inline: 6px;
	border: 2px solid #a16207;
	border-radius: 5px;
	color: #a16207;
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	line-height: 1;
	text-transform: uppercase;
}

/* Only the chosen plan's panel shows. */
.fp-account-form .fp-signup-form > .fp-plan-panel {
	display: none;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40, 1rem);
}

.fp-signup-form:has(.fp-plan--free input:checked) > .fp-plan-panel--free,
.fp-signup-form:has(.fp-plan--pro input:checked) > .fp-plan-panel--pro {
	display: flex;
}

.fp-account-form .fp-plan-go {
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 100%;
	box-sizing: border-box;
	text-decoration: none;
}

.fp-plan-note {
	margin: 0;
	text-align: center;
}

/* The join page's header photo and section meet edge to edge. */
.wp-site-blocks:has(.fp-join-band) > *,
main:has(> .fp-join-band) > *,
.fp-join-hero,
.fp-join-band {
	margin-block: 0;
}

/* The header photo sizes to its text, not the cover block's 430px default. */
.wp-block-cover.fp-join-hero {
	min-block-size: 0;
	padding-block: clamp(3rem, 8vw, 6rem);
}

@media (prefers-reduced-motion: reduce) {
	.fp-account-form .fp-signup-form > .fp-plan {
		transition: none;
	}
}
