/* ============================================================
   FML Financing Calculator — Public Styles v1.2.0
   Author: Forward Multimedia Ltd
   Two-panel layout matching the loan calculator style
   ============================================================ */

.fml-fc-wrapper {
	--fc-left-bg:           #ffffff;
	--fc-left-text:         #1a1a1a;
	--fc-label-text:        #1a1a1a;
	--fc-slider-track:      #e0e0e0;
	--fc-slider-fill:       #2563EB;
	--fc-slider-thumb:      #2563EB;
	--fc-input-border:      #d1d5db;
	--fc-input-text:        #1a1a1a;
	--fc-input-bg:          #ffffff;
	--fc-right-bg:          #1e3a5f;
	--fc-right-text:        #ffffff;
	--fc-result-amount:     #ffffff;
	--fc-divider:           rgba(255,255,255,0.25);
	--fc-btn-active-bg:     #2563EB;
	--fc-btn-active-text:   #ffffff;
	--fc-btn-inactive-bg:   #ffffff;
	--fc-btn-inactive-text: #1a1a1a;
	--fc-btn-border:        #d1d5db;

	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	box-sizing: border-box;
	max-width: 900px;
	margin: 0 auto;
}

.fml-fc-wrapper *,
.fml-fc-wrapper *::before,
.fml-fc-wrapper *::after {
	box-sizing: inherit;
}

/* ── Two-panel inner ────────────────────────────────────────── */
.fml-fc-inner {
	display: flex;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 6px 32px rgba(0,0,0,0.12);
}

/* ── Left panel ─────────────────────────────────────────────── */
.fml-fc-left {
	flex: 1 1 55%;
	background: var(--fc-left-bg);
	padding: 32px 36px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	color: var(--fc-left-text);
}

.fml-fc-left-title {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 16px;
	border-bottom: 1px solid color-mix(in srgb, var(--fc-left-text) 12%, transparent);
}

.fml-fc-icon {
	display: flex;
	align-items: center;
	color: var(--fc-slider-fill);
	flex-shrink: 0;
}

.fml-fc-icon svg { display: block; }

.fml-fc-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--fc-label-text);
}

/* ── Fields ─────────────────────────────────────────────────── */
.fml-fc-field {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fml-fc-field-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.fml-fc-label {
	font-size: 1rem;
	font-weight: 700;
	color: var(--fc-label-text);
	flex-shrink: 0;
}

/* ── Input box ──────────────────────────────────────────────── */
.fml-fc-input-wrap {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--fc-input-border);
	border-radius: 6px;
	overflow: hidden;
	background: var(--fc-input-bg);
	min-width: 110px;
	max-width: 160px;
}

.fml-fc-input-wrap--unit {
	min-width: 100px;
	max-width: 120px;
}

.fml-fc-currency {
	padding: 0 8px;
	font-weight: 700;
	font-size: .9rem;
	color: var(--fc-input-text);
	background: var(--fc-input-bg);
	border-right: 1.5px solid var(--fc-input-border);
	height: 42px;
	display: flex;
	align-items: center;
	white-space: nowrap;
	user-select: none;
}

.fml-fc-unit {
	padding: 0 8px;
	font-size: .85rem;
	color: var(--fc-input-text);
	background: var(--fc-input-bg);
	border-left: 1.5px solid var(--fc-input-border);
	height: 42px;
	display: flex;
	align-items: center;
	user-select: none;
}

.fml-fc-input {
	border: none;
	outline: none;
	padding: 0 8px;
	font-size: .95rem;
	font-weight: 700;
	color: var(--fc-input-text);
	background: transparent;
	width: 100%;
	height: 42px;
	text-align: center;
	font-family: inherit;
	-moz-appearance: textfield;
}

.fml-fc-input::-webkit-outer-spin-button,
.fml-fc-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ── Slider ─────────────────────────────────────────────────── */
.fml-fc-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 3px;
	outline: none;
	cursor: pointer;
	background: linear-gradient(
		to right,
		var(--fc-slider-fill) 0%,
		var(--fc-slider-fill) var(--fc-fill-pct, 0%),
		var(--fc-slider-track) var(--fc-fill-pct, 0%),
		var(--fc-slider-track) 100%
	);
}

.fml-fc-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--fc-slider-thumb);
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
	transition: transform 0.15s;
}

.fml-fc-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.fml-fc-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--fc-slider-thumb);
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.fml-fc-range-labels {
	display: flex;
	justify-content: space-between;
	font-size: .72rem;
	color: var(--fc-left-text);
	opacity: 0.55;
	margin-top: 4px;
	/* Pad by half the thumb width (10px) so labels centre
	   under the thumb at min and max positions */
	padding: 0 10px;
}

.fml-fc-range-labels span {
	text-align: center;
	flex: 1;
	white-space: nowrap;
}

.fml-fc-range-labels span:first-child { text-align: left; }
.fml-fc-range-labels span:last-child  { text-align: right; }

/* ── Term buttons ────────────────────────────────────────────── */
.fml-fc-terms-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

@media (max-width: 460px) {
	.fml-fc-terms-grid { grid-template-columns: repeat(3, 1fr); }
}

.fml-fc-term-btn {
	border: 1.5px solid var(--fc-btn-border);
	background: var(--fc-btn-inactive-bg);
	border-radius: 6px;
	padding: 9px 4px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--fc-btn-inactive-text);
	cursor: pointer;
	transition: all 0.15s ease;
	font-family: inherit;
	text-align: center;
	line-height: 1;
}

.fml-fc-term-btn:hover {
	border-color: var(--fc-btn-active-bg);
	color: var(--fc-btn-active-bg);
}

.fml-fc-term-btn--active {
	background: var(--fc-btn-active-bg) !important;
	border-color: var(--fc-btn-active-bg) !important;
	color: var(--fc-btn-active-text) !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Right panel ────────────────────────────────────────────── */
.fml-fc-right {
	flex: 0 0 42%;
	background: var(--fc-right-bg);
	color: var(--fc-right-text);
	padding: 32px 28px;
	display: flex;
	flex-direction: column;
}

.fml-fc-result-top {
	margin-bottom: 8px;
}

.fml-fc-result-heading {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--fc-right-text);
}

.fml-fc-result-amount {
	margin: 0 0 4px;
	font-size: 3rem;
	font-weight: 800;
	color: var(--fc-result-amount);
	line-height: 1;
	letter-spacing: -.02em;
}

.fml-fc-result-sub {
	margin: 0;
	font-size: .82rem;
	color: var(--fc-right-text);
	opacity: 0.7;
}

/* ── Divider ────────────────────────────────────────────────── */
.fml-fc-divider {
	border: none;
	border-top: 1px solid var(--fc-divider);
	margin: 14px 0;
}

/* ── Result rows ────────────────────────────────────────────── */
.fml-fc-result-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.fml-fc-result-row--total .fml-fc-result-row-title {
	font-size: 1rem;
}

.fml-fc-result-row--total .fml-fc-result-row-value {
	font-size: 1.05rem;
}

.fml-fc-result-row-left { flex: 1; }

.fml-fc-result-row-title {
	margin: 0;
	font-size: .9rem;
	font-weight: 600;
	color: var(--fc-right-text);
}

.fml-fc-result-row-value {
	margin: 0;
	font-size: .9rem;
	font-weight: 700;
	color: var(--fc-right-text);
	white-space: nowrap;
	flex-shrink: 0;
}

/* ── Disclaimer ─────────────────────────────────────────────── */
.fml-fc-disclaimer {
	margin-top: auto;
	padding-top: 20px;
	font-size: .72rem;
	color: var(--fc-right-text);
	opacity: 0.6;
	font-style: italic;
	line-height: 1.4;
}

/* ── Animation ──────────────────────────────────────────────── */
@keyframes fc-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.04); }
	100% { transform: scale(1); }
}
.fml-fc-result-amount.fml-updating {
	animation: fc-pop 0.25s ease;
}

/* ── Font size modifiers ────────────────────────────────────── */
.fml-fc-font-small  { font-size: 13px; }
.fml-fc-font-medium { font-size: 15px; }
.fml-fc-font-large  { font-size: 17px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
	.fml-fc-inner { flex-direction: column; }

	.fml-fc-left,
	.fml-fc-right {
		flex: none;
		width: 100%;
		padding: 24px 20px;
	}

	.fml-fc-result-amount { font-size: 2.5rem; }

	.fml-fc-field-header { flex-wrap: wrap; }

	.fml-fc-input-wrap {
		max-width: 100%;
		min-width: 0;
		flex: 1;
	}
}

@media (max-width: 400px) {
	.fml-fc-left,
	.fml-fc-right { padding: 20px 16px; }

	.fml-fc-result-amount { font-size: 2.1rem; }
}
