/* AI Image Generator Suite — Frontend Dark Theme */

:root {
	--aigs-bg:           #0f0f13;
	--aigs-surface:      #1a1a22;
	--aigs-surface-2:    #222230;
	--aigs-border:       rgba(255,255,255,0.08);
	--aigs-accent:       #6c63ff;
	--aigs-accent-2:     #a78bfa;
	--aigs-text:         #e8e8f0;
	--aigs-text-muted:   #8888aa;
	--aigs-error:        #ef4444;
	--aigs-success:      #22c55e;
	--aigs-radius:       12px;
	--aigs-radius-sm:    8px;
	--aigs-shadow:       0 4px 24px rgba(0,0,0,0.4);
	--aigs-transition:   0.2s ease;
}

/* Wrapper — unified outer container */
.aigs-generator-wrap {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--aigs-text);
	line-height: 1.6;
	margin: 0 auto;
	background: var(--aigs-surface);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius);
	padding: 36px 40px 32px;
	box-shadow: var(--aigs-shadow);
}

/* Header: name + description inside the container */
.aigs-generator-header {
	margin-bottom: 28px;
}
.aigs-generator-title {
	font-size: 2rem;
	font-weight: 800;
	color: var(--aigs-text);
	margin: 0 0 8px !important;
	padding: 0 !important;
	line-height: 1.2;
	letter-spacing: -0.02em;
}
.aigs-generator-description {
	color: var(--aigs-text-muted);
	margin: 0 !important;
	font-size: 0.95rem;
}

/* Two-column layout */
.aigs-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	align-items: start;
}
@media (max-width: 768px) {
	.aigs-layout { grid-template-columns: 1fr; }
}

/* Input Panel — no individual box, right border acts as divider */
.aigs-input-panel {
	padding-right: 36px;
	border-right: 1px solid var(--aigs-border);
}

/* Form fields */
.aigs-field-wrap {
	margin-bottom: 20px;
}
.aigs-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--aigs-text);
	margin-bottom: 6px;
}
.aigs-required { color: var(--aigs-accent); margin-left: 2px; }
.aigs-help-text {
	font-size: 0.8rem;
	color: var(--aigs-text-muted);
	margin-top: 4px;
}

/* Text inputs */
.aigs-input,
.aigs-textarea,
.aigs-select {
	width: 100%;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	color: var(--aigs-text);
	padding: 10px 14px;
	font-size: 0.9rem;
	transition: border-color var(--aigs-transition);
	box-sizing: border-box;
	appearance: none;
}
.aigs-input:focus,
.aigs-textarea:focus,
.aigs-select:focus {
	outline: none;
	border-color: var(--aigs-accent);
	box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.aigs-textarea { resize: vertical; min-height: 80px; }
.aigs-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238888aa' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
	cursor: pointer;
}
.aigs-select option { background: var(--aigs-surface-2); color: var(--aigs-text); }

/* Radio pills */
.aigs-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.aigs-radio-label input[type="radio"] { position: absolute; opacity: 0; }
.aigs-radio-pill {
	display: inline-block;
	padding: 6px 16px;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.875rem;
	transition: all var(--aigs-transition);
}
.aigs-radio-label input[type="radio"]:checked + .aigs-radio-pill {
	background: var(--aigs-accent);
	border-color: var(--aigs-accent);
	color: #fff;
}

/* Checkboxes */
.aigs-checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.aigs-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.9rem;
}
.aigs-checkbox-label input[type="checkbox"] { accent-color: var(--aigs-accent); }

/* Slider */
.aigs-slider-wrap { display: flex; align-items: center; gap: 12px; }
.aigs-slider {
	flex: 1;
	-webkit-appearance: none;
	height: 4px;
	border-radius: 999px;
	background: var(--aigs-surface-2);
	outline: none;
	cursor: pointer;
}
.aigs-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: var(--aigs-accent);
	cursor: pointer;
}
.aigs-slider-value {
	min-width: 40px;
	text-align: right;
	font-weight: 600;
	color: var(--aigs-accent-2);
}

/* Toggle */
.aigs-toggle-wrap { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.aigs-toggle-input { position: absolute; opacity: 0; }
.aigs-toggle-track {
	width: 44px; height: 24px;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: 999px;
	position: relative;
	transition: background var(--aigs-transition);
	flex-shrink: 0;
}
.aigs-toggle-thumb {
	position: absolute;
	top: 3px; left: 3px;
	width: 16px; height: 16px;
	border-radius: 50%;
	background: var(--aigs-text-muted);
	transition: all var(--aigs-transition);
}
.aigs-toggle-input:checked ~ .aigs-toggle-track { background: var(--aigs-accent); border-color: var(--aigs-accent); }
.aigs-toggle-input:checked ~ .aigs-toggle-track .aigs-toggle-thumb { left: 23px; background: #fff; }
.aigs-toggle-field-label { font-size: 0.9rem; }

/* Color picker */
.aigs-color-picker-wrap { display: flex; align-items: center; gap: 10px; }
.aigs-color-input { width: 48px; height: 40px; border: none; border-radius: var(--aigs-radius-sm); cursor: pointer; background: none; padding: 0; }
.aigs-color-hex {
	width: 100px;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	color: var(--aigs-text);
	padding: 8px 10px;
	font-family: monospace;
}

/* Multi color */
.aigs-color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.aigs-color-swatch {
	width: 36px; height: 36px;
	border-radius: 50%;
	border: 3px solid transparent;
	cursor: pointer;
	transition: all var(--aigs-transition);
}
.aigs-color-swatch.selected { border-color: #fff; transform: scale(1.1); }
.aigs-custom-hex-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.aigs-custom-hex-input {
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	color: var(--aigs-text);
	padding: 6px 10px;
	width: 100px;
	font-family: monospace;
}
.aigs-add-custom-color {
	background: var(--aigs-surface-2) !important;
	border-color: var(--aigs-border) !important;
	color: var(--aigs-text) !important;
}
.aigs-selected-count { font-size: 0.8rem; color: var(--aigs-text-muted); margin-top: 4px; }

/* Style selector */
.aigs-style-selector { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.aigs-style-card {
	background: var(--aigs-surface-2);
	border: 2px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	padding: 12px 8px;
	text-align: center;
	cursor: pointer;
	transition: all var(--aigs-transition);
	overflow: hidden;
}
.aigs-style-card:hover { border-color: var(--aigs-accent-2); }
.aigs-style-card.selected { border-color: var(--aigs-accent); background: rgba(108,99,255,0.1); }
.aigs-style-preview {
	height: 60px;
	background-size: cover;
	background-position: center;
	border-radius: 4px;
	margin-bottom: 6px;
}
.aigs-style-card-label { font-size: 0.8rem; font-weight: 600; }

/* Divider & Heading */
.aigs-field-divider { border: none; border-top: 1px solid var(--aigs-border); margin: 20px 0; }
.aigs-field-heading { font-size: 0.95rem; font-weight: 700; color: var(--aigs-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 24px 0 12px; }

/* Generate button */
.aigs-form-footer { margin-top: 24px; }
.aigs-generate-btn {
	width: 100%;
	padding: 14px 24px;
	background: linear-gradient(135deg, var(--aigs-accent), var(--aigs-accent-2));
	color: #fff;
	border: none;
	border-radius: var(--aigs-radius-sm);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: opacity var(--aigs-transition), transform var(--aigs-transition);
	position: relative;
	overflow: hidden;
}
.aigs-generate-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.aigs-generate-btn:active { transform: translateY(0); }
.aigs-generate-btn[aria-busy="true"] { pointer-events: none; opacity: 0.8; }
.aigs-generate-btn[aria-busy="true"] .aigs-btn-text { display: none; }
.aigs-generate-btn:not([aria-busy="true"]) .aigs-btn-loading { display: none; }
.aigs-btn-loading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.aigs-spinner {
	width: 18px; height: 18px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: aigs-spin 0.7s linear infinite;
}
@keyframes aigs-spin { to { transform: rotate(360deg); } }

/* Result Panel — no individual box, lives inside the outer container */
.aigs-result-panel {
	padding-left: 36px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Visible box that always shows — placeholder, loader, image all inside.
   aspect-ratio is set inline from the generator's image_width/image_height config. */
.aigs-result-box {
	width: 100%;
	min-height: 180px; /* fallback for very narrow screens before aspect-ratio kicks in */
	background: var(--aigs-bg);
	border: 1.5px dashed rgba(255,255,255,0.12);
	border-radius: var(--aigs-radius);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	transition: border-color 0.3s ease, background 0.3s ease;
	overflow: hidden;
	position: relative;
}
.aigs-result-box.aigs-is-loading {
	border-color: rgba(108,99,255,0.35);
	border-style: solid;
	background: rgba(108,99,255,0.04);
}
/* When image is shown, remove dashed look */
.aigs-result-box:has(.aigs-result-images[style*="block"]),
.aigs-result-box:has(.aigs-result-images:not([style*="none"])) {
	border-style: solid;
	border-color: var(--aigs-border);
}

/* Mobile: stack panels and replace right border with a top border */
@media (max-width: 768px) {
	.aigs-input-panel {
		padding-right: 0;
		border-right: none;
		border-bottom: 1px solid var(--aigs-border);
		padding-bottom: 28px;
		margin-bottom: 28px;
	}
	.aigs-result-panel {
		padding-left: 0;
		padding-top: 0;
	}
	.aigs-generator-wrap {
		padding: 24px 20px;
	}
	.aigs-generator-title {
		font-size: 1.5rem;
	}
}

/* Placeholder */
.aigs-result-placeholder { text-align: center; color: var(--aigs-text-muted); }
.aigs-placeholder-icon { font-size: 3rem; display: block; margin-bottom: 12px; }

/* ── Interactive loader ──────────────────────────── */
.aigs-result-skeleton {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 28px;
	width: 100%;
}

/* Shimmer canvas behind the orb */
.aigs-loader-canvas {
	width: 100%;
	max-width: 320px;
	height: 220px;
	background: var(--aigs-surface-2);
	border-radius: var(--aigs-radius);
	border: 1px solid var(--aigs-border);
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Sweeping scan-line */
.aigs-loader-scan {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		transparent 0%,
		rgba(108,99,255,0.12) 48%,
		rgba(167,139,250,0.2) 50%,
		rgba(108,99,255,0.12) 52%,
		transparent 100%
	);
	animation: aigs-scan 2s ease-in-out infinite;
}
@keyframes aigs-scan {
	0%   { transform: translateY(-110%); }
	100% { transform: translateY(110%); }
}

/* Corner brackets */
.aigs-loader-canvas::before,
.aigs-loader-canvas::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	border-color: var(--aigs-accent);
	border-style: solid;
	opacity: 0.5;
}
.aigs-loader-canvas::before {
	top: 14px; left: 14px;
	border-width: 2px 0 0 2px;
	border-radius: 3px 0 0 0;
}
.aigs-loader-canvas::after {
	bottom: 14px; right: 14px;
	border-width: 0 2px 2px 0;
	border-radius: 0 0 3px 0;
}

/* Orb */
.aigs-loader-orb {
	width: 80px;
	height: 80px;
	position: relative;
	flex-shrink: 0;
}

.aigs-loader-ring {
	position: absolute;
	border-radius: 50%;
	border: 2px solid transparent;
}
.aigs-loader-ring-1 {
	inset: 0;
	border-top-color: var(--aigs-accent);
	border-right-color: rgba(108,99,255,0.3);
	animation: aigs-spin 1.4s linear infinite;
}
.aigs-loader-ring-2 {
	inset: 10px;
	border-top-color: var(--aigs-accent-2);
	border-left-color: rgba(167,139,250,0.3);
	animation: aigs-spin 0.9s linear infinite reverse;
}
.aigs-loader-ring-3 {
	inset: 22px;
	border-top-color: rgba(108,99,255,0.6);
	animation: aigs-spin 1.8s linear infinite;
}

/* Pulsing core dot */
.aigs-loader-core {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 12px;
	height: 12px;
	background: var(--aigs-accent);
	border-radius: 50%;
	box-shadow: 0 0 12px var(--aigs-accent), 0 0 24px rgba(108,99,255,0.4);
	animation: aigs-core-pulse 1.4s ease-in-out infinite;
}
@keyframes aigs-core-pulse {
	0%, 100% { transform: translate(-50%,-50%) scale(1);   opacity: 1; }
	50%       { transform: translate(-50%,-50%) scale(1.6); opacity: 0.6; }
}

/* "Generating..." label */
.aigs-loader-text {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--aigs-text-muted);
	letter-spacing: 0.04em;
	margin: 0;
}
.aigs-loader-dots span {
	opacity: 0;
	animation: aigs-dot-blink 1.5s infinite;
}
.aigs-loader-dots span:nth-child(2) { animation-delay: 0.25s; }
.aigs-loader-dots span:nth-child(3) { animation-delay: 0.5s; }
@keyframes aigs-dot-blink {
	0%, 70%, 100% { opacity: 0; }
	35%           { opacity: 1; }
}

/* Images grid — single layout fills the aspect-ratio box exactly */
.aigs-result-images { width: 100%; height: 100%; }
.aigs-images-grid.aigs-layout-single { height: 100%; }
.aigs-images-grid.aigs-layout-single img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: var(--aigs-radius-sm);
	display: block;
}
.aigs-images-grid.aigs-layout-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.aigs-images-grid.aigs-layout-grid img { width: 100%; border-radius: var(--aigs-radius-sm); display: block; }
.aigs-images-grid img { transition: opacity var(--aigs-transition); }

/* Action bar */
.aigs-action-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}
.aigs-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	color: var(--aigs-text);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: all var(--aigs-transition);
}
.aigs-action-btn:hover { border-color: var(--aigs-accent); color: var(--aigs-accent); }

/* Join Community button */
.aigs-join-community-btn {
	background: #25d366 !important;
	color: #fff !important;
	border-color: #1da851 !important;
}
.aigs-join-community-btn:hover {
	background: #1da851 !important;
	color: #fff !important;
	border-color: #1da851 !important;
}

/* Enhanced prompt */
.aigs-enhanced-prompt-details {
	margin-top: 14px;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	padding: 10px 14px;
}
.aigs-enhanced-prompt-details summary { cursor: pointer; font-size: 0.875rem; color: var(--aigs-text-muted); font-weight: 600; }
.aigs-enhanced-prompt-text { margin-top: 8px; font-size: 0.85rem; color: var(--aigs-text); line-height: 1.5; }

/* Error */
.aigs-result-error { text-align: center; color: var(--aigs-error); }
.aigs-error-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.aigs-error-message { margin-bottom: 14px; }

/* Field validation */
.aigs-field-wrap.aigs-field-invalid .aigs-input,
.aigs-field-wrap.aigs-field-invalid .aigs-textarea,
.aigs-field-wrap.aigs-field-invalid .aigs-select { border-color: var(--aigs-error); }
.aigs-validation-msg { color: var(--aigs-error); font-size: 0.8rem; margin-top: 4px; }

/* Character counter */
.aigs-char-counter {
	display: block;
	text-align: right;
	font-size: 0.78rem;
	color: var(--aigs-text-muted);
	margin-top: 4px;
}
.aigs-char-counter--near { color: #e6a817; }
.aigs-char-counter--at   { color: var(--aigs-error); font-weight: 700; }

/* Feedback bar */
.aigs-feedback-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 10px 16px;
	background: var(--aigs-surface-2);
	border: 1px solid var(--aigs-border);
	border-radius: var(--aigs-radius-sm);
	font-size: 0.875rem;
}
.aigs-feedback-label { color: var(--aigs-text-muted); flex-shrink: 0; }
.aigs-thumb-btn {
	background: none;
	border: 1px solid var(--aigs-border);
	border-radius: 8px;
	padding: 4px 12px;
	font-size: 1.25rem;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s, transform 0.1s;
	color: inherit;
}
.aigs-thumb-btn:hover:not(:disabled) { background: var(--aigs-surface); transform: scale(1.1); }
.aigs-thumb-btn.aigs-thumb-voted { background: var(--aigs-primary, #6c63ff); border-color: var(--aigs-primary, #6c63ff); }
.aigs-thumb-btn:disabled { opacity: 0.5; cursor: default; }
.aigs-feedback-thanks { color: var(--aigs-success, #4ade80); font-size: 0.85rem; font-weight: 600; }

/* ============================================================
   FEEDOUGH TEMPLATE — neobrutalist light theme
   Same HTML structure as Classic. All dark :root vars overridden.
   ============================================================ */

.aigs-template-feedough {
	background: #fff;
	border: 3px solid #2f2c29;
	border-radius: 22px;
	box-shadow: 8px 8px 0 #0f0f0f;
	padding: 0;
	overflow: visible;
	color: #252321;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.aigs-template-feedough .aigs-generator-header {
	padding: 28px 34px 22px;
	border-bottom: 3px solid #2f2c29;
	margin-bottom: 0;
}
.aigs-template-feedough .aigs-generator-title {
	color: #252321 !important;
	font-size: clamp(1.6rem, 2vw, 2.2rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.15;
	margin: 0 0 6px !important;
	padding: 0 !important;
}
.aigs-template-feedough .aigs-generator-description {
	color: #696561 !important;
	font-size: 0.95rem;
	margin: 0 !important;
}

/* Single-column layout: form on top, result below */
.aigs-template-feedough .aigs-layout {
	display: block;
}

/* Input panel */
.aigs-template-feedough .aigs-input-panel {
	padding: 30px 34px 34px;
	border-bottom: 3px solid #2f2c29;
}
@media (max-width: 768px) {
	.aigs-template-feedough .aigs-input-panel {
		padding: 24px 20px;
	}
}

/* Fixed-height typeform field area so the box never resizes between steps */
.aigs-template-feedough .aigs-tf-fields {
	min-height: 220px;
}

/* Labels */
.aigs-template-feedough .aigs-label {
	color: #272522 !important;
	font-size: 1rem;
	font-weight: 700;
	margin-bottom: 10px;
	display: block;
	line-height: 1.35;
}
.aigs-template-feedough .aigs-required { color: #f15a5c; }

/* Inputs */
.aigs-template-feedough .aigs-input,
.aigs-template-feedough .aigs-textarea,
.aigs-template-feedough .aigs-select {
	background: #f8f9fa !important;
	border: 3px solid #3a3734 !important;
	border-radius: 16px !important;
	color: #252321 !important;
	padding: 16px 18px !important;
	font-size: 1rem !important;
	box-shadow: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aigs-template-feedough .aigs-select {
	appearance: none !important;
	-webkit-appearance: none !important;
	background-color: #ffffff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23252321' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	background-size: 18px !important;
	border: 1.5px solid #d1d5db !important;
	border-radius: 10px !important;
	color: #252321 !important;
	padding: 14px 44px 14px 16px !important;
	font-size: 1rem !important;
	box-shadow: none !important;
	color-scheme: light;
	cursor: pointer;
}
.aigs-template-feedough .aigs-select:focus {
	outline: none !important;
	border-color: #9ca3af !important;
	box-shadow: none !important;
}
.aigs-template-feedough .aigs-select option,
.aigs-template-feedough .aigs-select optgroup {
	background: #ffffff !important;
	color: #252321 !important;
}
.aigs-template-feedough .aigs-input::placeholder,
.aigs-template-feedough .aigs-textarea::placeholder {
	color: #8c97ab;
	opacity: 1;
}
.aigs-template-feedough .aigs-input:focus,
.aigs-template-feedough .aigs-textarea:focus {
	outline: none !important;
	border-color: #1f1d1b !important;
	box-shadow: 0 0 0 4px rgba(200,29,49,0.08) !important;
}
.aigs-template-feedough .aigs-textarea { min-height: 140px; }

/* Field separators */
.aigs-template-feedough .aigs-field-wrap {
	padding: 18px 0;
	border-bottom: 1px solid #ddd;
}
.aigs-template-feedough .aigs-field-wrap:last-of-type { border-bottom: none; }
.aigs-template-feedough .aigs-help-text { color: #696561; font-size: 0.82rem; margin: 6px 0 0; }
.aigs-template-feedough .aigs-char-counter { color: #8c97ab; }
.aigs-template-feedough .aigs-char-counter--near { color: #d97706; }
.aigs-template-feedough .aigs-char-counter--at { color: #f15a5c; font-weight: 700; }

/* Radio pills */
.aigs-template-feedough .aigs-radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.aigs-template-feedough .aigs-radio-label { cursor: pointer; }
.aigs-template-feedough .aigs-radio-label input[type="radio"] {
	position: absolute; opacity: 0; width: 0; height: 0;
}
.aigs-template-feedough .aigs-radio-pill {
	display: inline-block;
	padding: 10px 18px;
	background: #f15a5c;
	color: #fff !important;
	border: 2px solid #2f2c29;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	box-shadow: 3px 3px 0 #0f0f0f;
}
.aigs-template-feedough .aigs-radio-label input[type="radio"]:checked + .aigs-radio-pill {
	background: #555;
}
.aigs-template-feedough .aigs-radio-label:hover .aigs-radio-pill {
	background: #337ab7;
}

/* Checkboxes */
.aigs-template-feedough .aigs-checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.aigs-template-feedough .aigs-checkbox-label {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border: 2px solid #3a3734;
	border-radius: 12px;
	cursor: pointer;
	color: #252321;
	font-size: 0.9rem;
	transition: border-color 0.15s ease;
}
.aigs-template-feedough .aigs-checkbox-label:hover { border-color: #f15a5c; }
.aigs-template-feedough .aigs-checkbox-label input[type="checkbox"] {
	accent-color: #f15a5c; width: 18px; height: 18px; flex-shrink: 0;
}

/* Slider */
.aigs-template-feedough .aigs-slider-wrap { display: flex; align-items: center; gap: 14px; }
.aigs-template-feedough .aigs-slider { accent-color: #f15a5c; }
.aigs-template-feedough .aigs-slider-value {
	min-width: 36px;
	padding: 4px 10px;
	background: #f15a5c;
	color: #fff;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 700;
	text-align: center;
}

/* Color picker */
.aigs-template-feedough .aigs-color-picker-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
}
.aigs-template-feedough .aigs-color-input {
	width: 48px !important;
	height: 48px !important;
	padding: 2px !important;
	border: 3px solid #3a3734 !important;
	border-radius: 10px !important;
	background: #fff !important;
	cursor: pointer;
	flex-shrink: 0;
}
.aigs-template-feedough .aigs-color-hex {
	background: #f8f9fa !important;
	border: 3px solid #3a3734 !important;
	border-radius: 12px !important;
	color: #252321 !important;
	padding: 12px 16px !important;
	font-size: 0.95rem !important;
	box-shadow: none !important;
	width: auto !important;
	flex: 1;
}
.aigs-template-feedough .aigs-color-hex:focus {
	outline: none !important;
	border-color: #1f1d1b !important;
	box-shadow: 0 0 0 4px rgba(200,29,49,0.08) !important;
}

/* Multi-color swatches */
.aigs-template-feedough .aigs-color-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}
.aigs-template-feedough .aigs-color-swatch {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 3px solid #fff;
	outline: 2px solid #3a3734;
	cursor: pointer;
	transition: outline-color 0.15s ease, transform 0.15s ease;
}
.aigs-template-feedough .aigs-color-swatch:hover {
	transform: scale(1.1);
	outline-color: #f15a5c;
}
.aigs-template-feedough .aigs-color-swatch.selected {
	outline-color: #f15a5c;
	outline-width: 3px;
	box-shadow: 0 0 0 3px rgba(241,90,92,0.25);
}
.aigs-template-feedough .aigs-custom-hex-row {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}
.aigs-template-feedough .aigs-custom-hex-input {
	background: #f8f9fa !important;
	border: 3px solid #3a3734 !important;
	border-radius: 12px !important;
	color: #252321 !important;
	padding: 10px 14px !important;
	font-size: 0.9rem !important;
	box-shadow: none !important;
	flex: 1;
}
.aigs-template-feedough .aigs-custom-hex-input::placeholder { color: #8c97ab; }
.aigs-template-feedough .aigs-custom-hex-input:focus {
	outline: none !important;
	border-color: #1f1d1b !important;
	box-shadow: 0 0 0 4px rgba(200,29,49,0.08) !important;
}
.aigs-template-feedough .aigs-add-custom-color {
	background: #fff !important;
	color: #252321 !important;
	border: 2px solid #2f2c29 !important;
	border-radius: 10px !important;
	box-shadow: 3px 3px 0 #0f0f0f !important;
	font-weight: 700 !important;
	font-size: 0.88rem !important;
	padding: 10px 16px !important;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease !important;
	height: auto !important;
}
.aigs-template-feedough .aigs-add-custom-color:hover {
	transform: translate(1px, 1px) !important;
	box-shadow: 2px 2px 0 #0f0f0f !important;
	background: #f0f1f3 !important;
}
.aigs-template-feedough .aigs-selected-count {
	color: #696561;
	font-size: 0.82rem;
	margin: 4px 0 0;
}

/* Style selector cards */
.aigs-template-feedough .aigs-style-selector {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 10px;
}
.aigs-template-feedough .aigs-style-card {
	border: 3px solid #3a3734 !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: #252321 !important;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	overflow: hidden;
	display: block !important;
	padding: 0 !important;
}
.aigs-template-feedough .aigs-style-card:hover {
	border-color: #f15a5c !important;
}
.aigs-template-feedough .aigs-style-card.selected {
	border-color: #f15a5c !important;
	box-shadow: 3px 3px 0 #f15a5c !important;
	background: #fff !important;
}
.aigs-template-feedough .aigs-style-preview {
	display: block;
	width: 100%;
	height: 72px !important;
	background-size: cover !important;
	background-position: center !important;
	margin: 0 !important;
	border-radius: 0 !important;
}
.aigs-template-feedough .aigs-style-card-label {
	display: block;
	background: #fff;
	color: #252321 !important;
	font-weight: 700;
	font-size: 0.8rem;
	padding: 6px 8px !important;
	text-align: center;
	border-top: 2px solid #e5e7eb;
	line-height: 1.2;
}

/* Toggle */
.aigs-template-feedough .aigs-toggle-track {
	background: #ddd;
	border: 2px solid #3a3734;
}
.aigs-template-feedough .aigs-toggle-input:checked + .aigs-toggle-track {
	background: #f15a5c;
	border-color: #2f2c29;
}
.aigs-template-feedough .aigs-toggle-field-label { color: #252321; }

/* Field heading / divider */
.aigs-template-feedough .aigs-field-heading { color: #252321; font-weight: 700; }
.aigs-template-feedough .aigs-field-divider { border-color: #ddd; }

/* Generate button */
.aigs-template-feedough .aigs-form-footer { margin-top: 24px; }
.aigs-template-feedough .aigs-generate-btn {
	width: 100%;
	min-height: 64px;
	padding: 16px 28px;
	background: #f15a5c !important;
	color: #fff !important;
	border: 3px solid #2f2c29 !important;
	border-radius: 16px !important;
	font-size: 1.05rem !important;
	font-weight: 800 !important;
	letter-spacing: -0.01em;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 6px 6px 0 #0f0f0f !important;
}
.aigs-template-feedough .aigs-generate-btn:hover {
	background: #000 !important;
	transform: translate(2px, 2px);
	box-shadow: 4px 4px 0 #0f0f0f !important;
}
.aigs-template-feedough .aigs-generate-btn:active {
	transform: translate(4px, 4px);
	box-shadow: 2px 2px 0 #0f0f0f !important;
}
.aigs-template-feedough .aigs-generate-btn[aria-busy="true"] {
	background: #c9c9c9 !important;
	border-color: #8f8a85 !important;
	color: #4a4642 !important;
	box-shadow: none !important;
	transform: none !important;
	pointer-events: none;
}

/* Result panel — hidden until first generation */
.aigs-template-feedough .aigs-result-panel {
	padding: 30px 34px 34px;
	display: none;
	flex-direction: column;
	gap: 16px;
}
@media (max-width: 768px) {
	.aigs-template-feedough .aigs-result-panel { padding: 24px 20px; }
}

/* Result box */
.aigs-template-feedough .aigs-result-box {
	background: #fff;
	border: 3px solid #3a3734;
	border-radius: 18px;
	color: #252321;
}
.aigs-template-feedough .aigs-result-placeholder {
	color: #696561;
}
.aigs-template-feedough .aigs-placeholder-icon { color: #f15a5c; }

/* Result images — left accent border like reference plugin */
.aigs-template-feedough .aigs-result-images {
	border-radius: 14px;
	overflow: hidden;
}

/* Error state */
.aigs-template-feedough .aigs-result-error {
	color: #d94446;
}

/* Action bar */
.aigs-template-feedough .aigs-action-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.aigs-template-feedough .aigs-action-btn {
	background: #f15a5c !important;
	color: #fff !important;
	border: 2px solid #2f2c29 !important;
	border-radius: 10px !important;
	box-shadow: 3px 3px 0 #0f0f0f !important;
	font-weight: 700;
	font-size: 0.88rem;
	padding: 8px 16px;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
	cursor: pointer;
	text-decoration: none;
}
.aigs-template-feedough .aigs-action-btn:hover {
	background: #d94446 !important;
	color: #fff !important;
	transform: translate(1px, 1px);
	box-shadow: 2px 2px 0 #0f0f0f !important;
}

/* Loader overrides — light neobrutalist style */
.aigs-template-feedough .aigs-loader-canvas {
	background: #f0f1f3;
	border: 3px solid #2f2c29;
	border-radius: 16px;
}
.aigs-template-feedough .aigs-loader-canvas::before,
.aigs-template-feedough .aigs-loader-canvas::after {
	border-color: #2f2c29;
	opacity: 0.4;
}
.aigs-template-feedough .aigs-loader-scan {
	background: linear-gradient(
		180deg,
		transparent 0%,
		rgba(241,90,92,0.1) 48%,
		rgba(241,90,92,0.22) 50%,
		rgba(241,90,92,0.1) 52%,
		transparent 100%
	);
}
.aigs-template-feedough .aigs-loader-ring-1 {
	border-top-color: #f15a5c;
	border-right-color: rgba(241,90,92,0.25);
}
.aigs-template-feedough .aigs-loader-ring-2 {
	border-top-color: #2f2c29;
	border-left-color: rgba(47,44,41,0.2);
}
.aigs-template-feedough .aigs-loader-ring-3 {
	border-top-color: rgba(241,90,92,0.5);
}
.aigs-template-feedough .aigs-loader-core {
	background: #f15a5c;
	box-shadow: 0 0 10px rgba(241,90,92,0.5), 0 0 20px rgba(241,90,92,0.25);
}
.aigs-template-feedough .aigs-loader-text {
	color: #696561;
}

/* Enhanced prompt details */
.aigs-template-feedough .aigs-enhanced-prompt-details {
	background: #fff;
	border: 2px solid #ddd;
	border-left: 4px solid #f15a5c;
	border-radius: 12px;
	padding: 12px 16px;
	color: #252321;
	font-size: 0.9rem;
}
.aigs-template-feedough .aigs-enhanced-prompt-details summary { font-weight: 700; cursor: pointer; color: #252321; }
.aigs-template-feedough .aigs-enhanced-prompt-text { color: #252321 !important; }

/* Feedback bar */
.aigs-template-feedough .aigs-feedback-bar {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
	color: #252321;
	gap: 10px;
}
.aigs-template-feedough .aigs-feedback-label { color: #252321; font-weight: 600; }
.aigs-template-feedough .aigs-thumb-btn {
	background: #25d366 !important;
	color: #fff !important;
	border: 2px solid #2f2c29 !important;
	border-radius: 10px !important;
	box-shadow: 3px 3px 0 #0f0f0f !important;
	padding: 8px 14px !important;
	font-size: 1.1rem !important;
	line-height: 1;
	transition: transform 0.12s ease, box-shadow 0.12s ease !important;
}
.aigs-template-feedough .aigs-thumb-down {
	background: #f15a5c !important;
}
.aigs-template-feedough .aigs-thumb-btn:hover:not(:disabled) {
	transform: translate(1px, 1px) !important;
	box-shadow: 2px 2px 0 #0f0f0f !important;
}
.aigs-template-feedough .aigs-thumb-btn:disabled { opacity: 0.5; }

/* Join community — pinned right */
.aigs-template-feedough .aigs-join-community-wrap {
	display: flex;
	justify-content: flex-end;
	margin-top: 4px;
}
.aigs-template-feedough .aigs-join-community-btn {
	margin-left: 0 !important;
	background: #f15a5c !important;
	border-color: #2f2c29 !important;
	box-shadow: 3px 3px 0 #0f0f0f !important;
}
.aigs-template-feedough .aigs-join-community-btn:hover {
	background: #d94446 !important;
	transform: translate(1px, 1px);
	box-shadow: 2px 2px 0 #0f0f0f !important;
}

/* Mobile: full container */
@media (max-width: 768px) {
	.aigs-template-feedough {
		border-radius: 18px;
		box-shadow: 5px 5px 0 #0f0f0f;
	}
}

/* ============================================================
   TYPEFORM MODE — works on Classic and Feedough templates
   ============================================================ */

/* Hide all steps except the active one */
.aigs-tf-fields .aigs-field-wrap {
	display: none;
}
.aigs-tf-fields .aigs-field-wrap[data-tf-active="1"] {
	display: block;
	animation: aigs-tf-slide-in 0.28s ease;
}
@keyframes aigs-tf-slide-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Progress bar */
.aigs-tf-progress-wrap {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 20px;
}
.aigs-tf-progress-track {
	flex: 1;
	height: 4px;
	background: var(--aigs-border);
	border-radius: 999px;
	overflow: hidden;
}
.aigs-tf-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--aigs-accent), var(--aigs-accent-2));
	border-radius: 999px;
	transition: width 0.3s ease;
}
.aigs-tf-step-count {
	font-size: 0.8rem;
	color: var(--aigs-text-muted);
	white-space: nowrap;
	font-weight: 600;
}
.aigs-tf-current { color: var(--aigs-accent); }

/* Feedough template typeform overrides */
.aigs-template-feedough .aigs-tf-progress-track { background: rgba(0,0,0,0.12); }
.aigs-template-feedough .aigs-tf-progress-fill { background: #f15a5c; }
.aigs-template-feedough .aigs-tf-step-count { color: #696561; }
.aigs-template-feedough .aigs-tf-current { color: #f15a5c; }

/* Navigation row */
.aigs-tf-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 20px;
	gap: 10px;
}
.aigs-tf-back-btn,
.aigs-tf-next-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: var(--aigs-radius-sm);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--aigs-transition);
	border: 1px solid var(--aigs-border);
}
.aigs-tf-back-btn {
	background: var(--aigs-surface-2);
	color: var(--aigs-text-muted);
}
.aigs-tf-back-btn:disabled { opacity: 0.35; cursor: default; }
.aigs-tf-next-btn {
	background: var(--aigs-accent);
	color: #fff;
	border-color: var(--aigs-accent);
	margin-left: auto;
}
.aigs-tf-next-btn:hover { opacity: 0.88; }

/* Feedough typeform nav buttons */
.aigs-template-feedough .aigs-tf-back-btn {
	background: #fff;
	color: #2f2c29;
	border: 2px solid #2f2c29;
	border-radius: 12px;
	box-shadow: 3px 3px 0 #0f0f0f;
}
.aigs-template-feedough .aigs-tf-back-btn:hover { background: #f0f1f3; }
.aigs-template-feedough .aigs-tf-back-btn:disabled { opacity: 0.35; box-shadow: none; }
.aigs-template-feedough .aigs-tf-next-btn {
	background: #f15a5c;
	color: #fff;
	border: 2px solid #2f2c29;
	border-radius: 12px;
	box-shadow: 3px 3px 0 #0f0f0f;
}
.aigs-template-feedough .aigs-tf-next-btn:hover {
	background: #d94446;
	transform: translate(1px, 1px);
	box-shadow: 2px 2px 0 #0f0f0f;
	opacity: 1;
}

/* Hide generate button until last step (handled by JS) */
.aigs-tf-submit-wrap { display: none; }
.aigs-tf-submit-wrap.aigs-tf-visible { display: block; }
