/* AI Marketplace — виджет генерации (переоформлено под тему BitRich) */

.aimp-widget {
	max-width: 1000px;
	margin: 2em 0;
	font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
	color: #1B1E2B;
}

.aimp-layout {
	display: flex;
	gap: 2em;
	flex-wrap: wrap;
	align-items: flex-start;
}

.aimp-col-form {
	flex: 1 1 380px;
	max-width: 480px;
	background: #fff;
	border: 1px solid #E6E8F3;
	border-radius: 16px;
	padding: 1.5em;
}

.aimp-col-result {
	flex: 1 1 320px;
	position: sticky;
	top: 1em;
}

@media (max-width: 700px) {
	.aimp-col-result {
		position: static;
	}
}

.aimp-field {
	margin-bottom: 1.1em;
}

.aimp-field label {
	display: block;
	font-weight: 700;
	font-size: 0.9em;
	margin-bottom: 0.4em;
	color: #1B1E2B;
}

.aimp-field input[type="file"],
.aimp-field textarea,
.aimp-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65em 0.8em;
	border: 1.5px solid #E6E8F3;
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.95em;
	background: #F6F7FC;
}

.aimp-field textarea:focus,
.aimp-field select:focus,
.aimp-field input:focus {
	outline: none;
	border-color: #4F46E5;
	background: #fff;
}

.aimp-row {
	display: flex;
	gap: 1em;
}

.aimp-field-half {
	flex: 1 1 0;
}

.aimp-hint {
	margin: 0.4em 0 0;
	font-size: 0.83em;
	color: #8B8FA3;
}

.aimp-cost-display {
	margin: 0.5em 0 1.1em;
	font-size: 0.92em;
	color: #4338CA;
	font-weight: 700;
	background: #EDECFC;
	padding: 0.6em 0.9em;
	border-radius: 10px;
	display: inline-block;
}

.aimp-credits-spent {
	font-size: 0.85em;
	color: #8B8FA3;
}

.aimp-submit {
	padding: 0.8em 1.6em;
	border: none;
	border-radius: 24px;
	background: #4F46E5;
	color: #fff;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s;
}

.aimp-submit:hover:not(:disabled) {
	background: #3D34C9;
}

.aimp-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.aimp-status {
	margin-top: 1em;
	font-style: normal;
	font-weight: 600;
	color: #565B71;
}

.aimp-progress-wrap {
	margin-bottom: 1em;
}

.aimp-progress-bar {
	width: 100%;
	height: 8px;
	background: #E6E8F3;
	border-radius: 6px;
	overflow: hidden;
}

.aimp-progress-fill {
	height: 100%;
	width: 0%;
	background: linear-gradient(120deg, #4F46E5, #0FBE8F);
	transition: width 0.4s ease;
}

.aimp-result-placeholder {
	border: 1.5px dashed #C9CBE0;
	border-radius: 16px;
	padding: 3em 1em;
	text-align: center;
	color: #8B8FA3;
	font-weight: 600;
	background: #F6F7FC;
}

.aimp-result {
	margin-top: 0;
}

.aimp-result-item {
	margin-bottom: 1em;
}

.aimp-result-pending {
	border: 1.5px dashed #C9CBE0;
	border-radius: 16px;
	padding: 2.5em 1em;
	text-align: center;
	color: #8B8FA3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75em;
	background: #F6F7FC;
}

.aimp-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #E6E8F3;
	border-top-color: #4F46E5;
	border-radius: 50%;
	animation: aimp-spin 0.8s linear infinite;
}

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

.aimp-result-caption {
	font-size: 0.9em;
	color: #8B8FA3;
}

.aimp-result-error {
	border: 1px solid #F7C1C1;
	background: #FCEBEB;
	color: #A32D2D;
	border-radius: 12px;
	padding: 1em;
	font-weight: 600;
}

.aimp-result-item img {
	max-width: 100%;
	border-radius: 12px;
	display: block;
	margin-bottom: 0.5em;
	border: 1px solid #E6E8F3;
}

.aimp-download {
	display: inline-block;
	padding: 0.6em 1.2em;
	background: #1B1E2B;
	color: #fff;
	text-decoration: none;
	border-radius: 20px;
	font-weight: 700;
	font-size: 0.9em;
}

.aimp-download:hover {
	background: #4F46E5;
}

.aimp-file-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-top: 0.5em;
}

.aimp-file-chip {
	display: flex;
	align-items: center;
	gap: 0.4em;
	background: #F6F7FC;
	border: 1px solid #E6E8F3;
	border-radius: 10px;
	padding: 0.3em 0.5em 0.3em 0.3em;
	max-width: 220px;
}

.aimp-file-chip img {
	width: 32px;
	height: 32px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}

.aimp-file-chip-name {
	font-size: 0.85em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aimp-file-chip-remove {
	border: none;
	background: none;
	color: #8B8FA3;
	cursor: pointer;
	font-size: 1.1em;
	line-height: 1;
	padding: 0 0.2em;
	flex-shrink: 0;
}

.aimp-file-chip-remove:hover {
	color: #A32D2D;
}
