:root {
	--bg: #f7f8fa;
	--surface: #ffffff;
	--text: #14213d;
	--muted: #5b6475;
	--border: #e2e6ee;
	--primary: #0b5fff;
	--primary-text: #ffffff;
	--success-bg: #e7f6ec;
	--success-text: #14532d;
	--error-bg: #fdecec;
	--error-text: #8a1c1c;
}

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a {
	color: var(--primary);
}

h1 {
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	line-height: 1.15;
	margin: 0 0 1rem;
}

h2 {
	font-size: 1.15rem;
	margin: 0 0 .5rem;
}

.container {
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	padding: 0 16px;
}

.container.narrow {
	max-width: 440px;
	padding-top: 48px;
	padding-bottom: 48px;
}

main.container {
	padding-top: 40px;
	padding-bottom: 48px;
}

.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 60px;
}

.brand {
	font-weight: 700;
	font-size: 1.15rem;
	color: var(--text);
	text-decoration: none;
}

.nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

.inline-form {
	display: inline;
	margin: 0;
}

.link-button {
	background: none;
	border: 0;
	padding: 0;
	color: var(--primary);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.btn {
	display: inline-block;
	padding: 12px 20px;
	border: 0;
	border-radius: 8px;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.btn-primary {
	background: var(--primary);
	color: var(--primary-text);
}

.btn-small {
	padding: 8px 14px;
}

.hero {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	padding: 64px 0 56px;
}

.eyebrow {
	color: var(--primary);
	font-weight: 600;
	margin: 0 0 .75rem;
}

.lead {
	font-size: 1.15rem;
	color: var(--muted);
	max-width: 640px;
}

.muted {
	color: var(--muted);
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	padding-top: 32px;
	padding-bottom: 48px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 20px;
}

.card p {
	margin: 0;
	color: var(--muted);
}

.form {
	display: grid;
	gap: 6px;
	margin: 24px 0;
}

.form label {
	font-weight: 600;
	margin-top: 10px;
}

.form input {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font: inherit;
	background: var(--surface);
}

.form input:focus {
	outline: 2px solid var(--primary);
	outline-offset: 1px;
}

.form .btn {
	margin-top: 18px;
}

.field-error {
	margin: 0;
	color: var(--error-text);
	font-size: .9rem;
}

.alert {
	padding: 12px 14px;
	border-radius: 8px;
}

.alert-success {
	background: var(--success-bg);
	color: var(--success-text);
}

.alert-error {
	background: var(--error-bg);
	color: var(--error-text);
}

.site-footer {
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: .85rem;
	padding: 20px 0 32px;
}

/* --- aplikacija: cjenici i stavke --- */

:root {
	--danger: #b42318;
	--info-bg: #e8f0ff;
	--info-text: #1e3a8a;
	--sale-bg: #fff1e6;
	--sale-text: #9a3412;
}

.container.medium {
	max-width: 720px;
}

.breadcrumb {
	margin: 0 0 12px;
	font-size: .95rem;
}

.page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.page-head h1 {
	margin-bottom: .25rem;
}

.page-head .muted {
	margin: 0;
}

.btn-secondary {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
}

.btn-danger {
	background: var(--surface);
	color: var(--danger);
	border: 1px solid var(--danger);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 20px;
}

.actions form {
	margin: 0;
}

main .card {
	margin-top: 20px;
}

main .card p {
	color: var(--muted);
}

.empty-state p {
	max-width: 620px;
}

.list {
	list-style: none;
	padding: 0;
	margin: 20px 0 0;
	display: grid;
	gap: 10px;
}

.list-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 14px 16px;
}

.list-main {
	display: grid;
	gap: 2px;
	color: var(--text);
	text-decoration: none;
	min-width: 0;
}

.table-wrap {
	overflow-x: auto;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
}

.table {
	width: 100%;
	border-collapse: collapse;
}

.table th,
.table td {
	padding: 10px 14px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--border);
}

.table thead th {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--muted);
	white-space: nowrap;
}

.table tbody:last-child tr:last-child td {
	border-bottom: 0;
}

.table .num {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.table .group-row th {
	background: var(--bg);
	font-size: .95rem;
}

.table .row-actions {
	text-align: right;
	white-space: nowrap;
}

.sub {
	color: var(--muted);
	font-size: .85rem;
}

.badge {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--muted);
	font-size: .78rem;
	white-space: nowrap;
}

.badge-sale {
	background: var(--sale-bg);
	border-color: transparent;
	color: var(--sale-text);
}

.quick-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	align-items: start;
}

.quick-grid .field-wide {
	grid-column: span 2;
}

.field label {
	display: block;
	font-weight: 600;
	font-size: .9rem;
	margin-bottom: 4px;
}

/* Gumb stoji u ravnini s poljima i kad se ispod nekog polja pojavi poruka o grešci. */
.field-button {
	align-self: start;
	padding-top: calc(.9rem * 1.55 + 4px);
}

.field-button .btn {
	width: 100%;
}

.quick-form input,
.quick-form select,
.inline-add input,
.form select,
.form textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font: inherit;
	background: var(--surface);
	color: var(--text);
}

.quick-form input:focus,
.quick-form select:focus,
.inline-add input:focus,
.form select:focus,
.form textarea:focus {
	outline: 2px solid var(--primary);
	outline-offset: 1px;
}

.hint {
	font-size: .88rem;
	color: var(--muted);
	margin: 10px 0 0;
}

.inline-add {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.inline-add input {
	flex: 1 1 220px;
}

.form fieldset {
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	padding: 8px 18px 18px;
	margin: 0 0 8px;
	display: grid;
	gap: 6px;
	min-width: 0;
}

.form legend {
	font-weight: 700;
	padding: 0 6px;
}

.form-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0 16px;
}

.form-row > div {
	display: grid;
	gap: 6px;
	align-content: start;
}

.form .check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400;
}

.form .check input {
	width: auto;
	margin-top: 5px;
	flex: none;
}

.form .hint {
	margin: 4px 0;
}

.alert-info {
	background: var(--info-bg);
	color: var(--info-text);
}

.danger-zone {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--border);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 520px) {
	.quick-grid .field-wide {
		grid-column: auto;
	}
}

/* --- objava --- */

.head-actions {
	margin-top: 0;
	align-items: center;
}

.btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.alert a {
	color: inherit;
	font-weight: 600;
}

.file-list {
	list-style: none;
	padding: 0;
	margin: 8px 0 0;
	display: grid;
	gap: 10px;
	overflow-wrap: anywhere;
}

code {
	font-size: .9em;
	overflow-wrap: anywhere;
}

/* --- javni cjenik --- */

.public-head {
	padding: 36px 0 8px;
}

.public-head h1 {
	margin-bottom: .25rem;
}

.public-head .muted {
	margin: 0;
}

.public-section {
	margin-top: 28px;
}

.public-section h2 {
	font-size: 1.25rem;
	margin-bottom: .75rem;
}

.public-section > .sub {
	margin: 8px 2px 0;
}

.public-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 36px 0 40px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
	font-size: .9rem;
}

.share-grid {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 16px;
	align-items: start;
}

.share-grid img {
	width: 120px;
	height: 120px;
	border: 1px solid var(--border);
	border-radius: 8px;
}

.share-url {
	display: block;
	padding: 10px 12px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow-wrap: anywhere;
}

.table .files {
	overflow-wrap: anywhere;
	min-width: 180px;
}

/* --- ugradnja u tuđi web --- */

body.embed {
	background: transparent;
}

body.embed main {
	padding: 0 2px;
}

body.embed .public-section:first-of-type {
	margin-top: 0;
}

body.embed .public-foot {
	margin: 16px 0 4px;
}

.snippet {
	display: block;
	margin: 8px 0 0;
	padding: 12px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 8px;
	font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	color: var(--text);
	width: 100%;
	resize: vertical;
}

.steps {
	margin: 8px 0 0;
	padding-left: 20px;
	color: var(--muted);
}

.error-list {
	margin: 8px 0 0;
	padding-left: 20px;
}

.inline-add input[type="file"] {
	padding: 8px;
}

/* --- wizard --- */

.wizard-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	list-style: none;
	counter-reset: korak;
	padding: 0;
	margin: 0 0 24px;
	font-size: .9rem;
	color: var(--muted);
}

.wizard-steps li {
	counter-increment: korak;
}

.wizard-steps li::before {
	content: counter(korak);
	display: inline-block;
	width: 22px;
	height: 22px;
	margin-right: 6px;
	border-radius: 50%;
	border: 1px solid var(--border);
	text-align: center;
	line-height: 20px;
	font-size: .8rem;
}

.wizard-steps .current {
	color: var(--text);
	font-weight: 600;
}

.wizard-steps .current::before {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--primary-text);
}

.wizard-steps .done::before {
	content: "✓";
	background: var(--success-bg);
	border-color: transparent;
	color: var(--success-text);
}

.choice-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.choice {
	display: grid;
	gap: 4px;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--text);
	text-decoration: none;
}

.choice:hover,
.choice:focus-visible {
	border-color: var(--primary);
	outline: none;
}

.choice .muted {
	font-size: .9rem;
}

.wizard-table input[type="text"] {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--border);
	border-radius: 8px;
	font: inherit;
	background: var(--surface);
	color: var(--text);
}

.wizard-table input:focus {
	outline: 2px solid var(--primary);
	outline-offset: 1px;
}

.wizard-table .num input {
	text-align: right;
	min-width: 84px;
}

.wizard-table td {
	vertical-align: middle;
}

.wizard-table th.num,
.wizard-table td.num {
	width: 150px;
}

/* Na mobitelu tablica s tri stupca ne stane: redak postaje kartica – naziv gore, dvije cijene ispod. */
@media (max-width: 600px) {
	.wizard-table,
	.wizard-table tbody,
	.wizard-table tr,
	.wizard-table th,
	.wizard-table td {
		display: block;
	}

	.wizard-table thead {
		display: none;
	}

	.wizard-table tr:not(.group-row) {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 6px 10px;
		padding: 12px;
		border-bottom: 1px solid var(--border);
	}

	.wizard-table tr:not(.group-row) td {
		padding: 0;
		border: 0;
		width: auto;
	}

	.wizard-table tr:not(.group-row) td:first-child {
		grid-column: 1 / -1;
	}

	.wizard-table td.num {
		text-align: left;
	}

	.wizard-table td.num::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		font-size: .75rem;
		color: var(--muted);
	}

	.wizard-table .num input {
		text-align: left;
		min-width: 0;
	}

	.share-grid {
		grid-template-columns: 1fr;
	}
}

/* --- semafor usklađenosti --- */

:root {
	--warn-bg: #fff6db;
	--warn-text: #7a5600;
}

.light {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--surface);
}

.light-dot {
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
}

.light-crveno .light-dot { background: var(--danger); }
.light-zuto .light-dot { background: #e0a800; }
.light-zeleno .light-dot { background: #1f9d55; }

a.light {
	color: var(--text);
	text-decoration: none;
	margin-top: 16px;
}

a.light:hover {
	border-color: var(--primary);
}

.checks {
	list-style: none;
	padding: 0;
	margin: 20px 0 0;
	display: grid;
	gap: 10px;
}

.check-row {
	display: flex;
	gap: 14px;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
}

.check-icon {
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 700;
	background: var(--bg);
	color: var(--muted);
}

.check-ok .check-icon { background: var(--success-bg); color: var(--success-text); }
.check-nedostaje .check-icon { background: var(--error-bg); color: var(--error-text); }
.check-upozorenje .check-icon { background: var(--warn-bg); color: var(--warn-text); }

.check-body {
	min-width: 0;
}

.check-body p {
	margin: 4px 0 0;
	color: var(--muted);
}

.check-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.check-actions form {
	margin: 0;
}

/* --- pravni tekstovi --- */

.legal h2 {
	font-size: 1.15rem;
	margin: 28px 0 8px;
}

.legal p,
.legal li {
	line-height: 1.65;
}

.legal ul {
	padding-left: 22px;
}

.facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 18px;
	margin: 12px 0 16px;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
}

.facts dt {
	color: var(--muted);
}

.facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 8px 0 0;
}

.footer-links a {
	color: var(--muted);
}

@media (max-width: 520px) {
	.facts {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.facts dd {
		margin-bottom: 8px;
	}
}

/* --- paketi --- */

.plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin: 24px 0;
}

.plan {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 20px;
}

.plan-current {
	border-color: var(--primary);
	box-shadow: 0 0 0 1px var(--primary);
}

.plan h2 {
	font-size: 1.2rem;
}

.plan-price {
	margin: 4px 0 8px;
}

.plan-price strong {
	font-size: 1.8rem;
}

.plan ul {
	margin: 12px 0 0;
	padding-left: 20px;
	display: grid;
	gap: 4px;
}

.plan-line {
	margin: 16px 0 0;
}
