.afc-calculator {
	--afc-accent: #d71920;
	--afc-accent-dark: #a80f15;
	--afc-text: #202124;
	--afc-muted: #667085;
	--afc-border: #e4e7ec;
	--afc-background: #ffffff;
	--afc-soft: #f8f9fb;
	box-sizing: border-box;
	max-width: 980px;
	margin: 32px auto;
	padding: clamp(22px, 4vw, 42px);
	border: 1px solid var(--afc-border);
	border-radius: 18px;
	background: var(--afc-background);
	box-shadow: 0 12px 35px rgba(16, 24, 40, 0.08);
	color: var(--afc-text);
}

.afc-calculator *,
.afc-calculator *::before,
.afc-calculator *::after {
	box-sizing: inherit;
}

.afc-header {
	margin-bottom: 28px;
}

.afc-header h2 {
	margin: 0 0 10px;
	font-size: clamp(25px, 3vw, 38px);
	line-height: 1.15;
	color: var(--afc-text);
}

.afc-header p,
.afc-note {
	margin: 0;
	color: var(--afc-muted);
	line-height: 1.6;
}

.afc-inputs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	padding: 22px;
	border-radius: 14px;
	background: var(--afc-soft);
}

.afc-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 700;
	font-size: 15px;
}

.afc-field select,
.afc-field input {
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 12px 15px;
	border: 1px solid #cfd4dc;
	border-radius: 9px;
	background: #fff;
	color: var(--afc-text);
	font: inherit;
	font-size: 16px;
	line-height: 1.3;
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.afc-field select:focus,
.afc-field input:focus {
	outline: none;
	border-color: var(--afc-accent);
	box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.13);
}

.afc-field input[aria-invalid="true"] {
	border-color: #d92d20;
}

.afc-input-unit {
	position: relative;
}

.afc-input-unit input {
	padding-right: 54px;
}

.afc-input-unit > span {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	color: var(--afc-muted);
	font-weight: 700;
	pointer-events: none;
}

.afc-error {
	margin: 7px 0 0;
	color: #b42318;
	font-size: 14px;
}

.afc-results {
	margin-top: 30px;
}

.afc-results[hidden] {
	display: none !important;
}

.afc-results h3 {
	margin: 26px 0 12px;
	font-size: 18px;
	line-height: 1.3;
}

.afc-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.afc-grid-results {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.afc-result {
	min-height: 128px;
	padding: 18px;
	border: 1px solid var(--afc-border);
	border-radius: 12px;
	background: #fff;
	display: flex;
	flex-wrap: wrap;
	align-content: center;
	align-items: baseline;
	column-gap: 7px;
}

.afc-result span {
	flex-basis: 100%;
	margin-bottom: 12px;
	color: var(--afc-muted);
	font-size: 14px;
	line-height: 1.35;
}

.afc-result strong {
	font-size: clamp(25px, 3vw, 34px);
	line-height: 1;
	letter-spacing: -0.02em;
}

.afc-result small {
	color: var(--afc-muted);
	font-size: 13px;
	font-weight: 700;
}

.afc-result-primary {
	border-color: rgba(215, 25, 32, 0.25);
	background: linear-gradient(145deg, rgba(215, 25, 32, 0.08), rgba(215, 25, 32, 0.02));
}

.afc-result-primary strong {
	color: var(--afc-accent-dark);
}

.afc-note {
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--afc-border);
	font-size: 14px;
}

@media (max-width: 760px) {
	.afc-inputs,
	.afc-grid,
	.afc-grid-results {
		grid-template-columns: 1fr;
	}

	.afc-result {
		min-height: 108px;
	}
}
