/**
 * FinanzUnity Tools — Frontend Stylesheet
 */

:root {
	--fu-primary: #00243f;
	--fu-accent: #b38724;
	--fu-bg: #fff;
	--fu-bg-alt: #f7f9f8;
	--fu-border: #e5ebe9;
	--fu-text: #1a1f1d;
	--fu-text-muted: #5a6663;
	--fu-radius: 12px;
	--fu-shadow: 0 2px 12px rgba(0, 36, 63, 0.06);
	--fu-shadow-hover: 0 6px 24px rgba(0, 36, 63, 0.12);
}

/* ========== CALCULATOR ========== */

.fu-calc {
	background: var(--fu-bg);
	border: 1px solid var(--fu-border);
	border-radius: var(--fu-radius);
	padding: 28px;
	margin: 24px 0;
	box-shadow: var(--fu-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--fu-text);
	box-sizing: border-box;
}

.fu-calc *,
.fu-calc *::before,
.fu-calc *::after {
	box-sizing: border-box;
}

.fu-calc__header {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--fu-border);
}

.fu-calc__title {
	font-size: 1.4rem;
	font-weight: 700;
	margin: 0 0 6px;
	color: var(--fu-text);
}

.fu-calc__sub {
	color: var(--fu-text-muted);
	font-size: 0.95rem;
	margin: 0;
	line-height: 1.4;
}

.fu-calc__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: 32px;
}

@media (max-width: 720px) {
	.fu-calc {
		padding: 20px;
	}
	.fu-calc__body {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

.fu-calc__inputs {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.fu-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.9rem;
}

.fu-field > span {
	font-weight: 600;
	color: var(--fu-text);
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.fu-input-wrap {
	position: relative;
	display: flex;
	align-items: stretch;
	background: var(--fu-bg-alt);
	border: 1px solid var(--fu-border);
	border-radius: 8px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.fu-input-wrap:focus-within {
	border-color: var(--fu-primary);
	box-shadow: 0 0 0 3px rgba(0, 36, 63, 0.12);
}

.fu-input-wrap input {
	flex: 1;
	width: 100%;
	border: none;
	background: transparent;
	padding: 10px 12px;
	font-size: 1rem;
	color: var(--fu-text);
	outline: none;
	font-family: inherit;
	min-width: 0;
}

.fu-suffix {
	padding: 0 12px;
	color: var(--fu-text-muted);
	font-size: 0.9rem;
	border-left: 1px solid var(--fu-border);
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.fu-select {
	width: 100%;
	border: 1px solid var(--fu-border);
	border-radius: 8px;
	background: var(--fu-bg-alt);
	padding: 10px 12px;
	font-size: 1rem;
	color: var(--fu-text);
	font-family: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235a6663' d='M6 8L0 0h12z'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px 6px;
	padding-right: 36px;
}

.fu-select:focus {
	outline: none;
	border-color: var(--fu-primary);
	box-shadow: 0 0 0 3px rgba(0, 36, 63, 0.12);
}

/* ===== Output ===== */

.fu-calc__output {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.fu-result-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.fu-result-grid--two {
	grid-template-columns: 1fr 1fr;
}

@media (max-width: 480px) {
	.fu-result-grid--two {
		grid-template-columns: 1fr;
	}
}

.fu-result {
	background: var(--fu-bg-alt);
	border-radius: 10px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.fu-result-grid:not(.fu-result-grid--two) .fu-result {
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.fu-result--primary {
	background: var(--fu-primary);
	color: #fff;
}

.fu-result--accent {
	background: rgba(179, 135, 36, 0.15);
	border-left: 3px solid var(--fu-accent);
}

.fu-result__label {
	font-size: 0.85rem;
	color: var(--fu-text-muted);
}

.fu-result--primary .fu-result__label {
	color: rgba(255, 255, 255, 0.85);
}

.fu-result__value {
	font-size: 1.25rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.fu-result-grid:not(.fu-result-grid--two) .fu-result__value {
	text-align: right;
}

/* ===== Breakdown table (for Verkaufsrechner) ===== */

.fu-breakdown {
	background: var(--fu-bg-alt);
	border-radius: 10px;
	padding: 16px;
}

.fu-breakdown h4 {
	margin: 0 0 12px;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--fu-text);
}

.fu-breakdown__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.fu-breakdown__table th {
	text-align: left;
	padding: 6px 8px 6px 0;
	font-weight: 500;
	color: var(--fu-text-muted);
}

.fu-breakdown__table td {
	text-align: right;
	padding: 6px 0;
	font-weight: 600;
	color: var(--fu-text);
}

.fu-breakdown__total th,
.fu-breakdown__total td {
	border-top: 1px solid var(--fu-border);
	padding-top: 10px;
	color: var(--fu-text);
	font-weight: 700;
}

/* ===== Chart ===== */

.fu-chart-wrap {
	position: relative;
	width: 100%;
	min-height: 240px;
	max-height: 320px;
}

.fu-chart-wrap canvas {
	width: 100% !important;
	height: 100% !important;
}

/* ===== Tooltip (?-Buttons) ===== */

.fu-tip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	min-width: 18px;
	padding: 0;
	border: none;
	background: var(--fu-primary);
	color: #fff;
	border-radius: 50%;
	font-size: 0.7rem;
	font-weight: 700;
	cursor: help;
	position: relative;
	font-family: inherit;
	line-height: 1;
	transition: background 0.15s;
}

.fu-tip:hover,
.fu-tip:focus {
	background: #001a2e;
	outline: none;
}

.fu-tip__bubble {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: 280px;
	background: #1a1f1d;
	color: #fff;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 0.8rem;
	font-weight: 400;
	line-height: 1.45;
	text-align: left;
	white-space: normal;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s, visibility 0.15s;
	z-index: 100;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.fu-tip__bubble::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1a1f1d;
}

.fu-tip:hover .fu-tip__bubble,
.fu-tip:focus .fu-tip__bubble,
.fu-tip:focus-within .fu-tip__bubble {
	opacity: 1;
	visibility: visible;
}

@media (max-width: 480px) {
	.fu-tip__bubble {
		max-width: 220px;
	}
}

/* ===== Disclaimer ===== */

.fu-disclaimer {
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--fu-border);
	font-size: 0.8rem;
	color: var(--fu-text-muted);
	line-height: 1.4;
}

/* ===== Erklaerungs-Block (details) ===== */

.fu-expl {
	margin-top: 20px;
	border: 1px solid var(--fu-border);
	border-radius: 10px;
	background: var(--fu-bg-alt);
	overflow: hidden;
}

.fu-expl__summary {
	padding: 12px 16px;
	cursor: pointer;
	font-weight: 600;
	color: var(--fu-primary);
	font-size: 0.95rem;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

.fu-expl__summary::-webkit-details-marker {
	display: none;
}

.fu-expl__summary::before {
	content: "›";
	transition: transform 0.2s;
	display: inline-block;
	font-size: 1.2rem;
	line-height: 1;
}

.fu-expl[open] .fu-expl__summary::before {
	transform: rotate(90deg);
}

.fu-expl__summary:hover {
	background: rgba(0, 36, 63, 0.04);
}

.fu-expl__body {
	padding: 0 16px 16px;
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--fu-text);
}

.fu-expl__body p {
	margin: 0 0 10px;
}

.fu-expl__steps {
	margin: 8px 0;
	padding-left: 20px;
}

.fu-expl__steps li {
	margin-bottom: 6px;
}

.fu-expl__tip {
	background: rgba(179, 135, 36, 0.12);
	padding: 10px 12px;
	border-radius: 6px;
	border-left: 3px solid var(--fu-accent);
	margin: 12px 0 0;
	font-size: 0.85rem;
}

.fu-expl__formula code {
	background: rgba(0, 36, 63, 0.08);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: ui-monospace, "SF Mono", Menlo, monospace;
	font-size: 0.85rem;
	color: var(--fu-primary);
}

/* ========== RECOMMENDATIONS ========== */

.fu-reco {
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--fu-text);
}

.fu-reco__title {
	font-size: 1.4rem;
	font-weight: 700;
	margin: 0 0 16px;
}

.fu-reco__list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.fu-reco__card {
	position: relative;
	background: var(--fu-bg);
	border: 1px solid var(--fu-border);
	border-radius: var(--fu-radius);
	padding: 24px;
	box-shadow: var(--fu-shadow);
	transition: box-shadow 0.2s;
}

.fu-reco__card:hover {
	box-shadow: var(--fu-shadow-hover);
}

.fu-reco__badge {
	position: absolute;
	top: -10px;
	left: 16px;
	background: var(--fu-accent);
	color: #1a1a1a;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.fu-reco__head {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-bottom: 12px;
}

.fu-reco__logo-wrap {
	flex: 0 0 80px;
	width: 80px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--fu-bg-alt);
	border-radius: 8px;
	overflow: hidden;
}

.fu-reco__logo {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.fu-reco__meta {
	flex: 1;
	min-width: 0;
}

.fu-reco__name {
	margin: 0 0 4px;
	font-size: 1.15rem;
	font-weight: 700;
}

.fu-reco__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9rem;
	color: var(--fu-text-muted);
}

.fu-star {
	color: #d8d8d8;
	font-size: 1rem;
	line-height: 1;
}

.fu-star--full {
	color: var(--fu-accent);
}

.fu-star--half {
	background: linear-gradient(90deg, var(--fu-accent) 50%, #d8d8d8 50%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.fu-reco__price {
	margin: 6px 0 0;
	font-size: 0.85rem;
	color: var(--fu-text-muted);
}

.fu-reco__desc {
	font-size: 0.95rem;
	line-height: 1.5;
	margin-bottom: 12px;
}

.fu-reco__desc p {
	margin: 0 0 8px;
}

.fu-reco__procons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 8px;
}

@media (max-width: 600px) {
	.fu-reco__procons {
		grid-template-columns: 1fr;
	}
}

.fu-reco__pros,
.fu-reco__cons {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 0.9rem;
}

.fu-reco__pros li,
.fu-reco__cons li {
	padding-left: 22px;
	position: relative;
	margin-bottom: 4px;
	line-height: 1.4;
}

.fu-reco__pros li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--fu-primary);
	font-weight: 700;
}

.fu-reco__cons li::before {
	content: "–";
	position: absolute;
	left: 0;
	top: 0;
	color: #b94646;
	font-weight: 700;
}

.fu-reco__foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid var(--fu-border);
	margin-top: 12px;
	flex-wrap: wrap;
}

.fu-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s, transform 0.1s;
	font-family: inherit;
}

.fu-btn--cta {
	background: var(--fu-primary);
	color: #fff;
}

.fu-btn--cta:hover {
	background: #001a2e;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}

.fu-reco__sponsored {
	font-size: 0.75rem;
	color: var(--fu-text-muted);
}
