/* =========================================================
   HR Kreditni Kalkulator — style.css
   Boje se mijenjaju isključivo preko CSS varijabli ispod.
   ========================================================= */

.hrkk-calculator {
	--hrkk-primary: #0b6e4f;        /* primarna zelena (glavnica) */
	--hrkk-primary-dark: #085a40;
	--hrkk-accent: #1d6fb8;         /* plava (kamata) */
	--hrkk-fee-color: #e8a13a;      /* naknada */
	--hrkk-bg: #ffffff;
	--hrkk-surface: #f4f7f6;
	--hrkk-border: #dde5e2;
	--hrkk-text: #1c2621;
	--hrkk-muted: #5b6b64;
	--hrkk-radius: 12px;
	--hrkk-shadow: 0 4px 18px rgba(12, 44, 33, 0.08);

	max-width: 960px;
	margin: 0 auto 2rem;
	padding: clamp(1rem, 3vw, 2rem);
	background: var(--hrkk-bg);
	border: 1px solid var(--hrkk-border);
	border-radius: var(--hrkk-radius);
	box-shadow: var(--hrkk-shadow);
	color: var(--hrkk-text);
	font-size: 16px;
	line-height: 1.5;
}

.hrkk-title {
	margin: 0 0 1.25rem;
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	color: var(--hrkk-primary-dark);
}

/* ---------- Raspored ---------- */
.hrkk-grid {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: clamp(1.25rem, 3vw, 2.25rem);
}
@media (max-width: 760px) {
	.hrkk-grid { grid-template-columns: 1fr; }
}

/* ---------- Ulazna polja ---------- */
.hrkk-field { margin-bottom: 1.35rem; }

.hrkk-field-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.4rem;
	flex-wrap: wrap;
}

.hrkk-field label,
.hrkk-label {
	font-weight: 600;
	font-size: 0.95rem;
}
.hrkk-field label small { font-weight: 400; color: var(--hrkk-muted); }

.hrkk-unit-input {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.hrkk-calculator input[type="number"] {
	width: 7.5em;
	padding: 0.45em 0.6em;
	border: 1px solid var(--hrkk-border);
	border-radius: 8px;
	font: inherit;
	font-variant-numeric: tabular-nums;
	text-align: right;
	background: var(--hrkk-bg);
	color: var(--hrkk-text);
}
.hrkk-calculator input[type="number"]:focus-visible,
.hrkk-calculator select:focus-visible,
.hrkk-calculator button:focus-visible,
.hrkk-calculator input[type="range"]:focus-visible {
	outline: 2px solid var(--hrkk-accent);
	outline-offset: 2px;
}
.hrkk-calculator input[type="number"]:disabled {
	background: var(--hrkk-surface);
	color: var(--hrkk-muted);
}

.hrkk-unit { color: var(--hrkk-muted); font-size: 0.9rem; }

/* ---------- Klizači ---------- */
.hrkk-calculator input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 3px;
	background: var(--hrkk-border);
	cursor: pointer;
	margin: 0.25rem 0 0.15rem;
}
.hrkk-calculator input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--hrkk-primary);
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.hrkk-calculator input[type="range"]::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--hrkk-primary);
	border: 3px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.hrkk-range-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	color: var(--hrkk-muted);
}

/* ---------- Prekidač god./mj. ---------- */
.hrkk-term-toggle {
	display: inline-flex;
	border: 1px solid var(--hrkk-border);
	border-radius: 8px;
	overflow: hidden;
}
.hrkk-toggle-btn {
	border: 0;
	background: var(--hrkk-surface);
	padding: 0.45em 0.75em;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
	color: var(--hrkk-muted);
}
.hrkk-toggle-btn.is-active {
	background: var(--hrkk-primary);
	color: #fff;
	font-weight: 600;
}

/* ---------- Radio ---------- */
.hrkk-radio-row {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	margin-top: 0.4rem;
}
.hrkk-radio {
	flex: 1 1 200px;
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--hrkk-border);
	border-radius: 10px;
	cursor: pointer;
	background: var(--hrkk-surface);
}
.hrkk-radio:has(input:checked) {
	border-color: var(--hrkk-primary);
	background: #eef7f3;
}
.hrkk-radio input { margin-top: 0.25em; accent-color: var(--hrkk-primary); }
.hrkk-radio small { display: block; color: var(--hrkk-muted); }

/* ---------- Naknada ---------- */
.hrkk-fee-row { display: flex; gap: 0.6rem; }
.hrkk-calculator select {
	padding: 0.45em 0.6em;
	border: 1px solid var(--hrkk-border);
	border-radius: 8px;
	font: inherit;
	background: var(--hrkk-bg);
	color: var(--hrkk-text);
}

/* ---------- Rezultati ---------- */
.hrkk-results {
	background: var(--hrkk-surface);
	border: 1px solid var(--hrkk-border);
	border-radius: var(--hrkk-radius);
	padding: 1.25rem;
	align-self: start;
}
.hrkk-result {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	padding: 0.5rem 0;
	border-bottom: 1px dashed var(--hrkk-border);
}
.hrkk-result-label { color: var(--hrkk-muted); font-size: 0.9rem; }
.hrkk-result-value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.hrkk-result-main .hrkk-result-value {
	font-size: 1.5rem;
	color: var(--hrkk-primary-dark);
}
.hrkk-info {
	border: 0;
	background: var(--hrkk-accent);
	color: #fff;
	width: 1.15em;
	height: 1.15em;
	border-radius: 50%;
	font-size: 0.75em;
	line-height: 1;
	cursor: help;
	vertical-align: middle;
}

/* ---------- Pita grafikon ---------- */
.hrkk-chart-wrap {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 1.1rem 0;
}
.hrkk-pie {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	flex: 0 0 auto;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.hrkk-legend {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.88rem;
}
.hrkk-legend li { display: flex; align-items: center; gap: 0.45rem; padding: 0.15rem 0; }
.hrkk-legend strong { font-variant-numeric: tabular-nums; }
.hrkk-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.hrkk-dot-principal { background: var(--hrkk-primary); }
.hrkk-dot-interest { background: var(--hrkk-accent); }
.hrkk-dot-fee { background: var(--hrkk-fee-color); }

/* ---------- Gumbi ---------- */
.hrkk-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }
.hrkk-btn {
	flex: 1 1 auto;
	border: 0;
	border-radius: 10px;
	padding: 0.7em 1em;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	background: var(--hrkk-primary);
	color: #fff;
	transition: background 0.15s ease;
}
.hrkk-btn:hover { background: var(--hrkk-primary-dark); }
.hrkk-btn-secondary { background: var(--hrkk-accent); }
.hrkk-btn-secondary:hover { filter: brightness(0.9); }

/* ---------- Amortizacijska tablica ---------- */
.hrkk-amort { margin-top: 1.5rem; }
.hrkk-amort-toggle {
	width: 100%;
	border: 1px solid var(--hrkk-border);
	background: var(--hrkk-surface);
	border-radius: 10px;
	padding: 0.8em 1em;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
	color: var(--hrkk-primary-dark);
}
.hrkk-amort-body { overflow-x: auto; margin-top: 0.75rem; }

.hrkk-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
	font-variant-numeric: tabular-nums;
	min-width: 560px;
}
.hrkk-table th,
.hrkk-table td {
	padding: 0.5em 0.7em;
	text-align: right;
	border-bottom: 1px solid var(--hrkk-border);
	white-space: nowrap;
}
.hrkk-table th:first-child,
.hrkk-table td:first-child { text-align: left; }
.hrkk-table thead th {
	background: var(--hrkk-primary);
	color: #fff;
	position: sticky;
	top: 0;
}
.hrkk-year-row {
	background: var(--hrkk-surface);
	font-weight: 600;
	cursor: pointer;
}
.hrkk-year-row:hover { background: #eaf1ee; }
.hrkk-month-row td { color: var(--hrkk-muted); }
.hrkk-caret { display: inline-block; width: 1em; }

/* ---------- Disclaimer ---------- */
.hrkk-disclaimer {
	margin: 1.25rem 0 0;
	font-size: 0.8rem;
	color: var(--hrkk-muted);
	border-top: 1px solid var(--hrkk-border);
	padding-top: 0.85rem;
}

/* ---------- Print ---------- */
@media print {
	body * { visibility: hidden; }
	.hrkk-calculator, .hrkk-calculator * { visibility: visible; }
	.hrkk-calculator {
		position: absolute;
		inset: 0 auto auto 0;
		width: 100%;
		box-shadow: none;
		border: 0;
	}
	.hrkk-actions,
	.hrkk-amort-toggle,
	.hrkk-calculator input[type="range"],
	.hrkk-range-labels { display: none !important; }
	.hrkk-amort-body { overflow: visible; }
	.hrkk-table { min-width: 0; }
	.hrkk-month-row[hidden] { display: table-row !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.hrkk-calculator * { transition: none !important; }
}
