/**
 * Smart MFO Sync — Calculator widget styles.
 * Mobile-first.
 */

.smfo-calc {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
	padding: 24px;
	max-width: 720px;
	margin: 24px auto;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	color: #111827;
}

.smfo-calc-header {
	text-align: center;
	margin-bottom: 24px;
}

.smfo-calc-header h2 {
	font-size: clamp(20px, 4vw, 26px);
	font-weight: 700;
	margin: 0 0 6px;
	color: #111827;
}

.smfo-calc-header p {
	color: #6b7280;
	margin: 0;
	font-size: 14px;
}

/* ---------- FORM ---------- */

.smfo-calc-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-bottom: 20px;
}

.smfo-calc-field {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 16px;
}

.smfo-calc-field-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	gap: 12px;
}

.smfo-calc-field-row label {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
}

.smfo-calc-input-wrap {
	display: flex;
	align-items: center;
	background: #fff;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	padding: 4px 10px;
	transition: border-color 0.15s;
}

.smfo-calc-input-wrap:focus-within {
	border-color: #2271b1;
}

.smfo-calc-input-wrap input {
	border: none;
	outline: none;
	background: transparent;
	font-size: 16px;
	font-weight: 700;
	color: #111827;
	width: 110px;
	padding: 6px 4px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

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

.smfo-calc-suffix {
	font-size: 14px;
	color: #6b7280;
	font-weight: 600;
	padding-left: 6px;
	border-left: 1px solid #e5e7eb;
	margin-left: 4px;
}

/* Range slider */

.smfo-calc-range {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	background: #d1d5db;
	border-radius: 3px;
	outline: none;
	cursor: pointer;
}

.smfo-calc-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	background: #2271b1;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	cursor: grab;
	transition: transform 0.1s;
}

.smfo-calc-range::-webkit-slider-thumb:active {
	transform: scale(1.15);
	cursor: grabbing;
}

.smfo-calc-range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	background: #2271b1;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	cursor: grab;
}

.smfo-calc-range-bounds {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 11px;
	color: #9ca3af;
}

/* ---------- RESULT ---------- */

.smfo-calc-result {
	background: linear-gradient(135deg, #1a56db 0%, #1e40af 100%);
	color: #fff;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
}

.smfo-calc-result-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 14px;
}

.smfo-calc-result-item {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	padding: 12px;
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.smfo-calc-result-total {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.3);
}

.smfo-calc-result-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	opacity: 0.85;
	margin-bottom: 4px;
	font-weight: 500;
}

.smfo-calc-result-value {
	display: block;
	font-size: clamp(18px, 4.5vw, 24px);
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.smfo-calc-rate-info {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.85);
	line-height: 1.5;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding-top: 12px;
}

/* ---------- MATCHES ---------- */

.smfo-calc-matches {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 2px dashed #e5e7eb;
}

.smfo-calc-matches h3 {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 14px;
}

.smfo-calc-matches-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.smfo-calc-match {
	display: grid;
	grid-template-columns: 60px 1fr auto;
	gap: 12px;
	align-items: center;
	background: #fff;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	padding: 12px 14px;
	transition: border-color 0.15s, transform 0.15s;
}

.smfo-calc-match:hover {
	border-color: #2271b1;
	transform: translateY(-1px);
}

.smfo-calc-match img {
	width: 60px;
	height: 40px;
	object-fit: contain;
}

.smfo-calc-match-info {
	min-width: 0;
}

.smfo-calc-match-name {
	font-weight: 700;
	font-size: 14px;
	color: #111827;
	margin-bottom: 2px;
}

.smfo-calc-match-stats {
	font-size: 12px;
	color: #6b7280;
}

.smfo-calc-match-stats strong {
	color: #15803d;
	font-variant-numeric: tabular-nums;
}

.smfo-calc-match-cta {
	background: #15803d;
	color: #fff !important;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 16px;
	border-radius: 8px;
	white-space: nowrap;
	transition: background 0.15s;
}

.smfo-calc-match-cta:hover {
	background: #166534;
}

.smfo-calc-no-matches {
	color: #6b7280;
	font-size: 13px;
	text-align: center;
	padding: 16px;
	background: #fef3c7;
	border-radius: 8px;
	border: 1px solid #fcd34d;
}

/* ---------- DISCLAIMER ---------- */

.smfo-calc-disclaimer {
	margin-top: 16px;
	padding: 10px 14px;
	background: #fef9c3;
	border-left: 3px solid #ca8a04;
	border-radius: 6px;
	font-size: 12px;
	color: #713f12;
	line-height: 1.5;
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px) {
	.smfo-calc {
		padding: 16px;
		border-radius: 12px;
	}

	.smfo-calc-result-row {
		grid-template-columns: 1fr;
	}

	.smfo-calc-match {
		grid-template-columns: 50px 1fr;
		gap: 10px;
	}

	.smfo-calc-match-cta {
		grid-column: 1 / -1;
		text-align: center;
	}

	.smfo-calc-input-wrap input {
		width: 90px;
		font-size: 15px;
	}
}
