/*
 * Factoring calculator (pragmago.ro) — Figma "Verificați costul factoringului"
 * (file lDFZe94R6NVs6izLPqRgw8, page 695:913). Namespaced under .pgro-fcalc so it
 * does not collide with the legacy .calculator / .calc-* styles.
 */
.pgro-fcalc {
	--fc-blue: var(--wp--preset--color--primary, #3e4cb4);
	--fc-red: var(--wp--preset--color--primary-main, #f31f43);
	--fc-line: var(--wp--preset--color--secondary-header, #e5e8f2);
	--fc-ink: #0a0f16;
	--fc-label: var(--wp--preset--color--pragmablack, #0e2639);
	--fc-muted: #84929c;
	--fc-card: #f4f5f6;
	--fc-font: var(--wp--preset--font-family--rubik, Rubik, sans-serif);
	font-family: var(--fc-font);
	font-weight: 400;
	color: var(--fc-ink);
	line-height: 1.35;
}
.pgro-fcalc *,
.pgro-fcalc *::before,
.pgro-fcalc *::after {
	box-sizing: border-box;
}
.pgro-fcalc [hidden] {
	display: none !important;
}

/* ── Layout ─────────────────────────────────────────────── */
.pgro-fcalc__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 385px;
	gap: 26px;
	align-items: start;
}
@media (max-width: 900px) {
	.pgro-fcalc__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}
}

/* ── Left column ────────────────────────────────────────── */
.pgro-fcalc .pgro-fcalc__form .pgro-fcalc__title {
	margin: 0 0 40px;
	font-family: var(--fc-font);
	font-size: var(--wp--preset--font-size--size-h-2, 2.3125rem);
	font-weight: 500;
	line-height: 1.25;
	color: #091925;
}
.pgro-fcalc__field + .pgro-fcalc__field {
	margin-top: 36px;
}
.pgro-fcalc .pgro-fcalc__form .pgro-fcalc__label {
	display: block;
	margin: 0 0 20px;
	font-size: 16px;
	font-weight: 500;
	line-height: 22px;
	color: var(--fc-label);
}

/* Type select */
.pgro-fcalc__select {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 50px 0 26px;
	border: 1px solid var(--fc-line);
	border-radius: 6px;
	background: #fff url("img/select-chevron.svg") no-repeat right 23px center;
	background-size: 14px 8px;
	font-family: var(--fc-font);
	font-size: 18px;
	font-weight: 400;
	line-height: 24px;
	color: var(--fc-ink);
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	cursor: pointer;
}
.pgro-fcalc__select:focus-visible {
	outline: 2px solid var(--fc-blue);
	outline-offset: 2px;
}

/* Variant toggle */
.pgro-fcalc__toggle {
	display: flex;
	gap: 27px;
}
.pgro-fcalc__toggle-btn {
	flex: 1 1 0;
	min-width: 0;
	min-height: 50px;
	margin: 0;
	padding: 12px 16px;
	white-space: normal;
	border: 1px solid #afafb7;
	border-radius: 42px;
	background: #fff;
	font-family: var(--fc-font);
	font-size: 16px;
	font-weight: 500;
	line-height: 22px;
	color: #505050;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.pgro-fcalc__toggle-btn:hover {
	border-color: var(--fc-blue);
	color: var(--fc-blue);
}
.pgro-fcalc__toggle-btn.is-active,
.pgro-fcalc__toggle-btn.is-active:hover {
	border-color: var(--fc-blue);
	background: var(--fc-blue);
	color: #fff;
}
.pgro-fcalc__toggle-btn:focus-visible {
	outline: 2px solid var(--fc-blue);
	outline-offset: 2px;
}
@media (max-width: 480px) {
	.pgro-fcalc__toggle {
		flex-direction: column;
		gap: 12px;
	}
	/* In the column layout `flex: 1 1 0` would collapse the buttons to their text
	   height — size them by content instead and keep the 50px minimum. */
	.pgro-fcalc__toggle-btn {
		flex: 0 0 auto;
		width: 100%;
		min-height: 50px;
	}
}

/* Slider + number input row */
.pgro-fcalc__control {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	margin-top: 29px;
}
.pgro-fcalc__slider-wrap {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 12px;
}
.pgro-fcalc .pgro-fcalc__form .pgro-fcalc__range {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 18px;
	font-size: 12px;
	line-height: 1;
	color: var(--fc-muted);
}
.pgro-fcalc__input {
	display: flex;
	align-items: center;
	flex: 0 0 178px;
	width: 178px;
	height: 50px;
	padding: 0 13px 0 12px;
	border: 1px solid var(--fc-line);
	border-radius: 6px;
	background: #fff;
}
.pgro-fcalc__input:focus-within {
	border-color: var(--fc-blue);
}
.pgro-fcalc__input input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-family: var(--fc-font);
	font-size: 18px;
	font-weight: 400;
	line-height: 24px;
	color: var(--fc-ink);
}
.pgro-fcalc__input input:focus {
	outline: none;
}
.pgro-fcalc__unit {
	flex: 0 0 auto;
	margin-left: 8px;
	font-size: 18px;
	font-weight: 500;
	line-height: 24px;
	color: rgba(62, 76, 180, .5);
}
@media (max-width: 560px) {
	.pgro-fcalc__control {
		flex-direction: column-reverse;
		gap: 22px;
	}
	.pgro-fcalc__input {
		flex-basis: auto;
		width: 100%;
	}
	.pgro-fcalc__slider-wrap {
		width: 100%;
		padding-top: 14px;
	}
}

/* noUiSlider skin (overrides the theme + pragma-old-blocks globals) */
.pgro-fcalc .noUi-target,
.pgro-fcalc .noUi-horizontal {
	height: 8px;
	margin: 0 18px;
	border: 0;
	border-radius: 0;
	background: var(--fc-line);
	box-shadow: inset 0 0 3px rgba(0, 0, 0, .16);
}
/* The handle is 36px and centred on the value, so inset the base by 18px and draw
   the missing track ends with pseudo-elements: the handle then stays inside the
   track bounds like in the Figma design (left stub is always "filled", right stub
   is always "empty" — both are covered by the handle at min / max). */
.pgro-fcalc .pgro-fcalc__slider {
	margin: 0 18px;
}
.pgro-fcalc .noUi-target::before,
.pgro-fcalc .noUi-target::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 18px;
	box-shadow: inset 0 0 3px rgba(0, 0, 0, .16);
}
.pgro-fcalc .noUi-target::before {
	left: -18px;
	border-radius: 30px 0 0 30px;
	background: var(--fc-blue);
}
.pgro-fcalc .noUi-target::after {
	right: -18px;
	border-radius: 0 30px 30px 0;
	background: var(--fc-line);
}
.pgro-fcalc .noUi-connects {
	border-radius: 0;
}
.pgro-fcalc .noUi-connect {
	background: var(--fc-blue);
}
.pgro-fcalc .noUi-horizontal .noUi-handle,
html:not([dir=rtl]) .pgro-fcalc .noUi-horizontal .noUi-handle {
	top: -14px;
	right: -18px;
	left: auto;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent url("img/slider-handle.svg") no-repeat center / 36px 36px;
	box-shadow: none;
	cursor: grab;
}
.pgro-fcalc .noUi-horizontal .noUi-handle::before,
.pgro-fcalc .noUi-horizontal .noUi-handle::after {
	display: none;
}
.pgro-fcalc .noUi-state-drag .noUi-handle {
	cursor: grabbing;
}
.pgro-fcalc .noUi-handle:focus-visible {
	outline: 2px solid var(--fc-blue);
	outline-offset: 2px;
}
.pgro-fcalc .noUi-pips {
	display: none;
}

/* ── Right column: promo + result card ──────────────────── */
.pgro-fcalc__result {
	width: 100%;
	max-width: 385px;
}
@media (max-width: 900px) {
	.pgro-fcalc__result {
		max-width: none;
	}
}
.pgro-fcalc__promo {
	padding: 30px;
	border-radius: 8px 8px 0 0;
	background: var(--fc-blue);
	color: #fff;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__promo-title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #d8dbf0;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__promo-text {
	margin: 0;
	padding: 0;
	font-size: 18px;
	font-weight: 400;
	line-height: 24px;
	color: #fff;
}
.pgro-fcalc__card {
	padding: 30px;
	border-radius: 0 0 8px 8px;
	background: var(--fc-card);
}
.pgro-fcalc__result--no-promo .pgro-fcalc__card {
	border-radius: 8px;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__result-label {
	margin: 0 0 10px;
	font-size: 20px;
	font-weight: 500;
	line-height: 27px;
	color: #060a0e;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__amount {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	margin: 0;
	font-size: var(--wp--preset--font-size--size-h-2, 2.3125rem);
	font-weight: 500;
	line-height: 46px;
	color: var(--fc-blue);
	overflow-wrap: anywhere;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__amount-suffix {
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	color: #707070;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__fee {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #afafb7;
	font-size: 16px;
	font-weight: 400;
	line-height: 20px;
	color: #505050;
}
.pgro-fcalc__fee-value {
	text-align: right;
	white-space: nowrap;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__note {
	margin: 20px 0 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 20px;
	color: #757575;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 60px;
	margin-top: 30px;
	padding: 10px 20px;
	border: 2px solid var(--fc-red);
	border-radius: 50px;
	background: var(--fc-red);
	font-family: var(--fc-font);
	font-size: 18px;
	font-weight: 600;
	line-height: 24px;
	text-align: center;
	text-decoration: none;
	color: #fff;
	transition: background-color .15s, color .15s;
}
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__cta:hover,
.pgro-fcalc .pgro-fcalc__result .pgro-fcalc__cta:focus-visible {
	background: #fff;
	color: var(--fc-red);
	text-decoration: none;
}

/* Editor preview: keep the card readable inside the narrow ACF preview. */
.block-editor-block-list__layout .pgro-fcalc__grid {
	grid-template-columns: minmax(0, 1fr) minmax(280px, 385px);
}
