/**
 * AI Assistant — "Build with AI" modal styles for the form builder.
 *
 * Scoped to the additive modal only; it does not restyle the builder.
 */

.afb-ai-build-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 8vh 16px 16px;
	background: rgba( 20, 22, 30, 0.55 );
	backdrop-filter: blur( 2px );
}

.afb-ai-build-modal {
	position: relative;
	width: 100%;
	max-width: 560px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 18px 60px rgba( 0, 0, 0, 0.28 );
	padding: 26px 26px 20px;
	animation: afb-ai-build-in 0.16s ease-out;
}

@keyframes afb-ai-build-in {
	from {
		opacity: 0;
		transform: translateY( -8px );
	}

	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

.afb-ai-build-close {
	position: absolute;
	top: 14px;
	right: 14px;
	border: 0;
	background: transparent;
	padding: 2px;
	cursor: pointer;
	color: #646970;
	line-height: 1;
}

.afb-ai-build-close:hover {
	color: #1d2327;
}

.afb-ai-build-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	color: #1d2327;
}

.afb-ai-build-title .dashicons {
	color: #6d4aff;
	width: 24px;
	height: 24px;
	font-size: 24px;
}

.afb-ai-build-intro {
	margin: 0 0 14px;
	color: #50575e;
	font-size: 13px;
	line-height: 1.6;
}

.afb-ai-build-input {
	width: 100%;
	box-sizing: border-box;
	min-height: 110px;
	padding: 12px 14px;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.6;
	resize: vertical;
}

.afb-ai-build-input:focus {
	border-color: #6d4aff;
	box-shadow: 0 0 0 1px #6d4aff;
	outline: none;
}

.afb-ai-build-tier {
	margin-top: 14px;
}

.afb-ai-build-tier-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #646970;
	margin-bottom: 6px;
}

.afb-ai-build-tier-options {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

.afb-ai-build-tier-option {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	border: 1px solid #dcdcde;
	border-radius: 999px;
	font-size: 13px;
	cursor: pointer;
	user-select: none;
}

.afb-ai-build-tier-option:hover {
	border-color: #6d4aff;
}

.afb-ai-build-tier-note {
	margin: 8px 0 0;
	font-size: 12px;
	color: #787c82;
	line-height: 1.5;
}

.afb-ai-build-error {
	margin-top: 14px;
	padding: 10px 12px;
	background: #fcf0f1;
	border: 1px solid #f0c4c6;
	border-radius: 8px;
	color: #b32d2e;
	font-size: 13px;
}

.afb-ai-build-meta {
	margin-top: 14px;
	padding: 10px 12px;
	background: #f0f6ff;
	border: 1px solid #c9def7;
	border-radius: 8px;
	color: #1d3a5f;
	font-size: 13px;
}

.afb-ai-build-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
}

.afb-ai-build-generate[disabled],
.afb-ai-build-cancel[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.afb-ai-build-upload {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #e8e8ea;
}

.afb-ai-build-upload-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 8px;
}

.afb-ai-build-file {
	display: block;
	width: 100%;
	font-size: 13px;
}

.afb-ai-build-file-name {
	margin-top: 6px;
	font-size: 12px;
	color: #50575e;
	word-break: break-all;
}

.afb-ai-build-upload-note {
	margin: 8px 0 0;
	font-size: 12px;
	color: #787c82;
	line-height: 1.5;
}

.afb-ai-build-file-clear {
	margin-top: 4px;
	padding: 0;
	font-size: 12px;
}

/* ---- Chooser card (CREATE mode entry) --------------------------------- */

/* Inherits the core .afb-template-card layout; this only adds the AI accent. */
.afb-ai-build-card {
	position: relative;
	border-color: #c9bdff;
	background: linear-gradient( 180deg, #faf8ff 0%, #ffffff 60% );
}

.afb-ai-build-card:hover {
	border-color: #6d4aff;
	box-shadow: 0 8px 24px rgba( 109, 74, 255, 0.18 );
}

.afb-ai-build-card .afb-template-card__icon--ai {
	background: linear-gradient( 135deg, #6d4aff 0%, #9b6bff 100% );
	color: #fff;
}

.afb-ai-build-card .afb-template-card__icon--ai .dashicons {
	color: #fff;
}

.afb-ai-build-card .afb-template-card__meta {
	color: #6d4aff;
	font-weight: 600;
}

/* ---- Success toast (after create-mode insert) ------------------------- */

.afb-ai-build-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 100001;
	max-width: 360px;
	padding: 12px 16px;
	background: #1d2327;
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.3 );
	font-size: 13px;
	line-height: 1.5;
	opacity: 1;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.afb-ai-build-toast--out {
	opacity: 0;
	transform: translateY( 8px );
}
