/**
 * Lumera Solar Calculator — front-end styles
 * Namespaced under .lsc- to avoid theme/Elementor conflicts.
 */

.lsc-wrap {
	--lsc-primary: #0F172A;
	--lsc-secondary: #2563EB;
	--lsc-accent: #10B981;
	--lsc-bg: #F8FAFC;
	--lsc-card-bg: #FFFFFF;
	--lsc-border: #E2E8F0;
	--lsc-success: #22C55E;
	--lsc-warning: #F59E0B;
	--lsc-text: #1E293B;
	--lsc-radius-lg: 20px;
	--lsc-radius-md: 14px;
	--lsc-radius-sm: 10px;
	--lsc-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
	--lsc-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
	--lsc-shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);

	all: initial;
	*, *::before, *::after { box-sizing: border-box; }
	display: block;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
	color: var(--lsc-text);
	background: var(--lsc-bg);
	border-radius: var(--lsc-radius-lg);
	padding: clamp(24px, 4vw, 48px);
	max-width: 760px;
	margin: 0 auto;
	box-shadow: var(--lsc-shadow-md);
	line-height: 1.5;
	position: relative;
	overflow: hidden;
}

.lsc-wrap * { box-sizing: border-box; }

/* ---------- Progress bar ---------- */

.lsc-progress {
	position: relative;
	margin-bottom: 40px;
}

.lsc-progress-bar {
	position: relative;
	height: 6px;
	background: var(--lsc-border);
	border-radius: 999px;
	overflow: hidden;
}

.lsc-progress-bar::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 25%;
	background: linear-gradient(90deg, var(--lsc-secondary), var(--lsc-accent));
	border-radius: 999px;
	transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lsc-wrap[data-step="1"] .lsc-progress-bar::after { width: 12.5%; }
.lsc-wrap[data-step="2"] .lsc-progress-bar::after { width: 37.5%; }
.lsc-wrap[data-step="3"] .lsc-progress-bar::after { width: 62.5%; }
.lsc-wrap[data-step="4"] .lsc-progress-bar::after { width: 100%; }

.lsc-progress-steps {
	display: flex;
	justify-content: space-between;
	margin-top: 14px;
}

.lsc-progress-step {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--lsc-card-bg);
	border: 2px solid var(--lsc-border);
	color: #94A3B8;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.lsc-progress-step svg { width: 14px; height: 14px; }

.lsc-progress-step.is-active,
.lsc-progress-step.is-complete {
	border-color: var(--lsc-secondary);
	color: #fff;
	background: linear-gradient(135deg, var(--lsc-secondary), var(--lsc-accent));
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

/* ---------- Steps ---------- */

.lsc-step {
	display: none;
	animation: lscFadeSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.lsc-step.is-active { display: block; }

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

.lsc-step-title {
	font-size: clamp(22px, 3vw, 28px);
	font-weight: 800;
	color: var(--lsc-primary);
	margin: 0 0 6px;
	letter-spacing: -0.02em;
}

.lsc-step-subtitle {
	font-size: 15px;
	color: #64748B;
	margin: 0 0 28px;
}

.lsc-field-group { margin-bottom: 24px; }

.lsc-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #475569;
	margin-bottom: 10px;
}

.lsc-hint { font-size: 13px; color: #94A3B8; margin: 8px 0 0; }

.lsc-input {
	width: 100%;
	padding: 14px 16px;
	font-size: 16px;
	border: 2px solid var(--lsc-border);
	border-radius: var(--lsc-radius-sm);
	background: var(--lsc-card-bg);
	color: var(--lsc-text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lsc-input:focus {
	outline: none;
	border-color: var(--lsc-secondary);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.lsc-input.has-error { border-color: #EF4444; }

.lsc-error-msg {
	color: #EF4444;
	font-size: 13px;
	margin: 8px 0 0;
	min-height: 16px;
	font-weight: 600;
}

/* ---------- Option cards (property type / battery) ---------- */

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

.lsc-option-grid-3 { grid-template-columns: repeat(3, 1fr); }

.lsc-option-card { position: relative; cursor: pointer; }

.lsc-option-card input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.lsc-option-card-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 18px 10px;
	border: 2px solid var(--lsc-border);
	border-radius: var(--lsc-radius-md);
	background: var(--lsc-card-bg);
	text-align: center;
	font-weight: 700;
	font-size: 14px;
	color: var(--lsc-text);
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: var(--lsc-shadow-sm);
	min-height: 84px;
}

.lsc-option-card:hover .lsc-option-card-inner {
	border-color: var(--lsc-secondary);
	transform: translateY(-2px);
	box-shadow: var(--lsc-shadow-md);
}

.lsc-option-card input:checked + .lsc-option-card-inner {
	border-color: var(--lsc-secondary);
	background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.06));
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.lsc-option-icon {
	width: 26px;
	height: 26px;
	display: inline-block;
	background: var(--lsc-secondary);
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M3 11l9-7 9 7'/><path d='M5 10v10h14V10'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M3 11l9-7 9 7'/><path d='M5 10v10h14V10'/></svg>");
}

.lsc-option-icon[data-icon="flat"] {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='4' y='3' width='16' height='18'/><path d='M9 8h1M14 8h1M9 12h1M14 12h1M9 16h1M14 16h1'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='4' y='3' width='16' height='18'/><path d='M9 8h1M14 8h1M9 12h1M14 12h1M9 16h1M14 16h1'/></svg>");
}

.lsc-option-icon[data-icon="commercial"] {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='7' width='18' height='14'/><path d='M9 21V7l3-4 3 4v14'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='7' width='18' height='14'/><path d='M9 21V7l3-4 3 4v14'/></svg>");
}

.lsc-option-icon[data-icon="bungalow"] {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M2 12l10-6 10 6'/><path d='M4 11v9h16v-9'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><path d='M2 12l10-6 10 6'/><path d='M4 11v9h16v-9'/></svg>");
}

/* ---------- Usage toggle ---------- */

.lsc-toggle-group {
	display: flex;
	background: var(--lsc-border);
	border-radius: 999px;
	padding: 4px;
	margin-bottom: 24px;
	gap: 4px;
}

.lsc-toggle-btn {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	color: #64748B;
	cursor: pointer;
	transition: all 0.25s ease;
}

.lsc-toggle-btn.is-active {
	background: var(--lsc-card-bg);
	color: var(--lsc-primary);
	box-shadow: var(--lsc-shadow-sm);
}

/* ---------- Buttons ---------- */

.lsc-step-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 32px;
	gap: 12px;
}

.lsc-step-actions-center { justify-content: center; }

.lsc-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	font-weight: 700;
	padding: 14px 26px;
	border-radius: 999px;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	line-height: 1;
}

.lsc-btn-primary {
	background: linear-gradient(135deg, var(--lsc-secondary), var(--lsc-accent));
	color: #fff;
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.lsc-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(37, 99, 235, 0.34); }

.lsc-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.lsc-btn-ghost {
	background: transparent;
	color: #64748B;
}

.lsc-btn-ghost:hover { color: var(--lsc-primary); }

.lsc-btn-outline {
	background: var(--lsc-card-bg);
	color: var(--lsc-primary);
	border: 2px solid var(--lsc-border);
}

.lsc-btn-outline:hover { border-color: var(--lsc-secondary); color: var(--lsc-secondary); }

.lsc-spinner {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	animation: lscSpin 0.7s linear infinite;
}

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

/* ---------- Results ---------- */

.lsc-results-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	margin-bottom: 28px;
}

.lsc-result-card {
	background: var(--lsc-card-bg);
	border: 1px solid var(--lsc-border);
	border-radius: var(--lsc-radius-md);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	box-shadow: var(--lsc-shadow-sm);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lsc-result-card:hover { transform: translateY(-3px); box-shadow: var(--lsc-shadow-md); }

.lsc-result-card-featured {
	grid-column: 1 / -1;
	background: linear-gradient(135deg, var(--lsc-primary), #1E3A5F);
	border: none;
	color: #fff;
}

.lsc-result-card-featured .lsc-result-label { color: rgba(255, 255, 255, 0.7); }
.lsc-result-card-featured .lsc-result-value { color: #fff; font-size: 40px; }
.lsc-result-card-featured .lsc-result-icon { background: var(--lsc-accent); }

.lsc-result-icon {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: rgba(37, 99, 235, 0.12);
	position: relative;
}

.lsc-result-icon::after {
	content: "";
	position: absolute;
	inset: 7px;
	background: var(--lsc-secondary);
	border-radius: 3px;
}

.lsc-result-card-featured .lsc-result-icon::after { background: #fff; }

.lsc-result-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748B;
}

.lsc-result-value {
	font-size: 26px;
	font-weight: 800;
	color: var(--lsc-primary);
	letter-spacing: -0.01em;
}

.lsc-result-card-rating {
	grid-column: 1 / -1;
	align-items: center;
	text-align: center;
}

.lsc-rating-meter {
	width: 100%;
	height: 10px;
	background: var(--lsc-border);
	border-radius: 999px;
	overflow: hidden;
	margin: 4px 0;
}

.lsc-rating-fill {
	display: block;
	height: 100%;
	width: 33%;
	border-radius: 999px;
	background: var(--lsc-warning);
	transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.8s ease;
}

.lsc-rating-fill.is-good { width: 66%; background: var(--lsc-secondary); }
.lsc-rating-fill.is-excellent { width: 100%; background: var(--lsc-success); }

.lsc-rating-value {
	font-size: 18px;
	font-weight: 800;
	color: var(--lsc-primary);
}

.lsc-disclaimer {
	font-size: 12.5px;
	color: #94A3B8;
	line-height: 1.6;
	margin-bottom: 28px;
}

/* ---------- CTA ---------- */

.lsc-cta {
	background: var(--lsc-card-bg);
	border: 1px solid var(--lsc-border);
	border-radius: var(--lsc-radius-lg);
	padding: 28px;
	text-align: center;
	box-shadow: var(--lsc-shadow-sm);
}

.lsc-cta-title {
	font-size: 22px;
	font-weight: 800;
	color: var(--lsc-primary);
	margin: 0 0 10px;
}

.lsc-cta-text {
	font-size: 14.5px;
	color: #475569;
	max-width: 480px;
	margin: 0 auto 22px;
	line-height: 1.6;
}

.lsc-cta-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.lsc-cta-contact {
	display: flex;
	justify-content: center;
	gap: 24px;
	flex-wrap: wrap;
	font-size: 13.5px;
	color: #64748B;
}

/* ---------- Loading overlay ---------- */

.lsc-loading-overlay {
	position: absolute;
	inset: 0;
	background: rgba(248, 250, 252, 0.92);
	backdrop-filter: blur(3px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	border-radius: var(--lsc-radius-lg);
	z-index: 10;
	font-weight: 700;
	color: var(--lsc-primary);
}

.lsc-loading-spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid var(--lsc-border);
	border-top-color: var(--lsc-secondary);
	animation: lscSpin 0.8s linear infinite;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
	.lsc-option-grid { grid-template-columns: repeat(2, 1fr); }
	.lsc-results-grid { grid-template-columns: 1fr; }
	.lsc-step-actions { flex-direction: column-reverse; align-items: stretch; }
	.lsc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.lsc-wrap *, .lsc-wrap *::before, .lsc-wrap *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
