/* CAC Intelligent Name Search — scoped so themes don't leak in. */

.cins-trigger,
.cins-fab,
.cins-overlay,
.cins-overlay *,
.cins-overlay *::before,
.cins-overlay *::after {
	box-sizing: border-box;
}

.cins-trigger,
.cins-fab,
.cins-btn,
.cins-back,
.cins-close {
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	cursor: pointer;
}

.cins-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #1b7339;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 0.95rem 1.75rem;
	border-radius: 0.75rem;
	text-decoration: none;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.cins-trigger:hover,
.cins-trigger:focus-visible {
	background: #02352c;
	color: #fff;
	transform: translateY(-1px);
}

.cins-trigger:focus-visible {
	outline: 2px solid #00b25d;
	outline-offset: 3px;
}

.wp-block-cac-intelligent-name-search.aligncenter {
	text-align: center;
}

.wp-block-cac-intelligent-name-search.alignright {
	text-align: right;
}

.cins-fab {
	position: fixed;
	z-index: 999980;
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	background: #1b7339;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 0.85rem 1.15rem;
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(2, 53, 44, 0.28);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.cins-fab--bottom-right {
	right: 1.25rem;
	bottom: 1.25rem;
}

.cins-fab--bottom-left {
	left: 1.25rem;
	bottom: 1.25rem;
}

.cins-fab:hover,
.cins-fab:focus-visible {
	background: #02352c;
	transform: translateY(-2px);
}

.cins-fab__icon {
	display: flex;
}

.cins-overlay {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(7, 30, 20, 0.72);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cins-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.cins-overlay[hidden] {
	display: none;
}

.cins-dialog {
	position: relative;
	width: min(560px, 100%);
	max-height: min(92vh, 880px);
	overflow: auto;
	outline: none;
	transform: translateY(14px) scale(0.98);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.25s ease;
}

.cins-overlay.is-open .cins-dialog {
	transform: translateY(0) scale(1);
}

.cins-dialog.is-result {
	width: min(820px, 100%);
}

.cins-close {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	z-index: 4;
	width: 2.25rem;
	height: 2.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	transition: background-color 0.2s ease;
}

.cins-dialog.is-result .cins-close {
	background: rgba(2, 53, 44, 0.08);
	color: #071e14;
}

.cins-close:hover,
.cins-close:focus-visible {
	background: rgba(255, 255, 255, 0.32);
}

.cins-back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 0.85rem;
	padding: 0;
	background: transparent;
	color: #071e14;
	font-size: 0.95rem;
	font-weight: 600;
	transition: opacity 0.2s ease;
}

.cins-back--light {
	color: #fff;
}

.cins-back:hover {
	opacity: 0.8;
}

.cins-step[hidden] {
	display: none;
}

.cins-card {
	position: relative;
	overflow: hidden;
	background: #00b25d;
	color: #fff;
	border-radius: 1.5rem;
	padding: 2.75rem 1.35rem 2.5rem;
}

.cins-card__blob {
	position: absolute;
	width: 16rem;
	height: 16rem;
	border-radius: 50%;
	background: #00bb62;
	pointer-events: none;
	z-index: 0;
}

.cins-card__blob--tl {
	top: -5rem;
	left: -2.5rem;
}

.cins-card__blob--br {
	right: -5rem;
	bottom: -5rem;
}

.cins-card__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.cins-crest-wrap {
	width: 5rem;
	height: 5rem;
	margin: 0 auto 1.25rem;
	border-radius: 999px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cins-crest {
	width: 3rem;
	height: 3rem;
}

.cins-kicker {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 300;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.cins-title {
	margin: 0.15rem 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
	font-size: clamp(1.45rem, 3vw, 1.85rem);
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.cins-title--form {
	margin-bottom: 1.75rem;
}

.cins-star {
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
	animation: cins-twinkle 2.4s ease-in-out infinite;
}

.cins-sub {
	margin: 0.45rem 0 2.5rem;
	max-width: 22rem;
	font-size: 0.9rem;
	color: #ecfdf3;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.cins-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 11rem;
	background: #1b7339;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	padding: 1rem 2.5rem;
	border-radius: 0.75rem;
	transition: background-color 0.2s ease;
}

.cins-btn:hover,
.cins-btn:focus-visible {
	background: #02352c;
}

.cins-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.cins-btn--submit {
	width: 100%;
	min-width: 0;
	margin-top: 0.5rem;
}

.cins-btn--submit [data-cins-submit-label] {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.cins-form {
	width: 100%;
	text-align: left;
}

.cins-label {
	display: block;
	margin: 0 0 0.45rem;
	font-size: 0.875rem;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
	color: #fff;
}

.cins-input {
	width: 100%;
	margin: 0 0 1.15rem;
	padding: 0.85rem 1rem;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 0.75rem;
	background: transparent;
	color: #fff;
	font-size: 16px;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
	transition: border-color 0.2s ease;
}

.cins-input::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

.cins-input:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.6);
}

.cins-field {
	position: relative;
}

.cins-field .cins-input {
	margin-bottom: 1.15rem;
}

.cins-suggest {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% - 0.85rem);
	z-index: 5;
	max-height: 220px;
	overflow-y: auto;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.75rem;
	box-shadow: 0 12px 30px rgba(7, 30, 20, 0.16);
}

.cins-suggest[hidden] {
	display: none;
}

.cins-suggest li {
	padding: 0.75rem 1rem;
	color: #111827;
	font-size: 0.9rem;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
	cursor: pointer;
}

.cins-suggest li:hover,
.cins-suggest li.is-active {
	background: #00b25d;
	color: #fff;
}

.cins-alert {
	margin: 0 0 1rem;
	padding: 0.75rem 0.9rem;
	border-radius: 0.65rem;
	background: rgba(251, 0, 0, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.28);
	color: #fff;
	font-size: 0.875rem;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.cins-alert[hidden] {
	display: none;
}

.cins-spinner {
	width: 1.15rem;
	height: 1.15rem;
	animation: cins-spin 0.8s linear infinite;
}

.cins-step--result {
	background: #1b7339;
	border-radius: 1.5rem;
	padding: 1.25rem 1rem 1.35rem;
}

.cins-result {
	background: #fff;
	border-radius: 1.5rem;
	padding: 1.5rem 1.15rem 1.6rem;
	font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.cins-result__row {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin-bottom: 1.25rem;
}

.cins-result__copy {
	flex: 1;
}

.cins-result__headline {
	margin: 0 0 1.15rem;
	font-size: clamp(1.35rem, 3vw, 2.15rem);
	font-weight: 700;
	line-height: 1.25;
	color: #374151;
}

.cins-result__name {
	color: #00b25d;
}

.cins-meters {
	display: grid;
	gap: 0.85rem;
	margin-bottom: 1rem;
}

.cins-meter span {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.8rem;
	color: #4b5563;
}

.cins-meter__track {
	height: 0.5rem;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.cins-meter__fill {
	height: 100%;
	border-radius: 999px;
}

.cins-meter__fill.is-good {
	background: #22c55e;
}

.cins-meter__fill.is-mid {
	background: #eab308;
}

.cins-meter__fill.is-bad {
	background: #ef4444;
}

.cins-similar-box {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	padding: 0.75rem 0.85rem;
	margin-bottom: 0.85rem;
}

.cins-similar-box small {
	display: block;
	color: #6b7280;
	font-size: 0.75rem;
	margin-bottom: 0.2rem;
}

.cins-similar-box strong {
	color: #1f2937;
	font-size: 0.9rem;
}

.cins-warn {
	background: #fffbeb;
	border-left: 4px solid #facc15;
	padding: 0.85rem 1rem;
}

.cins-warn__title {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 0.4rem;
	color: #854d0e;
	font-size: 0.9rem;
	font-weight: 700;
}

.cins-warn ul {
	margin: 0;
	padding-left: 1.15rem;
	color: #a16207;
	font-size: 0.85rem;
}

.cins-crest-lg {
	width: 6rem;
	height: 6rem;
	margin: 0 auto;
	border-radius: 999px;
	background: #f3f4f6;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cins-crest-lg .cins-crest {
	width: 3.5rem;
	height: 3.5rem;
}

.cins-result .cins-btn {
	width: 100%;
	text-decoration: none;
}

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

@keyframes cins-twinkle {
	0%,
	100% {
		transform: rotate(0deg) scale(1);
		opacity: 1;
	}
	50% {
		transform: rotate(12deg) scale(1.08);
		opacity: 0.85;
	}
}

@media (min-width: 720px) {
	.cins-card {
		padding: 3rem 2.5rem 2.75rem;
		border-radius: 1.75rem;
	}

	.cins-step--result {
		padding: 1.5rem 1.35rem 1.6rem;
		border-radius: 2rem;
	}

	.cins-result {
		padding: 2.25rem 2rem 2rem;
		border-radius: 2rem;
	}

	.cins-result__row {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 2rem;
	}

	.cins-crest-lg {
		width: 9rem;
		height: 9rem;
		order: 2;
		margin: 0;
	}

	.cins-crest-lg .cins-crest {
		width: 5rem;
		height: 5rem;
	}

	.cins-meters {
		grid-template-columns: 1fr 1fr;
	}

	.cins-result .cins-btn {
		width: 18rem;
		margin-left: auto;
		margin-right: auto;
		display: flex;
	}
}

@media (max-width: 480px) {
	.cins-fab__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.cins-fab {
		width: 3.4rem;
		height: 3.4rem;
		padding: 0;
		justify-content: center;
	}
}
