/**
 * Wizard styles — shared admin and frontend.
 *
 * @package BuildingEngineerPro
 */

.bep-wizard {
	background: linear-gradient(160deg, #fff 0%, #f8f9fb 100%);
	border: 1px solid #dce1e8;
	border-radius: 12px;
	padding: 28px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.06);
	position: relative;
	overflow: visible;
	isolation: isolate;
}

.bep-wizard.bep-has-watermark > :not(.bep-wizard-watermark) {
	position: relative;
	z-index: 1;
}

.bep-wizard.bep-has-watermark > .bep-wizard-panel {
	z-index: 20;
}

.bep-wizard.bep-has-watermark > .bep-wizard-nav,
.bep-wizard.bep-has-watermark > .bep-wizard-brand-footer {
	z-index: 1;
}

.bep-wizard-watermark {
	position: absolute;
	inset: 0;
	background: center center no-repeat;
	background-size: 45% auto;
	opacity: 0.08;
	pointer-events: none;
	z-index: 0;
}

.bep-company-header {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 20px;
	padding: 16px 20px;
	background: linear-gradient(180deg, #fff 0%, #f4f7fb 100%);
	border: 1px solid #dce1e8;
	border-radius: 10px;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 6px rgba(0,0,0,0.04);
}

.bep-company-header-logo {
	max-height: 56px;
	max-width: 160px;
	object-fit: contain;
}

.bep-company-header-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bep-company-header-name {
	font-size: 18px;
	color: var(--bep-primary, #2c5282);
}

.bep-company-header-site {
	font-size: 12px;
	color: #555;
}

.bep-company-header-site a {
	color: var(--bep-primary, #2c5282);
	text-decoration: none;
}

.bep-wizard-header h2 {
	margin: 0 0 8px;
	color: var(--bep-primary, #2c5282);
}

.bep-wizard-units-badge {
	display: inline-block;
	margin: 10px 0 0;
	padding: 6px 12px;
	background: linear-gradient(180deg, #eef2f7 0%, #e4e9f0 100%);
	border: 1px solid #ccd0d5;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	color: #444;
	letter-spacing: 0.02em;
}

.bep-wizard-progress {
	display: flex;
	gap: 8px;
	margin: 24px 0;
	flex-wrap: wrap;
}

.bep-progress-step {
	flex: 1;
	min-width: 120px;
	text-align: center;
	padding: 12px 8px;
	background: #e8ecf1;
	border-radius: 8px;
	opacity: 0.6;
	transition: all 0.3s;
}

.bep-progress-step.active,
.bep-progress-step.completed {
	opacity: 1;
	box-shadow: 0 3px 8px rgba(44, 82, 130, 0.3);
}

.bep-progress-step.active {
	background: linear-gradient(145deg, var(--bep-primary, #2c5282), var(--bep-accent, #4a6fa5));
	color: #fff;
}

.bep-progress-step.completed {
	background: linear-gradient(145deg, #166534 0%, #22c55e 100%);
	color: #fff;
	box-shadow: 0 3px 8px rgba(22, 101, 52, 0.35);
}

.bep-step-indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.bep-step-num {
	display: block;
	font-size: 20px;
	font-weight: 700;
}

.bep-step-tick {
	display: none;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	color: #15803d;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.bep-step-tick::before {
	content: "\2713";
}

.bep-progress-step.completed .bep-step-tick {
	display: inline-flex;
}

.bep-step-label {
	display: block;
	font-size: 11px;
	margin-top: 4px;
	line-height: 1.3;
}

.bep-wizard-panel h3 {
	margin-top: 0;
	padding-bottom: 12px;
	border-bottom: 2px solid #eee;
}

.bep-wizard-fields {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 20px 0 72px;
	position: relative;
	z-index: 5;
}

.bep-wizard-panel {
	position: relative;
	z-index: 20;
	overflow: visible;
}

.bep-field label {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #333;
}

.bep-field {
	position: relative;
	z-index: 1;
}

.bep-field:has(.bep-field-help:hover),
.bep-field:has(.bep-field-help:focus-within),
.bep-field:has(.bep-field-help.is-open),
.bep-field.bep-field-help-active {
	z-index: 120;
}

.bep-field-help {
	position: relative;
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	z-index: 20;
}

.bep-field-help-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	padding: 0;
	border: 1px solid rgba(44, 82, 130, 0.25);
	border-radius: 50%;
	background: linear-gradient(180deg, var(--bep-primary, #2c5282) 0%, var(--bep-accent, #4a6fa5) 100%);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	cursor: help;
	box-shadow: 0 2px 6px rgba(44, 82, 130, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bep-field-help-trigger:hover,
.bep-field-help-trigger:focus {
	transform: scale(1.08);
	outline: none;
	box-shadow: 0 3px 10px rgba(44, 82, 130, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.bep-field-help-popup {
	position: absolute;
	left: 0;
	top: calc(100% + 8px);
	z-index: 200;
	min-width: 240px;
	max-width: 320px;
	padding: 12px 14px;
	border-radius: 10px;
	background: linear-gradient(165deg, #ffffff 0%, #f4f8fc 100%);
	border: 1px solid rgba(44, 82, 130, 0.18);
	box-shadow: 0 10px 28px rgba(44, 82, 130, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	pointer-events: none;
	text-align: left;
}

.bep-field-help-popup.bep-field-help-popup--fixed {
	position: fixed !important;
	z-index: 100000 !important;
	max-width: min(320px, calc(100vw - 24px));
}

.bep-field-help-popup::before {
	content: "";
	position: absolute;
	top: -6px;
	left: 14px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-left: 1px solid rgba(44, 82, 130, 0.18);
	border-top: 1px solid rgba(44, 82, 130, 0.18);
	transform: rotate(45deg);
}

.bep-field-help-text {
	display: block;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.55;
	color: #333;
	margin-bottom: 8px;
}

.bep-field-help-example {
	display: block;
	padding: 8px 10px;
	border-radius: 8px;
	background: linear-gradient(180deg, #eef6ff 0%, #e3f0fb 100%);
	border: 1px solid rgba(44, 82, 130, 0.14);
	font-size: 12px;
	line-height: 1.5;
	color: #2c5282;
}

.bep-field-help-example strong {
	display: block;
	margin-bottom: 2px;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #1d4ed8;
}

.bep-field-help:hover .bep-field-help-popup,
.bep-field-help:focus-within .bep-field-help-popup,
.bep-field-help.is-open .bep-field-help-popup {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.bep-fe-hide-help .bep-field-help {
	display: none !important;
}

.bep-field input,
.bep-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccd0d5;
	border-radius: 6px;
	box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
	font-size: 14px;
}

.bep-field input:focus,
.bep-field select:focus {
	border-color: var(--bep-primary, #2c5282);
	outline: none;
	box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.2);
}

.bep-field.bep-field-invalid input,
.bep-field.bep-field-invalid select {
	border-color: #dc2626;
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.bep-field-error-msg {
	display: none;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #dc2626;
}

.bep-field.bep-field-conditional-hidden {
	display: none !important;
}

.bep-field.bep-field-invalid .bep-field-error-msg {
	display: block;
}

.bep-inputs-summary {
	margin: 0 0 20px;
	padding: 14px 18px;
	border-radius: 10px;
	background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
	border: 1px solid rgba(44, 82, 130, 0.12);
}

.bep-inputs-summary h4 {
	margin: 0 0 10px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--bep-primary, #2c5282);
}

.bep-inputs-summary dl {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 8px 16px;
	margin: 0;
}

.bep-inputs-summary dt {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
}

.bep-inputs-summary dd {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #334155;
}

.bep-wizard-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
	padding-top: 24px;
	border-top: 1px solid #eee;
	position: relative;
	z-index: 1;
	clear: both;
}

.bep-wizard-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 148px;
	padding: 12px 26px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	box-shadow: 0 3px 10px rgba(44, 82, 130, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.bep-wizard-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.22), 0 3px 10px rgba(44, 82, 130, 0.18);
}

.bep-wizard-btn-prev {
	background: linear-gradient(180deg, #eef1f5 0%, #d8dee6 100%);
	border-color: #c5ccd6;
	color: #4a5568;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.bep-wizard-btn-prev:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.bep-wizard-btn-prev:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.bep-wizard-btn-next,
.bep-wizard-btn-calculate {
	background: linear-gradient(145deg, var(--bep-primary, #2c5282) 0%, var(--bep-accent, #4a6fa5) 100%);
	border-color: rgba(44, 82, 130, 0.35);
	color: #fff;
}

.bep-wizard-btn-next:hover:not(:disabled),
.bep-wizard-btn-calculate:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(44, 82, 130, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.bep-wizard-btn:active:not(:disabled) {
	transform: translateY(0);
}

.bep-wizard-project-select {
	margin-bottom: 20px;
}

.bep-wizard-project-select select {
	min-width: 280px;
	padding: 8px;
}

.bep-steps-output table,
.bep-results-output table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
}

.bep-steps-output th,
.bep-steps-output td,
.bep-results-output th,
.bep-results-output td {
	border: 1px solid #ddd;
	padding: 10px;
	text-align: left;
}

.bep-steps-output th,
.bep-results-output th {
	background: #f5f7fa;
}

.bep-steps-output code {
	background: #eef2f7;
	padding: 2px 8px;
	border-radius: 4px;
	font-family: "Courier New", monospace;
}

.bep-results-output ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.bep-results-summary {
	margin: 0 0 18px;
	padding: 14px 18px;
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(44, 82, 130, 0.08) 0%, rgba(74, 111, 165, 0.12) 100%);
	border: 1px solid rgba(44, 82, 130, 0.14);
	font-size: 13px;
	font-weight: 600;
	color: var(--bep-primary, #2c5282);
}

.bep-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
	margin: 0;
}

.bep-result-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px;
	border-radius: 12px;
	background: linear-gradient(165deg, #ffffff 0%, #f4f8fc 100%);
	border: 1px solid rgba(44, 82, 130, 0.12);
	box-shadow: 0 4px 14px rgba(44, 82, 130, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bep-result-card-primary {
	grid-column: 1 / -1;
	background: linear-gradient(145deg, rgba(44, 82, 130, 0.08) 0%, rgba(74, 111, 165, 0.14) 100%);
	border-color: rgba(44, 82, 130, 0.22);
}

.bep-result-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #64748b;
}

.bep-result-value {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--bep-primary, #2c5282);
}

.bep-result-card-primary .bep-result-value {
	font-size: 28px;
}

.bep-result-unit {
	display: inline-block;
	margin-left: 6px;
	font-size: 14px;
	font-weight: 600;
	font-style: normal;
	color: #475569;
}

.bep-results-output li {
	padding: 10px 16px;
	margin: 6px 0;
	background: #f0f4f8;
	border-left: 4px solid var(--bep-primary, #2c5282);
	border-radius: 0 6px 6px 0;
}

.bep-wizard-export {
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.bep-wizard-btn-export {
	min-width: auto;
	padding: 10px 18px;
	font-size: 12px;
	background: linear-gradient(180deg, #ffffff 0%, #eef3f9 100%);
	border: 1px solid rgba(44, 82, 130, 0.2);
	color: var(--bep-primary, #2c5282);
	box-shadow: 0 2px 6px rgba(44, 82, 130, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.bep-wizard-btn-export:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(44, 82, 130, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.bep-wizard-export .bep-wizard-btn-next.bep-export-print {
	background: linear-gradient(145deg, var(--bep-primary, #2c5282) 0%, var(--bep-accent, #4a6fa5) 100%);
	color: #fff;
	border-color: rgba(44, 82, 130, 0.35);
}

.bep-wizard-brand-footer {
	margin-top: 28px;
	padding: 16px 20px;
	background: linear-gradient(180deg, #f0f4f8 0%, #e8ecf1 100%);
	border: 1px solid #dce1e8;
	border-radius: 8px;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 4px rgba(0,0,0,0.04);
	text-align: center;
	font-size: 12px;
	color: #555;
}

.bep-brand-footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 12px;
}

.bep-brand-plugin {
	font-weight: 700;
	color: var(--bep-primary, #2c5282);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 11px;
}

.bep-brand-sep {
	color: #bbb;
}

.bep-brand-footer-inner a {
	color: var(--bep-primary, #2c5282);
	text-decoration: none;
	font-weight: 600;
}

.bep-brand-footer-inner a:hover {
	text-decoration: underline;
}

.bep-brand-company {
	color: #666;
	font-style: italic;
}

.bep-brand-company a,
.bep-brand-engineer strong {
	color: var(--bep-primary, #2c5282);
}

.bep-brand-engineer {
	color: #555;
}

@media (max-width: 600px) {
	.bep-wizard-progress {
		flex-direction: column;
	}
	.bep-wizard-fields {
		grid-template-columns: 1fr;
	}
}
