/**
 * First Optimise email verification widget.
 *
 * Every value is a custom property. The defaults below are the real tokens from
 * the Figma design, so an untouched install renders correctly; the settings page
 * writes an inline block that overrides them.
 *
 * Font family deliberately inherits - the theme already loads Poppins for the
 * rest of the page. Set --foev-font-family if that is ever not true.
 */

.foev {
	--foev-font-family: inherit;
	--foev-control-height: 56px;
	--foev-gap: 12px;
	--foev-radius: 12px;

	--foev-input-bg: #181818;
	--foev-border: #313132;
	--foev-error-border: #ff286e;
	--foev-text: #ffffff;
	--foev-text-muted: #909092;
	--foev-input-blur: 4px;

	--foev-submit-bg: linear-gradient(180deg, #0068ff 1.41%, #73acff 98.35%);
	--foev-submit-border: #73acff;
	--foev-submit-text: #ffffff;
	--foev-submit-glow: 0 0 11px rgba(115, 172, 255, 0.5);

	--foev-success: #21c66e;
	--foev-success-bg: #123a25;
	--foev-failure: #ff538b;
	--foev-failure-bg: #420a1c;
	--foev-neutral: #afafb1;
	--foev-neutral-bg: #2f3237;

	--foev-font-size: 16px;
	--foev-submit-size: 18px;
	--foev-message-size: 14px;
	--foev-line-height: 1.5;

	font-family: var(--foev-font-family);
	font-size: var(--foev-font-size);
	line-height: var(--foev-line-height);
}

.foev *,
.foev *::before,
.foev *::after {
	box-sizing: border-box;
}

.foev [hidden] {
	display: none !important;
}

.foev__form {
	display: flex;
	flex-direction: column;
	gap: var(--foev-gap);
	margin: 0;
}

/* Sits in the page's typographic flow, so it takes the surrounding colour. */
.foev__intro {
	margin: 0;
	color: inherit;
}

.foev__input {
	width: 100%;
	height: var(--foev-control-height);
	padding: 0 16px;
	font: inherit;
	color: var(--foev-text);
	background: var(--foev-input-bg);
	border: 1px solid var(--foev-border);
	border-radius: var(--foev-radius);
	-webkit-backdrop-filter: blur(var(--foev-input-blur));
	backdrop-filter: blur(var(--foev-input-blur));
	transition: border-color 120ms ease;
}

.foev__input::placeholder {
	color: var(--foev-text-muted);
	opacity: 1;
}

.foev__input:focus {
	outline: none;
	border-color: var(--foev-submit-border);
}

.foev__input:focus-visible {
	outline: 2px solid var(--foev-submit-border);
	outline-offset: 2px;
}

.foev__input[aria-invalid="true"] {
	border-color: var(--foev-error-border);
}

.foev__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--foev-control-height);
	padding: 8px 24px;
	font-family: inherit;
	font-size: var(--foev-submit-size);
	font-weight: 600;
	line-height: var(--foev-line-height);
	color: var(--foev-submit-text);
	background: var(--foev-submit-bg);
	border: 1.5px solid var(--foev-submit-border);
	border-radius: var(--foev-radius);
	box-shadow: var(--foev-submit-glow);
	cursor: pointer;
	transition: opacity 120ms ease;
}

.foev__submit:hover {
	opacity: 0.88;
}

.foev__submit:focus-visible {
	outline: 2px solid var(--foev-submit-border);
	outline-offset: 2px;
}

.foev__submit:disabled {
	cursor: default;
	opacity: 0.6;
}

.foev.is-busy .foev__submit::after {
	content: "";
	width: 14px;
	height: 14px;
	margin-left: 10px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: foev-spin 700ms linear infinite;
}

@keyframes foev-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.foev.is-busy .foev__submit::after {
		animation-duration: 2s;
	}

	.foev__input,
	.foev__submit {
		transition: none;
	}
}

.foev__status {
	margin-top: var(--foev-gap);
}

.foev__message {
	display: flex;
	gap: 8px;
	padding: 12px;
	margin: 0;
	font-size: var(--foev-message-size);
	border-radius: var(--foev-radius);
}

.foev__message p {
	margin: 0;
}

.foev__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
}

.foev__message--success {
	color: var(--foev-success);
	background: var(--foev-success-bg);
}

.foev__message--failure {
	color: var(--foev-failure);
	background: var(--foev-failure-bg);
}

.foev__message--unavailable,
.foev__message--empty {
	color: var(--foev-neutral);
	background: var(--foev-neutral-bg);
}

@media (max-width: 781px) {
	.foev {
		--foev-control-height: 48px;
	}
}
