/* =====================================================
   Healio - the affiliate code field
   Shared by the public signup form on /affiliates/ and
   the Affiliate tab in My Account, so the one input
   people hesitate over looks and behaves the same in
   both places.

   Monospace and upper-case on purpose: what they type
   should look like the coupon it is about to become.
   ===================================================== */

.af-code-wrap { position: relative; display: block; }

.af-code-wrap input {
	width: 100%;
	font-family: var(--font-mono);
	font-size: 17px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	padding: 14px 46px 14px 15px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--paper);
	color: var(--wine);
}
.af-code-wrap input:focus {
	outline: none;
	border-color: var(--rose);
	box-shadow: 0 0 0 3px var(--blush-soft);
}

.af-code-state {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border-radius: 50%;
	pointer-events: none;
}
.af-code-state.is-checking {
	border: 2px solid var(--blush);
	border-top-color: var(--rose);
	animation: af-code-spin 0.7s linear infinite;
}
@keyframes af-code-spin { to { transform: translateY(-50%) rotate(360deg); } }

.af-code-state.is-ok::after,
.af-code-state.is-bad::after {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 700;
}
/* Shape as well as colour, so the answer does not depend on seeing red or green. */
.af-code-state.is-ok::after { content: "\2713"; color: #1F7A4D; }
.af-code-state.is-bad::after { content: "\00D7"; color: var(--berry); }

.af-code-msg { font-size: 12.5px; color: var(--mauve); margin: 8px 0 0; }
.af-code-msg.is-ok { color: #1F7A4D; font-weight: 600; }
.af-code-msg.is-bad { color: var(--berry); }

@media (prefers-reduced-motion: reduce) {
	.af-code-state.is-checking { animation-duration: 2.4s; }
}
