/**
 * Excel Mobility Advisor — frontend wizard styles.
 * Reuses the theme's existing CSS custom properties, same approach as the
 * Online Shop plugin, with sensible fallbacks if they're not present.
 */

.ema-wizard {
	--_primary: var(--color-primary, #0B3A67);
	--_primary-dark: var(--color-primary-dark, #082846);
	--_secondary: var(--color-secondary, #C9A227);
	--_bg-light: var(--color-bg-light, #F6F7F9);
	--_text-muted: var(--color-text-muted, #5B6472);
	--_border: var(--color-border, #E5E8EC);
	--_radius-md: var(--radius-md, 16px);
	--_radius-pill: var(--radius-pill, 999px);
	--_shadow-sm: var(--shadow-sm, 0 2px 8px rgba(15,23,42,0.06));
	--_shadow-lg: var(--shadow-lg, 0 16px 48px rgba(15,23,42,0.12));
	--_font-heading: var(--font-heading, sans-serif);
	--_space-sm: var(--space-sm, 1rem);
	--_space-md: var(--space-md, 1.5rem);
	--_space-lg: var(--space-lg, 2.5rem);
	max-width: 760px;
	margin-inline: auto;
}

.ema-wizard__progress-bar {
	height: 6px;
	border-radius: var(--_radius-pill);
	background: var(--_bg-light);
	overflow: hidden;
	margin-bottom: 0.5rem;
}

.ema-wizard__progress-fill {
	height: 100%;
	width: 0%;
	background: var(--_secondary);
	transition: width 250ms ease;
}

.ema-wizard__progress-text {
	font-size: 0.85rem;
	color: var(--_text-muted);
}

.ema-wizard__step {
	margin-top: var(--_space-lg);
}

.ema-wizard__question {
	font-family: var(--_font-heading);
	color: var(--_primary-dark);
}

.ema-wizard__knowledge-panel {
	background: var(--_bg-light);
	border-radius: var(--_radius-md);
	padding: 0.75rem 1rem;
	margin: 0.75rem 0;
	font-size: 0.9rem;
}

.ema-wizard__knowledge-panel summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--_primary);
}

.ema-wizard__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: var(--_space-sm);
	margin-top: var(--_space-sm);
}

.ema-wizard__option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border: 2px solid var(--_border);
	border-radius: var(--_radius-md);
	padding: 0.75rem 1rem;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease;
}

.ema-wizard__option:hover {
	border-color: var(--_primary);
}

.ema-wizard__option input[type="radio"] {
	accent-color: var(--_primary);
}

.ema-wizard__option:has(input:checked) {
	border-color: var(--_primary);
	background: var(--_bg-light);
}

.ema-wizard__option-icon {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

.ema-wizard__option--unsure {
	border-style: dashed;
	color: var(--_text-muted);
}

.ema-wizard__calculator {
	margin-top: var(--_space-sm);
}

.ema-wizard__calculator-toggle {
	background: none;
	border: none;
	color: var(--_primary);
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.ema-wizard__calculator-panel {
	background: var(--_bg-light);
	border-radius: var(--_radius-md);
	padding: var(--_space-sm) var(--_space-md);
	margin-top: 0.75rem;
}

.ema-wizard__calculator-panel label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--_text-muted);
	margin-bottom: 0.75rem;
}

.ema-wizard__calculator-panel input,
.ema-wizard__calculator-panel select {
	display: block;
	width: 100%;
	max-width: 280px;
	margin-top: 0.25rem;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--_border);
	border-radius: 8px;
	font-weight: 400;
	color: inherit;
}

.ema-wizard__calculator-apply {
	background: var(--_primary);
	color: #fff;
	border: none;
	border-radius: var(--_radius-pill);
	padding: 0.55rem 1.1rem;
	font-weight: 600;
	cursor: pointer;
}

.ema-wizard__calculator-result {
	font-weight: 700;
	color: var(--_primary-dark);
	margin-top: 0.75rem;
}

.ema-wizard__nav {
	display: flex;
	justify-content: space-between;
	margin-top: var(--_space-lg);
}

.ema-wizard__back,
.ema-wizard__next,
.ema-wizard__submit {
	font-family: var(--_font-heading);
	font-weight: 600;
	padding: 0.75rem 1.5rem;
	border-radius: var(--_radius-pill);
	border: none;
	cursor: pointer;
}

.ema-wizard__back {
	background: transparent;
	color: var(--_primary);
	border: 2px solid var(--_border);
}

.ema-wizard__back:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.ema-wizard__next,
.ema-wizard__submit {
	background: var(--_primary);
	color: #fff;
	margin-left: auto;
}

.ema-wizard__next:hover,
.ema-wizard__submit:hover {
	background: var(--_primary-dark);
}

.ema-wizard__loading {
	text-align: center;
	padding: var(--_space-lg);
	color: var(--_text-muted);
}

/* Results */
.ema-results__heading {
	font-family: var(--_font-heading);
	color: var(--_primary-dark);
	text-align: center;
}

.ema-results__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--_space-md);
	margin-top: var(--_space-md);
}

.ema-results__card {
	position: relative;
	background: #fff;
	border-radius: var(--_radius-md);
	box-shadow: var(--_shadow-sm);
	padding: var(--_space-md);
}

.ema-results__tier-badge {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: var(--_secondary);
	color: var(--_primary-dark);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 0.25rem 0.6rem;
	border-radius: var(--_radius-pill);
}

.ema-results__image img {
	width: 100%;
	aspect-ratio: 4/3;
	object-fit: cover;
	border-radius: var(--_radius-md);
	margin-bottom: 0.75rem;
}

.ema-results__title {
	font-family: var(--_font-heading);
	color: var(--_primary-dark);
	margin: 0 0 0.25rem;
}

.ema-results__confidence {
	display: inline-block;
	background: var(--_bg-light);
	color: var(--_primary);
	font-weight: 700;
	font-size: 0.85rem;
	padding: 0.2rem 0.6rem;
	border-radius: var(--_radius-pill);
	margin-bottom: 0.5rem;
}

.ema-results__why {
	font-size: 0.85rem;
	color: var(--_text-muted);
	padding-left: 1.1rem;
	margin: 0.5rem 0;
}

.ema-results__actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: var(--_space-sm);
}

.ema-results__button {
	display: inline-block;
	background: var(--_primary);
	color: #fff;
	font-weight: 600;
	font-size: 0.875rem;
	padding: 0.6rem 1.1rem;
	border-radius: var(--_radius-pill);
	text-decoration: none;
}

.ema-results__button--outline {
	background: transparent;
	color: var(--_primary);
	border: 2px solid var(--_primary);
}

.ema-results__escalation {
	text-align: center;
	margin-top: var(--_space-lg);
	padding-top: var(--_space-lg);
	border-top: 1px solid var(--_border);
}
