/**
 * Compound interest calculator — Finansowy Lis Articles
 * Full-width card only (headings live in Elementor). Scoped to .fl-calc*.
 */

.fl-calc.fl-calc--compound-interest {
	--fl-calc-navy: #001a42;
	--fl-calc-orange: #eb7a02;
	--fl-calc-orange-hover: #d46d00;
	--fl-calc-text: #001a42;
	--fl-calc-muted: #6e8299;
	--fl-calc-card: #ffffff;
	--fl-calc-border: #cbd7e3;
	--fl-calc-field-bg: #f3f6fa;
	--fl-calc-radius: 12px;
	--fl-calc-radius-sm: 8px;

	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	color: var(--fl-calc-text);
}

.fl-calc.fl-calc--compound-interest *,
.fl-calc.fl-calc--compound-interest *::before,
.fl-calc.fl-calc--compound-interest *::after {
	box-sizing: border-box;
}

.fl-calc.fl-calc--compound-interest .fl-calc__panel {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 28px;
	border: 1px solid var(--fl-calc-border);
	border-radius: var(--fl-calc-radius);
	background: var(--fl-calc-card);
	box-shadow: 0 8px 24px rgba(0, 26, 66, 0.04);
	overflow: hidden;
	color: var(--fl-calc-text);
}

.fl-calc.fl-calc--compound-interest .fl-calc__form {
	margin: 0;
	width: 100%;
}

.fl-calc.fl-calc--compound-interest .fl-calc__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 20px;
	width: 100%;
}

.fl-calc.fl-calc--compound-interest .fl-calc__field {
	min-width: 0;
	width: 100%;
}

.fl-calc.fl-calc--compound-interest .fl-calc__label,
.fl-calc.fl-calc--compound-interest label.fl-calc__label {
	display: block;
	margin: 0 0 8px;
	color: #001a42;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
}

.fl-calc.fl-calc--compound-interest .fl-calc__control {
	display: flex;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--fl-calc-border);
	border-radius: var(--fl-calc-radius-sm);
	background: var(--fl-calc-field-bg);
}

.fl-calc.fl-calc--compound-interest .fl-calc__input,
.fl-calc.fl-calc--compound-interest input.fl-calc__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 4.5rem;
	margin: 0;
	padding: 12px 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #001a42;
	font: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.4;
	appearance: textfield;
	-moz-appearance: textfield;
}

.fl-calc.fl-calc--compound-interest .fl-calc__input::placeholder,
.fl-calc.fl-calc--compound-interest input.fl-calc__input::placeholder {
	color: #6e8299;
	opacity: 1;
}

.fl-calc.fl-calc--compound-interest .fl-calc__input::-webkit-outer-spin-button,
.fl-calc.fl-calc--compound-interest .fl-calc__input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.fl-calc.fl-calc--compound-interest .fl-calc__input:focus {
	outline: none;
	color: #001a42;
}

.fl-calc.fl-calc--compound-interest .fl-calc__control:focus-within {
	border-color: var(--fl-calc-orange);
	box-shadow: 0 0 0 3px rgba(235, 122, 2, 0.18);
}

.fl-calc.fl-calc--compound-interest .fl-calc__suffix {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	padding: 0 14px;
	border-left: 1px solid var(--fl-calc-border);
	color: #6e8299;
	font-size: 0.875rem;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.65);
}

.fl-calc.fl-calc--compound-interest .fl-calc__error {
	margin: 14px 0 0;
	padding: 10px 12px;
	border-radius: var(--fl-calc-radius-sm);
	background: #fff1f0;
	border: 1px solid #f5c2c0;
	color: #9b1c1c;
	font-size: 0.875rem;
	line-height: 1.4;
}

.fl-calc.fl-calc--compound-interest .fl-calc__error[hidden] {
	display: none !important;
}

.fl-calc.fl-calc--compound-interest .fl-calc__submit,
.fl-calc.fl-calc--compound-interest button.fl-calc__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 20px;
	padding: 14px 20px;
	border: 0;
	border-radius: var(--fl-calc-radius-sm);
	background: var(--fl-calc-orange);
	color: #ffffff;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.fl-calc.fl-calc--compound-interest .fl-calc__submit:hover,
.fl-calc.fl-calc--compound-interest button.fl-calc__submit:hover {
	background: var(--fl-calc-orange-hover);
	color: #ffffff;
}

.fl-calc.fl-calc--compound-interest .fl-calc__submit:focus-visible {
	outline: 2px solid var(--fl-calc-orange);
	outline-offset: 3px;
}

.fl-calc.fl-calc--compound-interest .fl-calc__submit:active {
	transform: translateY(1px);
}

.fl-calc.fl-calc--compound-interest .fl-calc__results {
	position: relative;
	margin-top: 28px;
	padding-top: 24px;
	border-top: 1px solid var(--fl-calc-border);
	width: 100%;
	min-width: 0;
}

.fl-calc.fl-calc--compound-interest .fl-calc__empty {
	margin: 0;
	color: #6e8299;
	font-size: 0.9375rem;
	line-height: 1.5;
	text-align: center;
}

.fl-calc.fl-calc--compound-interest .fl-calc__empty[hidden] {
	display: none !important;
}

.fl-calc.fl-calc--compound-interest .fl-calc__output {
	position: relative;
	padding-top: 8px;
}

.fl-calc.fl-calc--compound-interest .fl-calc__output[hidden] {
	display: none !important;
}

.fl-calc.fl-calc--compound-interest .fl-calc__output.is-visible {
	display: block;
	animation: fl-calc-fade-in 0.25s ease;
}

.fl-calc.fl-calc--compound-interest .fl-calc__output.is-hiding {
	display: block;
	animation: fl-calc-fade-out 0.18s ease forwards;
	pointer-events: none;
}

@keyframes fl-calc-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes fl-calc-fade-out {
	from {
		opacity: 1;
		transform: none;
	}
	to {
		opacity: 0;
		transform: translateY(4px);
	}
}

.fl-calc.fl-calc--compound-interest .fl-calc__results-close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--fl-calc-border);
	border-radius: 8px;
	background: #fff;
	color: #001a42;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fl-calc.fl-calc--compound-interest .fl-calc__results-close:hover {
	background: var(--fl-calc-field-bg);
	border-color: #a8b8c9;
}

.fl-calc.fl-calc--compound-interest .fl-calc__results-close:focus-visible {
	outline: 2px solid var(--fl-calc-orange);
	outline-offset: 2px;
}

.fl-calc.fl-calc--compound-interest .fl-calc__summary {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0 44px 20px 0;
	width: auto;
	max-width: 100%;
}

.fl-calc.fl-calc--compound-interest .fl-calc__stat {
	min-width: 0;
	padding: 14px 16px;
	border: 1px solid var(--fl-calc-border);
	border-radius: var(--fl-calc-radius-sm);
	background: var(--fl-calc-field-bg);
}

.fl-calc.fl-calc--compound-interest .fl-calc__stat--primary {
	background: rgba(235, 122, 2, 0.08);
	border-color: rgba(235, 122, 2, 0.28);
}

.fl-calc.fl-calc--compound-interest .fl-calc__stat-label {
	display: block;
	margin-bottom: 6px;
	color: #6e8299;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
}

.fl-calc.fl-calc--compound-interest .fl-calc__stat-value {
	display: block;
	color: #001a42;
	font-size: clamp(0.95rem, 1.6vw, 1.125rem);
	font-weight: 700;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fl-calc.fl-calc--compound-interest .fl-calc__table-wrap {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--fl-calc-border);
	border-radius: var(--fl-calc-radius-sm);
}

.fl-calc.fl-calc--compound-interest .fl-calc__table {
	width: 100%;
	min-width: 700px;
	border-collapse: separate;
	border-spacing: 0;
	background: #fff;
	color: #001a42;
}

.fl-calc.fl-calc--compound-interest .fl-calc__table th,
.fl-calc.fl-calc--compound-interest .fl-calc__table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--fl-calc-border);
	text-align: left;
	font-size: 0.875rem;
	line-height: 1.4;
	white-space: nowrap;
	color: #001a42;
}

.fl-calc.fl-calc--compound-interest .fl-calc__table thead th {
	background: var(--fl-calc-field-bg);
	font-weight: 700;
}

.fl-calc.fl-calc--compound-interest .fl-calc__table tbody tr:last-child td {
	border-bottom: 0;
}

.fl-calc.fl-calc--compound-interest .fl-calc__reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 16px;
	padding: 10px 16px;
	border: 0;
	border-radius: var(--fl-calc-radius-sm);
	background: transparent;
	color: #001a42;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color 0.15s ease;
}

.fl-calc.fl-calc--compound-interest .fl-calc__reset:hover {
	color: var(--fl-calc-orange);
}

.fl-calc.fl-calc--compound-interest .fl-calc__reset:focus-visible {
	outline: 2px solid var(--fl-calc-orange);
	outline-offset: 2px;
}

/* Desktop: capped table height + sticky header */
@media (min-width: 901px) {
	.fl-calc.fl-calc--compound-interest .fl-calc__table-wrap {
		max-height: 440px;
		overflow-x: auto;
		overflow-y: auto;
	}

	.fl-calc.fl-calc--compound-interest .fl-calc__table thead th {
		position: sticky;
		top: 0;
		z-index: 2;
		background: var(--fl-calc-field-bg);
		box-shadow: 0 1px 0 var(--fl-calc-border);
	}
}

/* Tablet / narrow: summary stacks; fields stay 2-col if possible */
@media (max-width: 900px) {
	.fl-calc.fl-calc--compound-interest .fl-calc__summary {
		grid-template-columns: 1fr;
		margin-right: 44px;
	}

	.fl-calc.fl-calc--compound-interest .fl-calc__stat-value {
		font-size: 1.05rem;
		overflow: visible;
		text-overflow: clip;
	}

	.fl-calc.fl-calc--compound-interest .fl-calc__table-wrap {
		max-height: none;
	}
}

/* Mobile: single-column fields */
@media (max-width: 640px) {
	.fl-calc.fl-calc--compound-interest .fl-calc__panel {
		padding: 20px;
	}

	.fl-calc.fl-calc--compound-interest .fl-calc__fields {
		grid-template-columns: 1fr;
	}

	.fl-calc.fl-calc--compound-interest .fl-calc__summary {
		margin-right: 0;
		padding-top: 12px;
	}

	.fl-calc.fl-calc--compound-interest .fl-calc__results-close {
		top: -4px;
	}
}
