/**
 * FG Tech Calc Core — shared visual design.
 *
 * Tokens below are pulled directly from the FG Tech site's live
 * Elementor global kit (fgtech.com.au), not invented: primary blue,
 * accent orange, Poppins/Inter typography, card radius/shadow and
 * section tint colors all match what's already on the site so a
 * calculator shortcode looks at-home wherever it's dropped, without
 * trying to reproduce Divi/Elementor's own module system.
 *
 * Shared by every FG Tech calculator plugin (moved out of the TCO
 * Calculator plugin so future calculators reuse it rather than copy it).
 * Class names keep their original `tco-` prefix from the first calculator
 * this design system was built for; treat it as the shared component
 * prefix for the whole calculator family, not a TCO-only namespace.
 */

.tco-calculator {
	--tco-primary: #175480;
	--tco-primary-dark: #0b1f33;
	--tco-primary-tint: #e8f1f8;
	--tco-accent: #ff8a00;
	--tco-positive: #00bf63;
	--tco-text: #1f2937;
	--tco-text-muted: #5f6c7b;
	--tco-border: #e5e7eb;
	--tco-surface: #ffffff;
	--tco-surface-tint: #f7f9fb;
	--tco-radius-card: 14px;
	--tco-radius-control: 10px;
	--tco-radius-pill: 100px;
	--tco-shadow-card: 4px 6px 16px -8px rgba(11, 31, 51, 0.22);
	--tco-font-heading: "Poppins", "Segoe UI", sans-serif;
	--tco-font-body: "Inter", "Segoe UI", sans-serif;

	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 24px 96px;
	font-family: var(--tco-font-body);
	color: var(--tco-text);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

/* Desktop: fill more of the page without going edge-to-edge on very
   wide monitors. Below this, the container is just full-width with
   side padding, which is already mobile-friendly. */
@media (min-width: 1000px) {
	.tco-calculator {
		width: 75%;
	}
}

@media (max-width: 700px) {
	.tco-calculator {
		padding: 0 16px 96px;
	}
}

.tco-calculator * {
	box-sizing: border-box;
}

/* Defensive reset against the host theme/page builder (Elementor global
   typography, sticky/parallax heading effects, etc.) applying position
   or float to bare heading/paragraph tags with higher specificity than
   our plain component classes below — this design system never uses
   position or float on text elements itself, so this can't clobber
   anything we actually rely on. Without it, a host site's own h1-h6/p
   rules can knock our headings out of flow and overlap the text below
   them (seen in production on fgtech.com.au's Elementor theme, not
   reproducible on a vanilla block theme). */
.tco-calculator h1,
.tco-calculator h2,
.tco-calculator h3,
.tco-calculator h4,
.tco-calculator h5,
.tco-calculator h6,
.tco-calculator p {
	position: static !important;
	float: none !important;
}

/* ---------- Intro ---------- */

.tco-calculator__intro {
	padding: 8px 0 28px;
}

.tco-calculator .tco-calculator__eyebrow {
	margin: 0 0 8px !important;
	font-family: var(--tco-font-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4 !important;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--tco-primary);
}

.tco-calculator .tco-calculator__title {
	margin: 0 0 10px !important;
	font-family: var(--tco-font-heading);
	font-weight: 700;
	font-size: 34px;
	line-height: 1.15 !important;
	color: var(--tco-primary-dark);
}

.tco-calculator .tco-calculator__subtitle {
	margin: 0 !important;
	max-width: 60ch;
	font-size: 16px;
	line-height: 1.6 !important;
	color: var(--tco-text-muted);
}

/* ---------- Sections ---------- */

.tco-calculator__section {
	background: var(--tco-surface);
	border: 1px solid var(--tco-border);
	border-radius: var(--tco-radius-card);
	box-shadow: var(--tco-shadow-card);
	padding: 28px;
	margin-bottom: 20px;
}

.tco-calculator__section--primary {
	background: linear-gradient(180deg, var(--tco-surface) 0%, var(--tco-surface-tint) 100%);
}

.tco-calculator .tco-calculator__section-title {
	margin: 0 0 4px !important;
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 20px;
	line-height: 1.3 !important;
	color: var(--tco-primary-dark);
}

.tco-calculator .tco-calculator__section-hint {
	margin: 0 0 22px !important;
	font-size: 13px;
	line-height: 1.5 !important;
	color: var(--tco-text-muted);
}

.tco-calculator__field-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px 28px;
	margin-top: 22px;
}

.tco-calculator__field-grid--tight {
	margin-top: 12px;
	margin-bottom: 16px;
}

.tco-calculator__agent-grid {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

@media (max-width: 600px) {
	.tco-calculator__field-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Assumptions (collapsed by default) ---------- */

.tco-calculator__assumptions {
	padding: 0;
	overflow: hidden;
}

.tco-calculator__assumptions-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 28px;
	cursor: pointer;
	list-style: none;
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 17px;
	color: var(--tco-primary-dark);
}

.tco-calculator__assumptions-toggle::-webkit-details-marker {
	display: none;
}

.tco-calculator__assumptions-toggle::after {
	content: "";
	width: 9px;
	height: 9px;
	margin-left: auto;
	border-right: 2px solid var(--tco-primary);
	border-bottom: 2px solid var(--tco-primary);
	transform: rotate(45deg);
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.tco-calculator__assumptions[open] .tco-calculator__assumptions-toggle::after {
	transform: rotate(-135deg);
}

.tco-calculator__assumptions-hint {
	font-family: var(--tco-font-body);
	font-weight: 400;
	font-size: 12.5px;
	color: var(--tco-text-muted);
}

.tco-calculator__assumptions-body {
	padding: 4px 28px 28px;
	border-top: 1px solid var(--tco-border);
}

.tco-field-cluster {
	padding: 22px 0;
	border-bottom: 1px solid var(--tco-border);
}

.tco-field-cluster:last-of-type {
	border-bottom: none;
}

.tco-calculator .tco-field-cluster__title {
	margin: 0 0 16px !important;
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4 !important;
	color: var(--tco-text);
}

.tco-calculator .tco-calculator__disclaimer {
	margin: 20px 0 0 !important;
	padding: 12px 14px;
	background: #fff7ec;
	border: 1px solid #ffe1b3;
	border-radius: var(--tco-radius-control);
	font-size: 12.5px;
	line-height: 1.5 !important;
	color: #8a5a12;
}

/* ---------- Sliders ---------- */

.tco-slider-row {
	margin-bottom: 4px;
}

.tco-slider-row__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.tco-slider-row__head label {
	font-size: 14.5px;
	font-weight: 500;
	color: var(--tco-text);
}

.tco-slider-row__value {
	font-variant-numeric: tabular-nums;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tco-primary);
	white-space: nowrap;
}

.tco-range {
	--tco-range-pct: 50%;
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(
		to right,
		var(--tco-primary) 0%,
		var(--tco-primary) var(--tco-range-pct),
		var(--tco-border) var(--tco-range-pct),
		var(--tco-border) 100%
	);
	outline: none;
	cursor: pointer;
}

.tco-range::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--tco-surface);
	border: 3px solid var(--tco-primary);
	box-shadow: 0 2px 6px rgba(11, 31, 51, 0.3);
	cursor: pointer;
	transition: transform 0.15s ease;
	margin-top: 0;
}

.tco-range::-webkit-slider-thumb:hover {
	transform: scale(1.12);
}

.tco-range::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--tco-surface);
	border: 3px solid var(--tco-primary);
	box-shadow: 0 2px 6px rgba(11, 31, 51, 0.3);
	cursor: pointer;
}

.tco-range::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: transparent;
}

.tco-range:focus-visible::-webkit-slider-thumb {
	outline: 3px solid var(--tco-primary-tint);
	outline-offset: 2px;
}

/* Qualitative sliders get the orange/green sovereignty gradient baked
   into the track itself, since both ends carry real meaning. */
.tco-range--qual {
	background: linear-gradient(to right, var(--tco-accent) 0%, var(--tco-border) 50%, var(--tco-positive) 100%);
}

.tco-range--qual::-webkit-slider-thumb {
	border-color: var(--tco-primary-dark);
}

.tco-range--qual::-moz-range-thumb {
	border-color: var(--tco-primary-dark);
}

.tco-qual-slider {
	padding: 16px 0;
	border-bottom: 1px solid var(--tco-border);
}

.tco-qual-cluster:last-of-type .tco-qual-slider:last-child,
.tco-qual-slider--capability {
	border-bottom: none;
}

.tco-qual-slider__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.tco-qual-slider__label {
	font-size: 14.5px;
	font-weight: 500;
}

.tco-qual-slider__note {
	font-size: 11.5px;
	color: var(--tco-text-muted);
	font-style: italic;
}

.tco-qual-slider__ends {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 11.5px;
	color: var(--tco-text-muted);
	gap: 12px;
}

.tco-qual-slider__ends span:last-child {
	text-align: right;
}

.tco-qual-cluster {
	margin-bottom: 8px;
}

.tco-calculator .tco-qual-cluster__title {
	margin: 0 0 4px !important;
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 13px;
	line-height: 1.4 !important;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	color: var(--tco-primary);
}

.tco-qual-slider--capability {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 2px dashed var(--tco-border);
}

/* ---------- Pill / segmented controls ---------- */

.tco-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tco-field__label {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--tco-text);
}

.tco-pillgroup {
	display: inline-flex;
	background: var(--tco-surface-tint);
	border: 1px solid var(--tco-border);
	border-radius: var(--tco-radius-pill);
	padding: 3px;
	gap: 2px;
}

.tco-pill input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tco-pill span {
	display: block;
	padding: 7px 16px;
	border-radius: var(--tco-radius-pill);
	font-size: 13px;
	font-weight: 500;
	color: var(--tco-text-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.tco-pill input:checked + span {
	background: var(--tco-primary);
	color: #fff;
	box-shadow: 0 2px 6px rgba(23, 84, 128, 0.35);
}

.tco-pill input:focus-visible + span {
	outline: 2px solid var(--tco-primary);
	outline-offset: 2px;
}

/* ---------- Inputs / selects ---------- */

.tco-input,
.tco-select {
	width: 100%;
	padding: 9px 12px;
	font-family: var(--tco-font-body);
	font-size: 14px;
	color: var(--tco-text);
	background: var(--tco-surface);
	border: 1px solid var(--tco-border);
	border-radius: var(--tco-radius-control);
	transition: border-color 0.15s ease;
}

.tco-input:focus,
.tco-select:focus {
	outline: none;
	border-color: var(--tco-primary);
	box-shadow: 0 0 0 3px var(--tco-primary-tint);
}

/* ---------- Switches ---------- */

.tco-switch {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	cursor: pointer;
	width: fit-content;
}

.tco-switch input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tco-switch__track {
	position: relative;
	width: 38px;
	height: 22px;
	border-radius: 999px;
	background: var(--tco-border);
	transition: background 0.2s ease;
	flex-shrink: 0;
}

.tco-switch__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.tco-switch input:checked + .tco-switch__track {
	background: var(--tco-primary);
}

.tco-switch input:checked + .tco-switch__track .tco-switch__thumb {
	transform: translateX(16px);
}

.tco-switch input:focus-visible + .tco-switch__track {
	outline: 2px solid var(--tco-primary);
	outline-offset: 2px;
}

.tco-switch__label {
	font-size: 13.5px;
	color: var(--tco-text);
}

/* ---------- Checkboxes ---------- */

.tco-checkgroup {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tco-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	background: var(--tco-surface-tint);
	border: 1px solid var(--tco-border);
	border-radius: var(--tco-radius-control);
	font-size: 13px;
	color: var(--tco-text);
	cursor: pointer;
}

.tco-checkbox input {
	accent-color: var(--tco-primary);
	width: 15px;
	height: 15px;
}

/* ---------- Cost breakdown ---------- */

.tco-breakdown__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

@media (max-width: 600px) {
	.tco-breakdown__grid {
		grid-template-columns: 1fr;
	}
}

.tco-breakdown__col {
	background: var(--tco-surface-tint);
	border: 1px solid var(--tco-border);
	border-radius: var(--tco-radius-control);
	padding: 18px 20px;
}

.tco-breakdown__col-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--tco-border);
}

.tco-calculator .tco-breakdown__col-head h4 {
	margin: 0 !important;
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4 !important;
	color: var(--tco-primary-dark);
}

.tco-breakdown__col-total {
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
	color: var(--tco-primary);
}

.tco-breakdown__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.tco-breakdown__list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
}

.tco-breakdown__list li span:first-child {
	color: var(--tco-text-muted);
}

.tco-breakdown__list li span:last-child {
	font-variant-numeric: tabular-nums;
	font-weight: 500;
	color: var(--tco-text);
	white-space: nowrap;
}

.tco-breakdown__row--discount span:last-child {
	color: var(--tco-positive);
}

/* ---------- Notes (sizing / capability / compliance) ---------- */

.tco-calculator__notes {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 20px;
}

.tco-calculator .tco-note {
	margin: 0 !important;
	padding: 10px 14px;
	border-radius: var(--tco-radius-control);
	font-size: 12.5px;
	line-height: 1.5 !important;
}

.tco-note--sizing {
	background: var(--tco-surface-tint);
	border: 1px solid var(--tco-border);
	color: var(--tco-text-muted);
}

.tco-note--caution {
	background: #fff7ec;
	border: 1px solid #ffe1b3;
	color: #8a5a12;
}

.tco-note--compliance {
	background: var(--tco-primary-tint);
	border: 1px solid #c8dcec;
	color: var(--tco-primary-dark);
}

/* ---------- Data tables ---------- */

.tco-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.tco-table th,
.tco-table td {
	padding: 8px 10px;
	text-align: left;
	border-bottom: 1px solid var(--tco-border);
}

.tco-table thead th {
	font-family: var(--tco-font-heading);
	font-weight: 600;
	font-size: 11px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: var(--tco-text-muted);
	white-space: nowrap;
}

.tco-table tbody td {
	color: var(--tco-text);
	vertical-align: top;
}

.tco-table tbody tr:last-child td {
	border-bottom: none;
}

@media (max-width: 700px) {
	.tco-table {
		font-size: 12px;
	}

	.tco-table th,
	.tco-table td {
		padding: 6px 8px;
	}
}

/* ---------- Result panel (sticky) ---------- */

.tco-calculator__result {
	position: sticky;
	bottom: 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 28px;
	padding: 22px 28px;
	background: var(--tco-primary-dark);
	border-radius: var(--tco-radius-card);
	box-shadow: 0 12px 32px -8px rgba(11, 31, 51, 0.55);
	color: #fff;
	z-index: 20;
}

.tco-result__stats {
	display: flex;
	gap: 32px;
	flex-wrap: wrap;
}

.tco-result__stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tco-result__stat-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
}

.tco-result__stat-value {
	font-family: var(--tco-font-heading);
	font-size: 22px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: #fff;
}

.tco-result__stat-unit {
	font-family: var(--tco-font-body);
	font-size: 13px;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.6);
	margin-left: 3px;
}

.tco-result__verdict {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	max-width: 420px;
}

.tco-result__badge {
	flex-shrink: 0;
	padding: 7px 18px;
	border-radius: var(--tco-radius-pill);
	font-family: var(--tco-font-heading);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.tco-result__badge--cloud {
	background: var(--tco-accent);
	color: #1a1000;
}

.tco-result__badge--onprem {
	background: var(--tco-positive);
	color: #05230f;
}

.tco-result__badge--hybrid {
	background: #e8f1f8;
	color: var(--tco-primary-dark);
}

.tco-calculator .tco-result__reason {
	margin: 0 !important;
	font-size: 13.5px;
	line-height: 1.5 !important;
	color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 700px) {
	.tco-calculator__result {
		position: static;
		flex-direction: column;
		align-items: flex-start;
	}
}
