.vp-seo {
	--vp-seo-accent: #1a73e8;
	--vp-seo-ok: #1e8e3e;
	--vp-seo-error: #d93025;
	--vp-seo-border: #d5d9e0;
	--vp-seo-radius: 12px;
	max-width: 640px;
	margin: 0 auto;
	font-family: inherit;
	overflow-x: hidden;
}

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

.vp-seo__form {
	background: #fff;
	border: 1px solid var(--vp-seo-border);
	border-radius: var(--vp-seo-radius);
	padding: 2rem;
	box-shadow: 0 6px 24px rgba(20, 30, 60, 0.06);
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
}

.vp-seo__progress {
	height: 4px;
	background: #eef1f6;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 1.75rem;
}

.vp-seo__progress-bar {
	display: block;
	height: 100%;
	width: 16%;
	background: var(--vp-seo-accent);
	transition: width 0.3s ease;
}

.vp-seo__step {
	border: 0;
	margin: 0;
	padding: 0;
	/* <fieldset> defaults to min-width:min-content, which lets a long suggestion
	   title expand the step past the container. Force it to shrink so children truncate. */
	min-width: 0;
	max-width: 100%;
	animation: vp-seo-fade 0.25s ease;
}

.vp-seo__step[hidden] {
	display: none;
}

.vp-seo__legend {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 1.25rem;
	padding: 0;
}

.vp-seo__label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin: 1rem 0 0.35rem;
}

.vp-seo__req {
	color: var(--vp-seo-error);
}

.vp-seo__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.75rem 0.9rem;
	font-size: 1rem;
	border: 1px solid var(--vp-seo-border);
	border-radius: 8px;
	background: #fbfcfe;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vp-seo__input:focus {
	outline: none;
	border-color: var(--vp-seo-accent);
	box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
	background: #fff;
}

.vp-seo__hint {
	font-size: 0.85rem;
	margin: 0.4rem 0 0;
	min-height: 1.1em;
	color: #5a6472;
}

.vp-seo__hint.is-ok {
	color: var(--vp-seo-ok);
}

.vp-seo__hint.is-error {
	color: var(--vp-seo-error);
}

.vp-seo__hint.is-muted {
	color: #7a8494;
}

/* Competitor search: playful "detective on the case" while the API works. */
.vp-seo__hint.is-searching {
	color: var(--vp-seo-accent);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Three bouncing dots — real transform animation, works everywhere. */
.vp-seo__dots {
	display: inline-flex;
	gap: 4px;
	flex: 0 0 auto;
}

.vp-seo__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--vp-seo-accent);
	animation: vp-seo-bounce 0.9s infinite ease-in-out both;
}

.vp-seo__dot:nth-child(1) { animation-delay: -0.3s; }
.vp-seo__dot:nth-child(2) { animation-delay: -0.15s; }

@keyframes vp-seo-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
	40% { transform: translateY(-6px); opacity: 1; }
}

/* Submit loading spinner */
.vp-seo__result.is-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	color: #33415c;
}

.vp-seo__spinner {
	width: 42px;
	height: 42px;
	border: 4px solid #e6eaf2;
	border-top-color: var(--vp-seo-accent);
	border-radius: 50%;
	animation: vp-seo-spin 0.8s linear infinite;
}

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

.vp-seo__intro {
	font-size: 0.95rem;
	line-height: 1.5;
	color: #4a5568;
	margin: 0 0 1rem;
}

.vp-seo__note {
	font-size: 0.9rem;
	line-height: 1.45;
	color: #14315e;
	background: #eef4ff;
	border-radius: 8px;
	padding: 0.6rem 0.8rem;
	margin: 0 0 1.25rem;
}

/* Keywords: clear separation between the 3 fields */
.vp-seo__keywords .vp-seo__label {
	margin-top: 1.1rem;
}

.vp-seo__keywords .vp-seo__label:first-child {
	margin-top: 0;
}

.vp-seo__keywords .vp-seo__input {
	margin-bottom: 0.25rem;
}

/* Competitor input + Add button on one row */
.vp-seo__competitor-row {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.vp-seo__competitor-row .vp-seo__input {
	flex: 1 1 auto;
	min-width: 0;
}

.vp-seo__btn--add {
	flex: 0 0 auto;
	background: #eef1f6;
	color: #33415c;
	padding: 0.75rem 1.1rem;
}

.vp-seo__suggestions {
	list-style: none;
	margin: 0.4rem 0 0;
	padding: 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--vp-seo-border);
	border-radius: 8px;
	overflow-x: hidden;
	overflow-y: auto;
	max-height: 220px;
	box-shadow: 0 4px 16px rgba(20, 30, 60, 0.08);
}

.vp-seo__suggestion {
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	border-bottom: 1px solid #f0f2f6;
	line-height: 1.3;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
}

.vp-seo__suggestion:last-child {
	border-bottom: 0;
}

.vp-seo__suggestion:hover,
.vp-seo__suggestion:focus {
	background: #eef4ff;
}

.vp-seo__suggestion-title {
	display: block;
	max-width: 100%;
	font-size: 0.9rem;
	font-weight: 600;
	color: #1f2937;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vp-seo__suggestion-domain {
	display: block;
	max-width: 100%;
	font-size: 0.78rem;
	color: var(--vp-seo-accent);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vp-seo__microcopy {
	font-size: 0.82rem;
	color: #7a8494;
	margin: 0.4rem 0 0;
}

/* Coupon status: spinner + animated icon */
.vp-seo__coupon-status {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.9rem;
	margin: 0.5rem 0 0;
	min-height: 1.4em;
}

.vp-seo__coupon-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.15em;
	line-height: 1;
	flex: 0 0 auto;
}

.vp-seo__coupon-status.is-checking .vp-seo__coupon-text {
	color: #5a6472;
}

/* Looking: the magnifier bobs and swings — playful, not a sterile spinner. */
.vp-seo__coupon-status.is-checking .vp-seo__coupon-icon {
	animation: vp-seo-search 0.9s ease-in-out infinite;
}

.vp-seo__coupon-status.is-ok .vp-seo__coupon-text {
	color: var(--vp-seo-ok);
	font-weight: 600;
}

/* Success: a little confetti pop. */
.vp-seo__coupon-status.is-ok .vp-seo__coupon-icon {
	animation: vp-seo-pop 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.vp-seo__coupon-status.is-error .vp-seo__coupon-text {
	color: var(--vp-seo-error);
}

/* Miss: friendly wobble of the thinking face. */
.vp-seo__coupon-status.is-error .vp-seo__coupon-icon {
	animation: vp-seo-wobble 0.5s ease;
}

@keyframes vp-seo-search {
	0%, 100% { transform: translateY(0) rotate(-8deg); }
	50% { transform: translateY(-3px) rotate(8deg); }
}

@keyframes vp-seo-pop {
	0% { transform: scale(0) rotate(-20deg); }
	60% { transform: scale(1.25) rotate(8deg); }
	100% { transform: scale(1) rotate(0); }
}

@keyframes vp-seo-wobble {
	0%, 100% { transform: rotate(0); }
	25% { transform: rotate(-12deg); }
	75% { transform: rotate(12deg); }
}

.vp-seo__chips {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
	padding: 0;
}

.vp-seo__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	max-width: 100%;
	background: #eef4ff;
	color: #14315e;
	border-radius: 999px;
	padding: 0.3rem 0.7rem;
	font-size: 0.85rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vp-seo__chip-remove {
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	color: inherit;
}

.vp-seo__nav {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

.vp-seo__btn {
	appearance: none;
	border: 0;
	border-radius: 8px;
	padding: 0.75rem 1.4rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

.vp-seo__btn--next,
.vp-seo__btn--submit {
	background: var(--vp-seo-accent);
	color: #fff;
	margin-left: auto;
}

.vp-seo__btn--prev {
	background: #eef1f6;
	color: #33415c;
}

.vp-seo__btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

.vp-seo__error {
	color: var(--vp-seo-error);
	font-size: 0.9rem;
	margin-top: 1rem;
}

.vp-seo__result {
	background: #fff;
	border: 1px solid var(--vp-seo-border);
	border-radius: var(--vp-seo-radius);
	padding: 2.5rem 2rem;
	text-align: center;
	font-size: 1.15rem;
	font-weight: 600;
}

.vp-seo__result.is-ok {
	border-color: var(--vp-seo-ok);
	color: #14622b;
	background: #f2fbf4;
}

/* Honeypot: hidden from humans, present for bots. */
.vp-seo__hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@keyframes vp-seo-fade {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.vp-seo__step { animation: none; }
	.vp-seo__progress-bar { transition: none; }
	.vp-seo__coupon-status.is-ok .vp-seo__coupon-icon,
	.vp-seo__coupon-status.is-error .vp-seo__coupon-icon { animation: none; }
	.vp-seo__coupon-status.is-checking .vp-seo__coupon-icon { animation: vp-seo-search 1.8s ease-in-out infinite; }
	.vp-seo__dot { animation-duration: 1.6s; }
	.vp-seo__spinner { animation-duration: 1.4s; }
}

/* Mobile */
@media (max-width: 560px) {
	.vp-seo__form {
		padding: 1.25rem;
	}

	.vp-seo__legend {
		font-size: 1.2rem;
	}

	/* Search input + button stack so nothing overflows on narrow screens. */
	.vp-seo__competitor-row {
		flex-direction: column;
	}

	.vp-seo__competitor-row .vp-seo__btn--add {
		width: 100%;
	}

	.vp-seo__suggestions {
		max-height: 46vh;
	}

	.vp-seo__nav {
		flex-wrap: wrap;
	}

	.vp-seo__btn {
		padding: 0.7rem 1rem;
	}

	.vp-seo__btn--next,
	.vp-seo__btn--submit {
		flex: 1 1 auto;
	}
}
