/* BaeMelody Questionnaire — mobile-first, brand-compliant */

:root {
	--bm-navy: #152033;
	--bm-ivory: #FFF9F4;
	--bm-blush: #F4D7DB;
	--bm-rose: #C96F7B;
	--bm-gold: #C8A56A;
	--bm-charcoal: #242424;
	--bm-white: #FFFFFF;
	--bm-error: #D94F4F;
	--bm-success: #4CAF7D;
	--bm-radius: 12px;
	--bm-shadow: 0 4px 24px rgba(21, 32, 51, 0.08);
	--bm-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======= Container ======= */

.bm-questionnaire {
	max-width: 640px;
	margin: 0 auto;
	padding: 24px 16px 40px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--bm-charcoal);
	-webkit-font-smoothing: antialiased;
}

/* ======= Progress bar ======= */

.bm-progress {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 32px;
}

.bm-progress__bar {
	flex: 1;
	height: 4px;
	background: var(--bm-blush);
	border-radius: 2px;
	overflow: hidden;
}

.bm-progress__fill {
	height: 100%;
	background: linear-gradient(90deg, var(--bm-rose), var(--bm-gold));
	border-radius: 2px;
	transition: width var(--bm-transition);
	width: 0%;
}

.bm-progress__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--bm-rose);
	white-space: nowrap;
	min-width: 48px;
	text-align: right;
}

/* ======= Step container ======= */

.bm-questionnaire .bm-step {
	display: none;
	animation: bmFadeIn 0.35s ease-out;
}

.bm-questionnaire .bm-step.bm-step--active {
	display: block;
}

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

.bm-step__title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 26px;
	font-weight: 700;
	color: var(--bm-navy);
	margin: 0 0 6px;
	line-height: 1.25;
}

.bm-step__subtitle {
	font-size: 14px;
	color: #666;
	margin: 0 0 24px;
	line-height: 1.5;
}

/* ======= Multi-field step layout ======= */

.bm-field-divider {
	border: none;
	border-top: 1px solid rgba(200, 165, 106, 0.2);
	margin: 24px 0;
}

.bm-field__title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 18px;
	font-weight: 600;
	color: var(--bm-navy);
	margin: 0 0 12px;
	line-height: 1.3;
}

/* ======= Option cards ======= */

.bm-options {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.bm-options--3col {
	grid-template-columns: repeat(3, 1fr);
}

.bm-option {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 12px;
	border: 2px solid #E8E4DF;
	border-radius: var(--bm-radius);
	background: var(--bm-white);
	cursor: pointer;
	text-align: center;
	font-size: 15px;
	font-weight: 500;
	color: var(--bm-charcoal);
	transition: all var(--bm-transition);
	min-height: 56px;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.bm-option:hover {
	border-color: var(--bm-gold);
	background: #FFFDF9;
}

.bm-option:active {
	transform: scale(0.97);
}

.bm-option.bm-option--selected {
	border-color: var(--bm-gold);
	background: linear-gradient(135deg, #FFF9F4, #FFF5EC);
	color: var(--bm-navy);
	box-shadow: 0 0 0 1px var(--bm-gold);
}

.bm-option.bm-option--selected::after {
	content: '✓';
	position: absolute;
	top: 6px;
	right: 8px;
	font-size: 12px;
	color: var(--bm-gold);
	font-weight: 700;
}

.bm-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* ======= Text inputs (Step 2) ======= */

.bm-input-wrap {
	position: relative;
}

.bm-input {
	width: 100%;
	padding: 16px 18px;
	border: 2px solid #E8E4DF;
	border-radius: var(--bm-radius);
	font-family: inherit;
	font-size: 16px;
	color: var(--bm-charcoal);
	background: var(--bm-white);
	transition: border-color var(--bm-transition);
	box-sizing: border-box;
	-webkit-appearance: none;
}

.bm-input:focus {
	outline: none;
	border-color: var(--bm-gold);
	box-shadow: 0 0 0 3px rgba(200, 165, 106, 0.15);
}

.bm-input::placeholder {
	color: #B0A89E;
}

.bm-input--error {
	border-color: var(--bm-error);
}

.bm-input--error:focus {
	box-shadow: 0 0 0 3px rgba(217, 79, 79, 0.15);
}

.bm-char-count {
	position: absolute;
	right: 14px;
	bottom: -22px;
	font-size: 12px;
	color: #999;
}

.bm-char-count--over {
	color: var(--bm-error);
	font-weight: 600;
}

/* ======= Textarea (Steps 7,8,10) ======= */

.bm-textarea {
	width: 100%;
	min-height: 140px;
	padding: 16px 18px;
	border: 2px solid #E8E4DF;
	border-radius: var(--bm-radius);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.6;
	color: var(--bm-charcoal);
	background: var(--bm-white);
	resize: vertical;
	transition: border-color var(--bm-transition);
	box-sizing: border-box;
	-webkit-appearance: none;
}

.bm-textarea:focus {
	outline: none;
	border-color: var(--bm-gold);
	box-shadow: 0 0 0 3px rgba(200, 165, 106, 0.15);
}

.bm-textarea::placeholder {
	color: #B0A89E;
}

/* ======= Chips input (Step 9) ======= */

.bm-chips-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 14px;
	border: 2px solid #E8E4DF;
	border-radius: var(--bm-radius);
	background: var(--bm-white);
	min-height: 52px;
	cursor: text;
	transition: border-color var(--bm-transition);
}

.bm-chips-wrap:focus-within {
	border-color: var(--bm-gold);
	box-shadow: 0 0 0 3px rgba(200, 165, 106, 0.15);
}

.bm-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 20px;
	background: var(--bm-blush);
	color: var(--bm-navy);
	font-size: 14px;
	font-weight: 500;
	animation: bmFadeIn 0.2s ease-out;
}

.bm-chip__remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border: none;
	border-radius: 50%;
	background: var(--bm-rose);
	color: var(--bm-white);
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background var(--bm-transition);
}

.bm-chip__remove:hover {
	background: var(--bm-navy);
}

.bm-chips-input {
	flex: 1;
	min-width: 100px;
	border: none;
	outline: none;
	font-family: inherit;
	font-size: 15px;
	background: transparent;
	color: var(--bm-charcoal);
}

.bm-chips-input::placeholder {
	color: #B0A89E;
}

.bm-chips-count {
	font-size: 12px;
	color: #999;
	margin-top: 6px;
}

/* ======= Dynamic prompts ======= */

.bm-dynamic-prompts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.bm-dynamic-prompt {
	padding: 8px 14px;
	border: 1px solid var(--bm-blush);
	border-radius: 20px;
	background: var(--bm-ivory);
	color: var(--bm-rose);
	font-size: 13px;
	cursor: pointer;
	transition: all var(--bm-transition);
}

.bm-dynamic-prompt:hover {
	background: var(--bm-blush);
	color: var(--bm-navy);
}

/* ======= Error message ======= */

.bm-error {
	color: var(--bm-error);
	font-size: 13px;
	font-weight: 500;
	margin-top: 8px;
	display: none;
}

.bm-error--visible {
	display: block;
	animation: bmFadeIn 0.2s ease-out;
}

/* ======= Navigation buttons ======= */

.bm-nav {
	display: flex;
	gap: 12px;
	margin-top: 32px;
}

.bm-btn {
	flex: 1;
	padding: 16px 24px;
	border: none;
	border-radius: var(--bm-radius);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--bm-transition);
	text-align: center;
	-webkit-tap-highlight-color: transparent;
}

.bm-btn:active {
	transform: scale(0.97);
}

.bm-btn--back {
	background: transparent;
	color: var(--bm-charcoal);
	border: 2px solid #E8E4DF;
	flex: 0 0 auto;
	padding: 16px 20px;
}

.bm-btn--back:hover {
	border-color: var(--bm-charcoal);
}

.bm-btn--next {
	background: var(--bm-navy);
	color: var(--bm-white);
}

.bm-btn--next:hover {
	background: #1D2D45;
	box-shadow: var(--bm-shadow);
}

.bm-btn--next:disabled,
.bm-btn--next.bm-btn--disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

.bm-btn--finalize {
	background: linear-gradient(135deg, var(--bm-gold), #D4B577);
	color: var(--bm-navy);
}

.bm-btn--finalize:hover {
	box-shadow: 0 4px 20px rgba(200, 165, 106, 0.4);
}

/* ======= Review step ======= */

.bm-review {
	background: var(--bm-ivory);
	border-radius: var(--bm-radius);
	padding: 24px;
	margin-bottom: 8px;
}

.bm-review__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 10px 0;
	border-bottom: 1px solid rgba(200, 165, 106, 0.2);
}

.bm-review__row:last-child {
	border-bottom: none;
}

.bm-review__label {
	font-size: 13px;
	color: #888;
	font-weight: 500;
}

.bm-review__value {
	font-size: 15px;
	color: var(--bm-navy);
	font-weight: 600;
	text-align: right;
	max-width: 60%;
	word-break: break-word;
}

.bm-review__edit {
	font-size: 13px;
	color: var(--bm-gold);
	cursor: pointer;
	text-decoration: none;
	margin-left: 8px;
	font-weight: 600;
}
.bm-review__edit:hover {
	color: var(--bm-rose);
}

/* ======= Inline tier picker (standalone page) ======= */

.bm-tier-picker {
	margin: 20px 0 8px;
	padding: 20px;
	background: var(--bm-ivory);
	border-radius: var(--bm-radius);
	border: 2px solid transparent;
	transition: border-color 0.3s, box-shadow 0.3s;
}

.bm-tier-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
}

.bm-tier-grid .bm-tier-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 16px 8px;
	background: #fff;
	border: 2px solid rgba(200, 165, 106, 0.25);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
	font-family: inherit;
}

/* The recommended tier reads as recommended before any card is picked. */
.bm-tier-grid .bm-tier-card--featured {
	border-color: var(--bm-gold);
}

.bm-tier-grid .bm-tier-card__badge {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--bm-gold);
	color: var(--bm-navy);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 3px 10px;
	border-radius: 999px;
	white-space: nowrap;
}

.bm-tier-grid .bm-tier-card:hover {
	border-color: var(--bm-gold);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(200, 165, 106, 0.15);
}

.bm-tier-grid .bm-tier-card--active {
	border-color: var(--bm-gold);
	background: linear-gradient(135deg, #FFF9F4, #FFF5E9);
	box-shadow: 0 0 0 3px rgba(200, 165, 106, 0.2);
}

.bm-tier-grid .bm-tier-card__name {
	font-size: 15px;
	font-weight: 700;
	color: var(--bm-navy);
}

.bm-tier-grid .bm-tier-card__price {
	font-size: 20px;
	font-weight: 800;
	color: var(--bm-gold);
}

.bm-tier-grid .bm-tier-card__desc {
	font-size: 11px;
	color: #888;
	text-align: center;
	line-height: 1.3;
}

@media (max-width: 480px) {
	.bm-tier-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.bm-tier-grid .bm-tier-card {
		flex-direction: row;
		justify-content: space-between;
		padding: 14px 16px;
		gap: 12px;
	}
	.bm-tier-grid .bm-tier-card__desc {
		text-align: right;
		flex: 1;
	}
}

/* ======= Loading state ======= */

.bm-loading {
	display: none;
	text-align: center;
	padding: 40px 20px;
}

.bm-loading--visible {
	display: block;
}

.bm-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--bm-blush);
	border-top-color: var(--bm-gold);
	border-radius: 50%;
	animation: bmSpin 0.8s linear infinite;
	margin: 0 auto 16px;
}

@keyframes bmSpin {
	to { transform: rotate(360deg); }
}

.bm-loading__text {
	font-size: 15px;
	color: var(--bm-charcoal);
}

/* ======= Optional badge ======= */

.bm-optional {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--bm-blush);
	color: var(--bm-rose);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-left: 8px;
	vertical-align: middle;
}

/* ======= Responsive ======= */

@media (min-width: 480px) {
	.bm-questionnaire {
		padding: 32px 24px 48px;
	}
	.bm-step__title {
		font-size: 30px;
	}
	.bm-options {
		gap: 14px;
	}
}

@media (min-width: 768px) {
	.bm-questionnaire {
		padding: 40px 32px 56px;
	}
	.bm-step__title {
		font-size: 34px;
	}
	.bm-options--wide {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ======= Accessibility ======= */

.bm-option:focus-within {
	outline: 2px solid var(--bm-gold);
	outline-offset: 2px;
}

.bm-btn:focus-visible {
	outline: 2px solid var(--bm-gold);
	outline-offset: 2px;
}

.bm-input:focus-visible,
.bm-textarea:focus-visible {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	.bm-step,
	.bm-chip,
	.bm-progress__fill {
		animation: none;
		transition: none;
	}
}

/* ======= Product page embed (in summary column) ======= */

.bm-product-questionnaire {
	margin: 1.5rem 0 2rem;
	padding: 1.5rem;
	background: var(--bm-ivory);
	border-radius: var(--bm-radius);
	border: 1px solid rgba(200, 165, 106, 0.25);
}

.bm-product-questionnaire__title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 22px;
	color: var(--bm-navy);
	text-align: center;
	margin: 0 0 0.25rem;
}

.bm-product-questionnaire__sub {
	font-size: 14px;
	color: #666;
	text-align: center;
	margin: 0 0 1rem;
	line-height: 1.5;
}

.bm-product-questionnaire .bm-questionnaire {
	padding: 16px 0 24px;
}

/* ======= Product page showcase ======= */

.bm-product-showcase {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem 3rem;
}

.bm-showcase__title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: clamp(1.5rem, 3vw, 2rem);
	color: var(--bm-navy);
	text-align: center;
	margin: 2.5rem 0 0.5rem;
}

.bm-showcase__sub {
	font-size: 1rem;
	color: var(--bm-rose);
	text-align: center;
	margin: 0 0 2rem;
}

.bm-showcase__features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.25rem;
	margin-bottom: 2rem;
}

.bm-showcase__feature {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding: 1.25rem;
	background: var(--bm-ivory);
	border-radius: var(--bm-radius);
	border: 1px solid rgba(200, 165, 106, 0.2);
}

.bm-showcase__feature strong {
	display: block;
	font-size: 1rem;
	color: var(--bm-navy);
	margin-bottom: 0.25rem;
}

.bm-showcase__feature p {
	font-size: 0.9rem;
	color: var(--bm-charcoal);
	line-height: 1.5;
	margin: 0;
}

.bm-showcase__icon {
	font-size: 1.5rem;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bm-navy);
	border-radius: 50%;
	color: var(--bm-gold);
}

.bm-showcase__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1rem;
}

.bm-showcase__img {
	width: 100%;
	height: auto;
	border-radius: var(--bm-radius);
	object-fit: cover;
	aspect-ratio: 1;
}

.bm-showcase__tiers-hint {
	margin-top: 1.25rem;
	padding: 1rem 1.25rem;
	background: var(--bm-surface, #f8f9fa);
	border-radius: var(--bm-radius, 8px);
	border-left: 3px solid var(--bm-accent, #C8A56A);
}

.bm-showcase__tiers-hint p {
	margin: 0 0 0.4rem;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--bm-text-muted, #666);
}

.bm-showcase__tiers-hint p:last-child {
	margin-bottom: 0;
}

.bm-showcase__tiers-hint strong {
	color: var(--bm-text, #152033);
}

.bm-showcase__styles {
	margin-top: 1rem;
}

.bm-showcase__styles-img {
	width: 100%;
	max-width: 800px;
	height: auto;
	display: block;
	margin: 0 auto;
	border-radius: var(--bm-radius);
}

/* Screen reader only */
.bm-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Photo upload step */
.bm-option--wide {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 180px;
}

.bm-drop-zone {
	border: 2px dashed var(--bm-gold);
	border-radius: 12px;
	padding: 32px 20px;
	text-align: center;
	background: rgba(200, 165, 106, 0.04);
	transition: border-color 0.2s, background 0.2s;
	cursor: pointer;
}

.bm-drop-zone--hover {
	border-color: var(--bm-rose);
	background: rgba(201, 111, 123, 0.06);
}

.bm-drop-zone--has-photo {
	border-style: solid;
	border-color: var(--bm-gold);
	padding: 16px;
}

.bm-drop-zone__preview {
	max-width: 240px;
	max-height: 240px;
	border-radius: 8px;
	object-fit: cover;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.bm-drop-zone__icon { line-height: 1; }

.bm-drop-zone__text {
	font-size: 15px;
	font-weight: 500;
	color: var(--bm-navy);
	margin: 8px 0 4px;
}

.bm-drop-zone__sub {
	font-size: 12px;
	color: #999;
	margin: 4px 0 12px;
}

.bm-btn--secondary {
	background: transparent;
	color: var(--bm-gold);
	border: 2px solid var(--bm-gold);
	border-radius: 8px;
	padding: 8px 20px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s;
}

.bm-btn--secondary:hover {
	background: var(--bm-gold);
	color: #fff;
}

.bm-btn--small {
	font-size: 12px;
	padding: 6px 14px;
	background: transparent;
	color: var(--bm-rose);
	border: 1px solid var(--bm-rose);
	border-radius: 6px;
	cursor: pointer;
}

.bm-btn--small:hover {
	background: var(--bm-rose);
	color: #fff;
}

/* ======= Express delivery option ======= */

.bm-option--express {
	border: 2px solid var(--bm-gold);
	background: linear-gradient(135deg, #FFF9F4 0%, #FFF5E9 100%);
	position: relative;
}

.bm-option--express.bm-option--selected {
	border-color: var(--bm-gold);
	background: linear-gradient(135deg, #FFF5E9 0%, #FFEFD5 100%);
	box-shadow: 0 0 0 2px rgba(200, 165, 106, 0.25);
}

.bm-express-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.bm-express-price {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	color: var(--bm-gold);
	background: rgba(200, 165, 106, 0.15);
	padding: 1px 8px;
	border-radius: 10px;
	margin-top: 2px;
}

/* ====== OFFER BAR ======
   Keeps the price, the deadline and the rating in view across all nine steps.
   Before this, the reward disappeared the moment someone left the landing page, so
   the form asked for a lot of emotional work with nothing on screen saying what it
   bought. Values are rendered server-side from live WooCommerce data, so the bar
   self-expires when the sale does. */
.bm-qbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem 0.75rem;
	max-width: 680px;
	margin: 0 auto 1.75rem;
	padding: 0.7rem 1rem;
	border: 1px solid rgba(200, 165, 106, 0.45);
	border-radius: 100px;
	background: #FFF9F4;
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 0.9rem;
	color: #242424;
	text-align: center;
}
.bm-qbar__price { font-size: 1.1rem; font-weight: 700; }
.bm-qbar__was { opacity: 0.6; text-decoration: line-through; }
.bm-qbar__sale {
	padding: 0.2rem 0.6rem;
	border-radius: 100px;
	background: #C8A56A;
	color: #1b1200;
	font-weight: 700;
	font-size: 0.8rem;
	white-space: nowrap;
}
.bm-qbar__stars { color: #C8A56A; letter-spacing: 0.06em; }
.bm-qbar__proof { white-space: nowrap; }
.bm-qbar__sep { opacity: 0.35; }
/* The one thing a nine-step form must promise before someone starts typing. */
.bm-qbar__note {
	flex-basis: 100%;
	font-size: 0.78rem;
	opacity: 0.7;
}
@media (max-width: 560px) {
	.bm-qbar {
		border-radius: 14px;
		gap: 0.3rem 0.6rem;
		font-size: 0.85rem;
	}
	.bm-qbar__price { font-size: 1rem; }
	.bm-qbar__sale { font-size: 0.74rem; }
}
