/* ==========================================================================
   Shared Calculator Styles
   Loaded only on pages using a calculator page template.
   ========================================================================== */

.fc-wrap {
	--fc-primary: #2563eb;
	--fc-primary-dark: #1d4ed8;
	--fc-accent: #10b981;
	--fc-bg: #ffffff;
	--fc-soft: #f6f8fb;
	--fc-border: #e3e8ef;
	--fc-text: #1f2937;
	--fc-muted: #6b7280;
	--fc-radius: 14px;
	--fc-shadow: 0 4px 18px rgba(17, 24, 39, .07);

	max-width: 1080px;
	margin: 0 auto;
	color: var(--fc-text);
	font-size: 16px;
	line-height: 1.6;
}

.fc-wrap *,
.fc-wrap *::before,
.fc-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Header ---------- */
.fc-head {
	text-align: center;
	margin-bottom: 28px;
}

.fc-head h1 {
	font-size: 2rem;
	line-height: 1.25;
	margin: 0 0 8px;
	font-weight: 700;
}

.fc-head p {
	margin: 0;
	color: var(--fc-muted);
	font-size: 1rem;
}

/* ---------- Layout ---------- */
.fc-grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 24px;
	align-items: start;
}

.fc-card {
	background: var(--fc-bg);
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius);
	box-shadow: var(--fc-shadow);
	padding: 24px;
}

.fc-card + .fc-card {
	margin-top: 24px;
}

.fc-card h2,
.fc-card h3 {
	margin: 0 0 16px;
	font-size: 1.15rem;
	font-weight: 650;
}

/* ---------- Fields ---------- */
.fc-field {
	margin-bottom: 22px;
}

.fc-field:last-child {
	margin-bottom: 0;
}

.fc-field-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.fc-label {
	font-weight: 600;
	font-size: .94rem;
}

.fc-hint {
	display: block;
	font-weight: 400;
	font-size: .8rem;
	color: var(--fc-muted);
	margin-top: 2px;
}

.fc-input-box {
	display: flex;
	align-items: center;
	background: var(--fc-soft);
	border: 1px solid var(--fc-border);
	border-radius: 9px;
	overflow: hidden;
	min-width: 130px;
}

.fc-input-box .fc-affix {
	padding: 0 10px;
	font-size: .88rem;
	color: var(--fc-muted);
	background: transparent;
	white-space: nowrap;
}

.fc-input-box input[type="number"],
.fc-input-box input[type="text"] {
	width: 100%;
	border: 0;
	background: transparent;
	padding: 9px 10px 9px 0;
	font-size: .98rem;
	font-weight: 600;
	color: var(--fc-text);
	text-align: right;
	outline: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.fc-input-box input[type="number"]::-webkit-outer-spin-button,
.fc-input-box input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fc-input-box:focus-within {
	border-color: var(--fc-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.fc-wrap select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--fc-border);
	border-radius: 9px;
	background: var(--fc-soft);
	font-size: .95rem;
	color: var(--fc-text);
}

/* ---------- Range slider ---------- */
.fc-range {
	width: 100%;
	height: 5px;
	border-radius: 5px;
	background: #dfe6f1;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	margin: 6px 0 0;
	cursor: pointer;
}

.fc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--fc-primary);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .28);
	cursor: pointer;
}

.fc-range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--fc-primary);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .28);
	cursor: pointer;
}

.fc-range-scale {
	display: flex;
	justify-content: space-between;
	font-size: .75rem;
	color: var(--fc-muted);
	margin-top: 4px;
}

/* ---------- Result panel ---------- */
.fc-result {
	background: linear-gradient(150deg, var(--fc-primary) 0%, var(--fc-primary-dark) 100%);
	color: #fff;
	border: 0;
}

.fc-result h2,
.fc-result h3 {
	color: #fff;
}

.fc-result-main {
	text-align: center;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(255, 255, 255, .22);
	margin-bottom: 18px;
}

.fc-result-main .fc-result-label {
	font-size: .86rem;
	opacity: .85;
	letter-spacing: .3px;
	text-transform: uppercase;
}

.fc-result-main .fc-result-value {
	font-size: 2.1rem;
	font-weight: 700;
	line-height: 1.2;
	margin-top: 4px;
	word-break: break-word;
}

.fc-result-rows {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fc-result-rows li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 9px 0;
	font-size: .95rem;
	border-bottom: 1px dashed rgba(255, 255, 255, .2);
}

.fc-result-rows li:last-child {
	border-bottom: 0;
}

.fc-result-rows li span:first-child {
	opacity: .88;
}

.fc-result-rows li span:last-child {
	font-weight: 650;
}

.fc-result-rows li.fc-highlight span:last-child {
	color: #d1fae5;
}

/* ---------- Donut chart ---------- */
.fc-donut-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 22px;
	flex-wrap: wrap;
	margin-top: 20px;
}

.fc-donut {
	width: 132px;
	height: 132px;
	flex: 0 0 auto;
	transform: rotate(-90deg);
}

.fc-donut circle {
	fill: none;
	stroke-width: 15;
}

.fc-legend {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: .86rem;
}

.fc-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 7px;
}

.fc-dot {
	width: 11px;
	height: 11px;
	border-radius: 3px;
	flex: 0 0 auto;
	display: inline-block;
}

/* ---------- Buttons ---------- */
.fc-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 22px;
}

.fc-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 11px 22px;
	border-radius: 9px;
	background: var(--fc-primary);
	color: #fff;
	transition: background .18s ease, transform .12s ease;
}

.fc-btn:hover {
	background: var(--fc-primary-dark);
}

.fc-btn:active {
	transform: translateY(1px);
}

.fc-btn-ghost {
	background: transparent;
	color: var(--fc-primary);
	border: 1px solid var(--fc-border);
}

.fc-btn-ghost:hover {
	background: var(--fc-soft);
	color: var(--fc-primary-dark);
}

/* ---------- Table ---------- */
.fc-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.fc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9rem;
	min-width: 520px;
}

.fc-table th,
.fc-table td {
	padding: 10px 12px;
	text-align: right;
	border-bottom: 1px solid var(--fc-border);
}

.fc-table th:first-child,
.fc-table td:first-child {
	text-align: left;
}

.fc-table thead th {
	background: var(--fc-soft);
	font-weight: 650;
	white-space: nowrap;
}

.fc-table tbody tr:nth-child(even) {
	background: #fbfcfe;
}

/* ---------- Notes / content ---------- */
.fc-note {
	font-size: .85rem;
	color: var(--fc-muted);
	margin-top: 18px;
}

.fc-content {
	margin-top: 32px;
}

.fc-content h2 {
	font-size: 1.3rem;
	margin-top: 26px;
}

.fc-faq {
	border-top: 1px solid var(--fc-border);
	padding: 14px 0;
}

.fc-faq summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

.fc-faq summary::-webkit-details-marker {
	display: none;
}

.fc-faq summary::after {
	content: "+";
	float: right;
	color: var(--fc-primary);
	font-size: 1.15rem;
	line-height: 1;
}

.fc-faq[open] summary::after {
	content: "\2212";
}

.fc-faq p {
	margin: 10px 0 0;
	color: var(--fc-muted);
	font-size: .93rem;
}

/* ---------- Dummy placeholder ---------- */
.fc-placeholder {
	border: 2px dashed var(--fc-border);
	border-radius: var(--fc-radius);
	background: var(--fc-soft);
	padding: 40px 24px;
	text-align: center;
	color: var(--fc-muted);
}

.fc-placeholder code {
	background: #eef2f7;
	padding: 2px 7px;
	border-radius: 5px;
	font-size: .85rem;
	color: #334155;
}

/* ---------- Responsive ---------- */
@media (max-width: 921px) {
	.fc-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 544px) {
	.fc-wrap {
		font-size: 15px;
	}

	.fc-head h1 {
		font-size: 1.55rem;
	}

	.fc-card {
		padding: 18px 15px;
	}

	.fc-field-top {
		flex-direction: column;
		align-items: stretch;
	}

	.fc-input-box {
		width: 100%;
	}

	.fc-result-main .fc-result-value {
		font-size: 1.7rem;
	}

	.fc-actions .fc-btn {
		flex: 1 1 100%;
		text-align: center;
	}
}

/* ---------- Print ---------- */
@media print {
	.fc-actions,
	.fc-range {
		display: none !important;
	}

	.fc-card {
		box-shadow: none;
		break-inside: avoid;
	}
}
