/*
 * Company Valuation Calculator.
 * Every color and size is a custom property so the Elementor widget's Style controls can override it.
 */

.sg-calc {
	--sg-calc-text: #ffffff;
	--sg-calc-muted: rgba(255, 255, 255, 0.78);
	--sg-calc-accent: #9fb9d3;
	--sg-calc-line: rgba(255, 255, 255, 0.14);
	--sg-calc-error: #ffb4a8;

	--sg-calc-max-width: 100%;
	--sg-calc-gap: 20px;
	--sg-calc-section-gap: 24px;
	--sg-calc-title-gap: 20px;

	--sg-calc-field-height: 40px;
	--sg-calc-field-padding: 12px;
	--sg-calc-field-border-width: 1px;
	--sg-calc-field-radius: 0px;
	--sg-calc-field-bg: rgba(4, 22, 40, 0.45);
	--sg-calc-field-border: rgba(255, 255, 255, 0.6);
	--sg-calc-field-focus: #ffffff;
	--sg-calc-placeholder: rgba(255, 255, 255, 0.45);
	--sg-calc-arrow: #ffffff;
	--sg-calc-option-bg: #0b2742;
	--sg-calc-option-text: #ffffff;

	--sg-calc-label: var(--sg-calc-text);
	--sg-calc-label-float: var(--sg-calc-muted);
	--sg-calc-label-float-size: 9px;

	--sg-calc-button-text: #0b2742;
	--sg-calc-button-bg: #ffffff;
	--sg-calc-button-border: #ffffff;
	--sg-calc-button-hover-text: #ffffff;
	--sg-calc-button-hover-bg: transparent;
	--sg-calc-button-hover-border: #ffffff;
	--sg-calc-button-border-width: 1px;
	--sg-calc-button-radius: 0px;
	--sg-calc-icon-size: 29px;
	--sg-calc-icon-gap: 14px;

	--sg-calc-result-bg: var(--sg-calc-field-bg);
	--sg-calc-result-border: var(--sg-calc-line);
	--sg-calc-result-padding: 16px;

	max-width: var(--sg-calc-max-width);
	color: var(--sg-calc-text);
}

.sg-calc *,
.sg-calc *::before,
.sg-calc *::after {
	box-sizing: border-box;
}

.sg-calc .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sg-calc [hidden] {
	display: none !important;
}

/* Sections */

.sg-calc .sg-calc__section {
	min-width: 0;
	margin: 0 0 var(--sg-calc-section-gap);
	padding: 0;
	border: 0;
}

.sg-calc .sg-calc__section-title {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	margin: 0 0 var(--sg-calc-title-gap);
	padding: 0;
	color: var(--sg-calc-accent);
	font-size: 11px;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
}

.sg-calc .sg-calc__section-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--sg-calc-line);
}

.sg-calc .sg-calc__hint {
	margin: -4px 0 18px;
	color: var(--sg-calc-muted);
	font-size: 13px;
}

/* Fields */

.sg-calc .sg-calc__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--sg-calc-gap);
}

.sg-calc .sg-calc__select,
.sg-calc .sg-calc__field {
	position: relative;
	margin: 0 0 var(--sg-calc-gap);
}

.sg-calc .sg-calc__row .sg-calc__field {
	margin-bottom: 0;
}

.sg-calc .sg-calc__field--arr {
	margin: var(--sg-calc-gap) 0 0;
}

.sg-calc select,
.sg-calc .sg-calc__field input {
	display: block;
	width: 100%;
	height: var(--sg-calc-field-height);
	min-height: 0;
	margin: 0;
	border: var(--sg-calc-field-border-width) solid var(--sg-calc-field-border);
	border-radius: var(--sg-calc-field-radius);
	background-color: var(--sg-calc-field-bg);
	box-shadow: none;
	color: var(--sg-calc-text);
	font-family: inherit;
	font-size: 12px;
	line-height: 1.2;
	outline: none;
	transition: border-color 0.15s ease;
}

.sg-calc select:focus,
.sg-calc .sg-calc__field input:focus {
	border-color: var(--sg-calc-field-focus);
	box-shadow: none;
}

.sg-calc select {
	padding: 0 calc(var(--sg-calc-field-padding) + 28px) 0 var(--sg-calc-field-padding);
	background-image: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sg-calc .sg-calc__select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: calc(var(--sg-calc-field-padding) + 4px);
	width: 7px;
	height: 7px;
	border-right: 1.4px solid var(--sg-calc-arrow);
	border-bottom: 1.4px solid var(--sg-calc-arrow);
	pointer-events: none;
	transform: translateY(-70%) rotate(45deg);
}

.sg-calc select option {
	background: var(--sg-calc-option-bg);
	color: var(--sg-calc-option-text);
}

.sg-calc .sg-calc__field input {
	padding: 14px var(--sg-calc-field-padding) 2px;
	-moz-appearance: textfield;
}

.sg-calc .sg-calc__field input::-webkit-outer-spin-button,
.sg-calc .sg-calc__field input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.sg-calc .sg-calc__field input::placeholder {
	color: transparent;
	opacity: 1;
}

.sg-calc .sg-calc__field input:focus::placeholder {
	color: var(--sg-calc-placeholder);
}

.sg-calc .sg-calc__field label {
	position: absolute;
	top: 50%;
	left: calc(var(--sg-calc-field-padding) + var(--sg-calc-field-border-width));
	right: var(--sg-calc-field-padding);
	margin: 0;
	overflow: hidden;
	color: var(--sg-calc-label);
	font-size: 12px;
	line-height: 1.1;
	white-space: nowrap;
	text-overflow: ellipsis;
	pointer-events: none;
	transform: translateY(-50%);
	transition: top 0.15s ease, font-size 0.15s ease, color 0.15s ease;
}

.sg-calc .sg-calc__field input:focus + label,
.sg-calc .sg-calc__field input:not(:placeholder-shown) + label {
	top: 9px;
	color: var(--sg-calc-label-float);
	font-size: var(--sg-calc-label-float-size);
	transform: none;
}

/* Error */

.sg-calc .sg-calc__error {
	margin: -4px 0 18px;
	color: var(--sg-calc-error);
	font-size: 13px;
}

/* Button */

.sg-calc .sg-calc__button-wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin: 12px 0 0;
}

.sg-calc .sg-calc__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sg-calc-icon-gap);
	margin: 0;
	padding: 14px 28px;
	border: var(--sg-calc-button-border-width) solid var(--sg-calc-button-border);
	border-radius: var(--sg-calc-button-radius);
	background: var(--sg-calc-button-bg);
	color: var(--sg-calc-button-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1.2;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sg-calc .sg-calc__button:hover,
.sg-calc .sg-calc__button:focus-visible {
	border-color: var(--sg-calc-button-hover-border);
	background: var(--sg-calc-button-hover-bg);
	color: var(--sg-calc-button-hover-text);
}

.sg-calc .sg-calc__button-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	line-height: 1;
}

.sg-calc .sg-calc__button-icon svg {
	width: var(--sg-calc-icon-size);
	height: auto;
	fill: none;
}

.sg-calc .sg-calc__button-icon i {
	font-size: calc(var(--sg-calc-icon-size) * 0.6);
}

/* Results */

.sg-calc .sg-calc__results {
	margin-top: 32px;
}

.sg-calc .sg-calc__result-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: var(--sg-calc-gap);
	margin-bottom: var(--sg-calc-gap);
}

.sg-calc .sg-calc__result,
.sg-calc .sg-calc__average {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: var(--sg-calc-result-padding);
	border: 1px solid var(--sg-calc-result-border);
	background: var(--sg-calc-result-bg);
}

.sg-calc .sg-calc__result-label {
	color: var(--sg-calc-accent);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sg-calc .sg-calc__result-value {
	color: var(--sg-calc-text);
	font-size: 22px;
	line-height: 1.2;
}

.sg-calc .sg-calc__average-value {
	color: var(--sg-calc-text);
	font-size: 28px;
	line-height: 1.2;
}

.sg-calc .sg-calc__result-meta {
	color: var(--sg-calc-muted);
	font-size: 12px;
}

.sg-calc .sg-calc__disclaimer {
	margin: 16px 0 0;
	color: var(--sg-calc-muted);
	font-size: 12px;
	line-height: 1.6;
}

@media (max-width: 600px) {
	.sg-calc .sg-calc__row,
	.sg-calc .sg-calc__result-grid {
		grid-template-columns: 1fr;
	}

	.sg-calc .sg-calc__button-wrap {
		align-items: stretch;
	}
}
