@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,500;0,600;1,500&family=Manrope:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

/* ==========================================================================
   Product Simulator — front-end wizard
   Design language: a cosmetics formulation lab — swatch cards, an
   editorial serif for questions, a running "Formula Ticket" that fills in
   with each answered step (the signature element).
   Tokens scoped to .psim-wizard-wrap so nothing leaks into the host theme.
   ========================================================================== */

.psim-wizard-wrap,
.psim-followup-wrap {
	--psim-ink: #2B1F2E;
	--psim-ink-muted: #7A6B76;
	--psim-porcelain: #F7F4F6;
	--psim-card: #FFFFFF;
	--psim-rose: #C6425F;
	--psim-rose-dark: #9E3049;
	--psim-sage: #6F8F72;
	--psim-line: #E6DEE2;
	--psim-danger: #B23A3A;
	--psim-radius: 16px;
	--psim-radius-sm: 10px;

	--psim-font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
	--psim-font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	--psim-font-mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;

	box-sizing: border-box;
	font-family: var(--psim-font-body);
	color: var(--psim-ink);
	background: var(--psim-porcelain);
	padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px));
	-webkit-tap-highlight-color: transparent;
	min-height: 100vh;
}
.psim-wizard-wrap *,
.psim-wizard-wrap *::before,
.psim-wizard-wrap *::after,
.psim-followup-wrap *,
.psim-followup-wrap *::before,
.psim-followup-wrap *::after {
	box-sizing: inherit;
}

/* Desktop viewports get extra breathing room above the wizard (e.g. to
   clear a fixed theme header) — mobile keeps the tighter default. */
@media (min-width: 1024px) {
	.psim-wizard-wrap {
		padding-top: 88px;
	}
}

.psim-shell {
	max-width: 640px;
	margin: 0 auto;
}

/* ==========================================================================
   Submission follow-up page — /submission/follow-up/{uuid}/{code}/
   ========================================================================== */
.psim-followup-field {
	margin-bottom: 18px;
}
.psim-followup-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 6px;
}
.psim-followup-readonly {
	width: 100%;
	border: 1.5px solid var(--psim-line);
	border-radius: var(--psim-radius-sm);
	padding: 11px 14px;
	font-size: 14px;
	font-family: var(--psim-font-mono);
	background: #EFEAEC;
	color: var(--psim-ink-muted);
}
.psim-editor {
	border: 1.5px solid var(--psim-line);
	border-radius: var(--psim-radius-sm);
	background: #fff;
	overflow: hidden;
}
.psim-editor-toolbar {
	display: flex;
	gap: 4px;
	padding: 8px;
	border-bottom: 1px solid var(--psim-line);
	background: var(--psim-porcelain);
}
.psim-editor-toolbar button {
	border: 1px solid transparent;
	background: transparent;
	border-radius: 6px;
	width: 30px;
	height: 30px;
	font-size: 14px;
	font-weight: 700;
	color: var(--psim-ink);
	cursor: pointer;
}
.psim-editor-toolbar button:hover {
	background: #fff;
	border-color: var(--psim-line);
}
.psim-editor-body {
	min-height: 160px;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.55;
	outline: none;
}
.psim-editor-body:empty::before {
	content: attr(data-placeholder);
	color: var(--psim-ink-muted);
}
.psim-followup-alert {
	border-radius: var(--psim-radius-sm);
	padding: 12px 14px;
	font-size: 13.5px;
	margin-bottom: 16px;
}
.psim-followup-alert.is-error {
	background: #FBEAEA;
	color: var(--psim-danger);
	border: 1px solid #f0c9c9;
}
.psim-followup-alert.is-success {
	background: #EFF4EF;
	color: #2f5233;
	border: 1px solid #cfe3d2;
}
.psim-followup-notfound {
	text-align: center;
	padding: 60px 20px;
}

/* ---- optional cover background image (standalone w/ header & footer) ---- */
.psim-has-bg-image {
	background-color: var(--psim-porcelain);
}
.psim-has-bg-image .psim-shell {
	background: rgba(255, 255, 255, 0.94);
	border-radius: var(--psim-radius);
	padding: 28px 22px;
	box-shadow: 0 18px 48px rgba(43, 31, 46, 0.16);
}
@media (max-width: 480px) {
	.psim-has-bg-image .psim-shell {
		padding: 22px 16px;
	}
}

/* ---- header ---- */
.psim-header {
	text-align: center;
	margin-bottom: 22px;
}
.psim-eyebrow {
	font-family: var(--psim-font-mono);
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--psim-rose);
	margin: 0 0 8px;
}
.psim-title {
	font-family: var(--psim-font-display);
	font-weight: 600;
	font-style: italic;
	font-size: 30px;
	line-height: 1.2;
	margin: 0 0 8px;
	color: var(--psim-ink);
}
.psim-subtitle {
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--psim-ink-muted);
	margin: 0 auto;
	max-width: 460px;
}

/* ---- progress ---- */
.psim-progress {
	margin-bottom: 16px;
}
.psim-progress-track {
	height: 6px;
	background: #fff;
	border: 1px solid var(--psim-line);
	border-radius: 999px;
	overflow: hidden;
}
.psim-progress-fill {
	height: 100%;
	background: var(--psim-rose);
	border-radius: 999px;
	transition: width 0.35s ease;
}
.psim-progress-label {
	font-family: var(--psim-font-mono);
	font-size: 11px;
	color: var(--psim-ink-muted);
	margin: 8px 0 0;
	text-align: center;
	letter-spacing: 0.04em;
}

/* ---- Formula Ticket (signature element) ---- */
.psim-ticket {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px 14px;
	scrollbar-width: thin;
}
.psim-ticket:empty {
	display: none;
}
.psim-ticket-chip {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid var(--psim-line);
	border-radius: 999px;
	padding: 5px 12px 5px 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--psim-ink);
	white-space: nowrap;
	animation: psim-chip-in 0.28s ease both;
}
.psim-ticket-chip img {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
}
.psim-ticket-chip .psim-chip-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--psim-sage);
	margin-left: 2px;
	margin-right: 2px;
}
@keyframes psim-chip-in {
	from { opacity: 0; transform: translateY(4px) scale(0.92); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- stage / card ---- */
.psim-stage {
	background: var(--psim-card);
	border: 1px solid var(--psim-line);
	border-radius: var(--psim-radius);
	padding: 26px 22px;
	min-height: 220px;
	position: relative;
	box-shadow: 0 1px 2px rgba(43, 31, 46, 0.04);
}

.psim-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: var(--psim-ink-muted);
	font-size: 14px;
	min-height: 168px;
}
.psim-spinner {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--psim-line);
	border-top-color: var(--psim-rose);
	animation: psim-spin 0.8s linear infinite;
}
@keyframes psim-spin {
	to { transform: rotate(360deg); }
}

.psim-step-question {
	font-family: var(--psim-font-display);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 18px;
	color: var(--psim-ink);
}
.psim-step-hint {
	font-size: 12.5px;
	color: var(--psim-ink-muted);
	margin: -10px 0 16px;
}

/* Step transition animation */
.psim-step-panel {
	animation: psim-step-in 0.32s ease both;
}
.psim-step-panel.psim-dir-back {
	animation-name: psim-step-in-back;
}
@keyframes psim-step-in {
	from { opacity: 0; transform: translateX(18px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes psim-step-in-back {
	from { opacity: 0; transform: translateX(-18px); }
	to { opacity: 1; transform: translateX(0); }
}

/* ---- option grid (single / multi) ---- */
.psim-option-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}
@media (max-width: 420px) {
	.psim-option-grid { grid-template-columns: 1fr; }
}

.psim-option-card {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid var(--psim-line);
	background: #fff;
	border-radius: var(--psim-radius-sm);
	padding: 10px 12px;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
	font-family: var(--psim-font-body);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--psim-ink);
}
.psim-option-card:active {
	transform: scale(0.98);
}
.psim-option-card.is-selected {
	border-color: var(--psim-rose);
	background: #FBF0F2;
}

.psim-option-thumb {
    width: 90px;
    height: 90px;
    border-radius: 10%;
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--psim-porcelain);
}

.psim-option-thumb-placeholder {
	width: 90px;
    height: 90px;
    border-radius: 10%;
	flex: 0 0 auto;
	background: var(--psim-porcelain);
	border: 1px solid var(--psim-line);
}
.psim-option-check {
	margin-left: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid var(--psim-line);
	flex: 0 0 auto;
	position: relative;
}
.psim-option-card.is-selected .psim-option-check {
	border-color: var(--psim-rose);
	background: var(--psim-rose);
}
.psim-option-card.is-selected .psim-option-check::after {
	content: '';
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: #fff;
}

/* ---- slider (rating) steps ---- */
.psim-slider-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.psim-slider-row label {
	display: block;
	font-size: 13.5px;
	font-weight: 700;
	margin-bottom: 8px;
}
.psim-slider-row input[type="range"] {
	width: 100%;
	accent-color: var(--psim-rose);
}
.psim-slider-scale {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--psim-ink-muted);
	margin-top: 4px;
}

/* ---- toggle (yes/no) steps ---- */
.psim-toggle-row {
	display: flex;
	gap: 10px;
}
.psim-toggle-btn {
	flex: 1 1 0;
	padding: 14px;
	border-radius: var(--psim-radius-sm);
	border: 1px solid var(--psim-line);
	background: #fff;
	font-family: var(--psim-font-body);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.psim-toggle-btn.is-selected {
	border-color: var(--psim-sage);
	background: #EFF4EF;
	color: #3E5A41;
}

/* ---- contact step ---- */
.psim-field {
	margin-bottom: 16px;
}
.psim-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 6px;
}
.psim-field input {
	width: 100%;
	font-family: var(--psim-font-body);
	font-size: 16px;
	padding: 12px 14px;
	border: 1px solid var(--psim-line);
	border-radius: var(--psim-radius-sm);
	background: #fff;
	min-height: 46px;
}
.psim-field input:focus {
	outline: none;
	border-color: var(--psim-rose);
	box-shadow: 0 0 0 3px rgba(198, 66, 95, 0.15);
}
.psim-field-error {
	color: var(--psim-danger);
	font-size: 12px;
	margin-top: 5px;
	display: block;
}

/* ---- nav buttons ---- */
.psim-nav {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}
.psim-btn {
	font-family: var(--psim-font-body);
	font-weight: 700;
	font-size: 14px;
	border-radius: var(--psim-radius-sm);
	padding: 13px 22px;
	cursor: pointer;
	border: none;
	touch-action: manipulation;
	transition: background 0.15s ease, transform 0.05s ease;
}
.psim-btn:active {
	transform: translateY(1px);
}
.psim-btn-back {
	background: #fff;
	border: 1px solid var(--psim-line);
	color: var(--psim-ink);
}
.psim-btn-next {
	margin-left: auto;
	background: var(--psim-rose);
	color: #fff;
	min-width: 120px;
}
.psim-btn-next:hover {
	background: var(--psim-rose-dark);
}
.psim-btn-next[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.psim-alert {
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: var(--psim-radius-sm);
	font-size: 13px;
}
.psim-alert-error {
	background: #FBEAEA;
	border: 1px solid #F0C6C6;
	color: var(--psim-danger);
}

/* ---- success screen ---- */
.psim-success {
	text-align: center;
	padding: 10px 4px;
}
.psim-success-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: #EFF4EF;
	color: var(--psim-sage);
	display: flex;
	align-items: center;
	justify-content: center;
}
.psim-success-title {
	font-family: var(--psim-font-display);
	font-size: 22px;
	font-weight: 600;
	margin: 0 0 10px;
}
.psim-success-ref {
	font-family: var(--psim-font-mono);
	font-size: 13px;
	background: var(--psim-porcelain);
	border: 1px solid var(--psim-line);
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	margin-bottom: 14px;
}
.psim-success-body {
	font-size: 14px;
	color: var(--psim-ink-muted);
	max-width: 420px;
	margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
	.psim-wizard-wrap * {
		animation: none !important;
		transition: none !important;
	}
}

/* ---- success-screen gallery (category-themed images) ---- */
.psim-success-gallery-label {
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--psim-ink-muted);
	margin: 26px auto 0;
}
.psim-success-gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	max-width: 480px;
	margin: 22px auto 0;
}
.psim-success-gallery img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--psim-radius-sm);
	border: 1px solid var(--psim-line);
}
@media (max-width: 480px) {
	.psim-success-gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}
