/**
 * BaeLetter questionnaire editor — product page styles.
 * Follows Gift Finder card-question UI pattern. Mobile-first. Brand palette.
 */

.baeletter-editor {
	max-width: 560px;
	margin: 24px auto;
	padding: 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Step container --- */
.bl-step { animation: bl-fadeIn 0.4s ease; }

@keyframes bl-fadeIn {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --- Progress bar --- */
.bl-step-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}
.bl-step-number {
	font-size: 0.8rem;
	color: #777;
	white-space: nowrap;
}
.bl-progress {
	flex: 1;
	height: 4px;
	background: #e5e5e5;
	border-radius: 2px;
	overflow: hidden;
}
.bl-progress-fill {
	height: 100%;
	background: #C8A56A;
	border-radius: 2px;
	transition: width 0.4s ease;
}

/* --- Question heading --- */
.bl-question {
	font-size: 1.25rem;
	font-weight: 500;
	color: #152033;
	margin-bottom: 20px;
	line-height: 1.4;
}
.bl-hint {
	font-size: 0.9rem;
	color: #777;
	margin: -12px 0 20px;
}

/* --- Option cards (radio grid) --- */
.bl-options-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 10px;
	margin-bottom: 24px;
}
.bl-options-compact {
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.bl-option-card {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 12px;
	border: 2px solid #e5e5e5;
	border-radius: 10px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
	user-select: none;
}
.bl-option-card:hover {
	border-color: #C8A56A;
	background: rgba(200,165,106,0.04);
}
.bl-option-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.bl-option-card:has(input:checked) {
	border-color: #C8A56A;
	background: rgba(200,165,106,0.08);
	box-shadow: 0 0 0 1px #C8A56A;
}
.bl-option-label {
	font-size: 0.9rem;
	font-weight: 400;
	color: #242424;
	line-height: 1.3;
}

/* --- Form fields --- */
.bl-field {
	margin-bottom: 20px;
}
.bl-field label {
	display: block;
	font-size: 0.9rem;
	font-weight: 500;
	color: #242424;
	margin-bottom: 6px;
}
.bl-required { color: #C96F7B; }
.bl-optional { font-weight: 300; color: #999; font-size: 0.85rem; }

.bl-field input[type="text"],
.bl-field input[type="email"],
.bl-field input[type="date"],
.bl-field input[type="password"],
.bl-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
	color: #242424;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
}
.bl-field input:focus,
.bl-field textarea:focus {
	border-color: #C8A56A;
	box-shadow: 0 0 0 2px rgba(200,165,106,0.15);
}
.bl-field textarea {
	resize: vertical;
	min-height: 180px;
	line-height: 1.7;
}
.bl-char-count {
	display: block;
	text-align: right;
	font-size: 0.78rem;
	color: #999;
	margin-top: 4px;
}

/* --- Buttons --- */
.bl-nav {
	display: flex;
	gap: 12px;
	margin-top: 24px;
}
.bl-btn {
	padding: 12px 28px;
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, opacity 0.2s;
	border: none;
}
.bl-btn-next {
	background: #C8A56A;
	color: #fff;
	margin-left: auto;
}
.bl-btn-next:hover { background: #b8955a; }
.bl-btn-next:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.bl-btn-back {
	background: transparent;
	color: #777;
	border: 1px solid #ddd;
}
.bl-btn-back:hover {
	background: #f5f5f5;
}

/* --- Review card --- */
.bl-review-card {
	background: #FAFAFA;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 20px;
	margin-bottom: 24px;
}
.bl-review-row {
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 0.9rem;
}
.bl-review-row:last-child { border-bottom: none; }
.bl-review-label {
	font-weight: 500;
	color: #555;
	display: inline-block;
	min-width: 80px;
}
.bl-review-letter {
	display: block;
}
#bl-review-letter-preview {
	margin-top: 8px;
	padding: 0;
	background: transparent;
	border-radius: 0;
	font-size: inherit;
	color: inherit;
	line-height: inherit;
}

/* --- Suggestion pills --- */
.bl-starters {
	margin-bottom: 10px;
}
.bl-starters-label {
	display: block;
	font-size: 0.8rem;
	color: #999;
	margin-bottom: 8px;
}
.bl-starters-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 4px;
}
.bl-pill {
	display: inline-block;
	padding: 6px 14px;
	background: rgba(200,165,106,0.08);
	border: 1px solid rgba(200,165,106,0.3);
	border-radius: 20px;
	font-size: 0.8rem;
	color: #555;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	line-height: 1.4;
}
.bl-pill:hover {
	background: rgba(200,165,106,0.18);
	border-color: #C8A56A;
	color: #242424;
}
.bl-signoff-suggestions {
	margin-bottom: 8px;
}

/* --- Extras section --- */
.bl-extras {
	margin-bottom: 20px;
}
.bl-extras h4 {
	font-size: 1rem;
	font-weight: 500;
	color: #242424;
	margin-bottom: 16px;
}

/* --- Themed preview (Step 5) --- */
.bl-preview-themed {
	animation: bl-fadeIn 0.6s ease;
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}
.bl-preview-label {
	text-align: center;
	font-size: 0.75rem;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 12px;
}
.bl-preview-card {
	background: #152033;
	color: #FFF9F4;
	border-radius: 12px;
	padding: 32px 24px;
	font-family: 'Inter', -apple-system, sans-serif;
	line-height: 1.8;
	position: relative;
	overflow: hidden;
}
.bl-preview-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #C8A56A, #C96F7B, #C8A56A);
}
.bl-preview-greeting {
	font-family: 'Great Vibes', cursive, serif;
	font-size: 1.3rem;
	color: #F4D7DB;
	margin-bottom: 16px;
}
.bl-preview-body {
	font-size: 0.88rem;
	font-weight: 300;
	line-height: 1.9;
	white-space: pre-wrap;
	margin-bottom: 20px;
	color: rgba(255,249,244,0.9);
}
.bl-preview-signoff {
	font-family: 'Great Vibes', cursive, serif;
	font-size: 1.1rem;
	color: #F4D7DB;
	margin-bottom: 4px;
}
.bl-preview-sender {
	font-family: 'Great Vibes', cursive, serif;
	font-size: 1.4rem;
	color: #C8A56A;
}

/* --- AI Writing Assistant --- */
.bl-ai-helper {
	margin-bottom: 14px;
	padding: 16px;
	background: linear-gradient(135deg, rgba(200,165,106,0.06) 0%, rgba(201,111,123,0.06) 100%);
	border: 1px solid rgba(200,165,106,0.2);
	border-radius: 10px;
}
.bl-ai-label {
	font-size: 0.78rem;
	font-weight: 600;
	color: #C8A56A;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.bl-ai-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.bl-ai-btn {
	padding: 8px 16px;
	background: #152033;
	color: #FFF9F4;
	border: 1px solid rgba(200,165,106,0.3);
	border-radius: 20px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.bl-ai-btn:hover {
	background: #1e2d45;
	border-color: #C8A56A;
	transform: translateY(-1px);
}
.bl-ai-btn:active {
	transform: translateY(0);
}
.bl-ai-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}
.bl-ai-btn-improve {
	background: transparent;
	color: #152033;
	border-color: rgba(21,32,51,0.2);
}
.bl-ai-btn-improve:hover {
	background: rgba(21,32,51,0.06);
	border-color: #152033;
}
.bl-ai-status {
	margin-top: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
	color: #C8A56A;
}
.bl-ai-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(200,165,106,0.2);
	border-top-color: #C8A56A;
	border-radius: 50%;
	animation: bl-spin 0.8s linear infinite;
}
@keyframes bl-spin {
	to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 480px) {
	.baeletter-editor { margin: 16px auto; }
	.bl-options-grid { grid-template-columns: repeat(2, 1fr); }
	.bl-question { font-size: 1.1rem; }
	.bl-btn { padding: 12px 20px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
	.bl-step { animation: none; }
}
