/* SWPA Frontend Advisor Styles - Mobile First */

:root {
	--swpa-primary: #6a1b9a;
	--swpa-text: #333;
	--swpa-text-light: #666;
	--swpa-bg: #f9f9f9;
	--swpa-border: #ddd;
	--swpa-white: #fff;
	--swpa-error: #dc3545;
	--swpa-success: #28a745;
}


.swpa-app {
	--swpa-spacing: 16px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
	color: var(--swpa-text);
	background: var(--swpa-white);
}

/* Wizard Container */

.swpa-wizard {
	max-width: 600px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	position: relative;
}

/* Progress Bar */

.swpa-progress-bar {
	width: 100%;
	height: 4px;
	background: var(--swpa-bg);
	border: 1px solid var(--swpa-border);
	position: relative;
	overflow: hidden;
}

.swpa-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--swpa-primary), var(--swpa-primary));
	width: 0%;
	transition: width 0.3s ease;
}

/* Main Content Area */

.swpa-wizard-content {
	flex: 1;
	overflow-y: auto;
	padding: var(--swpa-spacing);
}

.swpa-step-container {
	min-height: 300px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.swpa-step {
	animation: swpaFadeIn 0.3s ease;
}

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

.swpa-step-title {
	font-size: 28px;
	font-weight: 600;
	margin: 0 0 var(--swpa-spacing) 0;
	color: var(--swpa-text);
	line-height: 1.3;
}

.swpa-step-description {
	font-size: 16px;
	color: var(--swpa-text-light);
	margin: 0 0 24px 0;
	line-height: 1.5;
}

/* Input Fields */

.swpa-input {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid var(--swpa-border);
	border-radius: 6px;
	font-size: 16px;
	font-family: inherit;
	color: var(--swpa-text);
	background: var(--swpa-white);
	transition: all 0.2s;
	box-sizing: border-box;
}

.swpa-input:focus {
	outline: none;
	border-color: var(--swpa-primary);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}


/* Choice Field (Radio Buttons as Cards) */

.swpa-choices {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--swpa-spacing);
}

.swpa-choice {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 20px;
	border: 2px solid var(--swpa-border);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
	background: var(--swpa-white);
	text-align: center;
	user-select: none;
}

.swpa-choice:hover {
	border-color: var(--swpa-primary);
	background: rgba(0, 0, 0, 0.02);
}


.swpa-choice:focus {
	outline: none;
	border-color: var(--swpa-primary);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}


.swpa-choice-selected {
	border-color: var(--swpa-primary);
	background: rgba(0, 0, 0, 0.02);
	box-shadow: inset 0 0 0 2px var(--swpa-primary);
}


.swpa-choice-image {
	width: 100%;
	height: auto;
	max-height: 150px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 12px;
}

.swpa-choice-label {
	font-size: 16px;
	font-weight: 500;
	color: var(--swpa-text);
}

/* Multiple Choice */

.swpa-multichoice {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.swpa-checkbox {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-size: 16px;
	color: var(--swpa-text);
	padding: 10px;
	border-radius: 4px;
	transition: background 0.2s;
}

.swpa-checkbox:hover {
	background: var(--swpa-bg);
}

.swpa-checkbox input[type="checkbox"] {
	margin-right: 12px;
	width: 20px;
	height: 20px;
	cursor: pointer;
	accent-color: var(--swpa-primary);
}

/* Slider */

.swpa-slider-container {
	padding: var(--swpa-spacing) 0;
}

.swpa-slider {
	width: 100%;
	height: 8px;
	border-radius: 4px;
	background: var(--swpa-bg);
	outline: none;
	margin-bottom: var(--swpa-spacing);
	-webkit-appearance: none;
	appearance: none;
}

.swpa-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--swpa-primary);
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.swpa-slider::-moz-range-thumb {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--swpa-primary);
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.swpa-slider-display {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 8px;
	font-size: 24px;
	font-weight: 600;
	color: var(--swpa-primary);
}

.swpa-slider-unit {
	font-size: 14px;
	color: var(--swpa-text-light);
	font-weight: normal;
}

.swpa-unit-label {
	font-size: 12px;
	color: var(--swpa-text-light);
	margin-top: 8px;
}

/* Select Dropdown */

.swpa-select {
	appearance: none;
	padding-right: 30px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	padding-right: 36px;
}


/* Wizard Controls */

.swpa-wizard-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--swpa-spacing);
	padding: var(--swpa-spacing);
	border-top: 1px solid var(--swpa-border);
	background: var(--swpa-white);
}

.swpa-btn {
	padding: 12px 20px;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	display: inline-block;
	text-align: center;
	user-select: none;
}

.swpa-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}


.swpa-btn-back {
	background: var(--swpa-bg);
	color: var(--swpa-text);
	border: 1px solid var(--swpa-border);
}

.swpa-btn-back:hover {
	background: var(--swpa-border);
}

.swpa-btn-back:disabled {
	display: none;
}

.swpa-btn-primary {
	background: var(--swpa-primary);
	color: white;
}

.swpa-btn-primary:hover {
	opacity: 0.9;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.swpa-btn-secondary {
	background: transparent;
	color: var(--swpa-primary);
	border: 2px solid var(--swpa-primary);
}

.swpa-btn-secondary:hover {
	background: rgba(0, 0, 0, 0.03);
}


.swpa-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Results Screen */

.swpa-results {
	animation: swpaFadeIn 0.3s ease;
}

.swpa-results-title {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 20px 0;
	color: var(--swpa-text);
}

.swpa-calculations-display {
	background: var(--swpa-bg);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 24px;
	border-left: 4px solid var(--swpa-primary);
}

.swpa-calculation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--swpa-border);
}

.swpa-calculation:last-child {
	border-bottom: none;
}

.swpa-calc-value {
	font-size: 18px;
	font-weight: 600;
	color: var(--swpa-primary);
}

/* Products */

.swpa-products {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--swpa-spacing);
	margin-bottom: var(--swpa-spacing);
}

@media (min-width: 768px) {
	.swpa-products {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	}
}

.swpa-product-card {
	border: 1px solid var(--swpa-border);
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.2s;
	background: var(--swpa-white);
	display: flex;
	flex-direction: column;
}

.swpa-product-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.swpa-product-image {
	width: 100%;
	height: 200px;
	object-fit: cover;
	background: var(--swpa-bg);
}

.swpa-product-card > * {
	margin: 0;
	padding: 0 16px;
}

.swpa-product-card > :first-of-type:not(.swpa-product-image) {
	padding-top: 16px;
}

.swpa-product-name {
	font-size: 16px;
	font-weight: 600;
	color: var(--swpa-text);
	margin-bottom: 8px;
	padding-top: 16px;
}

.swpa-product-price {
	font-size: 18px;
	font-weight: 600;
	color: var(--swpa-primary);
	margin-bottom: 8px;
}

.swpa-product-score {
	font-size: 12px;
	color: var(--swpa-text-light);
	margin-bottom: 8px;
}

.swpa-product-reasons {
	margin: 12px 0;
}

.swpa-reason {
	font-size: 12px;
	color: var(--swpa-text-light);
	margin: 4px 0;
	padding-left: 20px;
	position: relative;
}

.swpa-reason:before {
	content: '✓';
	position: absolute;
	left: 0;
	color: var(--swpa-success);
	font-weight: bold;
}

.swpa-product-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	margin-top: auto;
}

.swpa-product-actions .swpa-btn {
	width: 100%;
	padding: 10px;
	font-size: 14px;
}

.swpa-no-results {
	text-align: center;
	padding: 40px 20px;
	color: var(--swpa-text-light);
	font-size: 16px;
}

/* Error State */

.swpa-error {
	background: var(--swpa-error);
	color: white;
	padding: var(--swpa-spacing);
	border-radius: 6px;
	margin: var(--swpa-spacing) 0;
}

.swpa-error p {
	margin: 0;
}

/* Tablet and Desktop */

@media (min-width: 768px) {
	.swpa-step-title {
		font-size: 32px;
	}

	.swpa-step-description {
		font-size: 18px;
	}

	.swpa-choices {
		grid-template-columns: repeat(2, 1fr);
	}

	.swpa-wizard-controls {
		grid-template-columns: 120px 1fr;
	}

	.swpa-btn-back {
		grid-column: 1;
	}

	.swpa-btn-next {
		grid-column: 2;
	}
}

@media (min-width: 1024px) {
	.swpa-choices {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Print */

@media print {
	.swpa-wizard-controls,
	.swpa-progress-bar {
		display: none;
	}

	.swpa-wizard {
		min-height: auto;
	}

	.swpa-products {
		grid-template-columns: 1fr;
	}
}

/* High Contrast Mode */

@media (prefers-contrast: more) {
	.swpa-choice,
	.swpa-btn,
	.swpa-input {
		border-width: 3px;
	}

	.swpa-choice-selected {
		outline: 3px solid var(--swpa-primary);
		outline-offset: 2px;
	}
}
.swpa-inline-error{color:#b00020;margin:12px 0 0;font-size:14px}
