:root {
	--red: #8b1e16;
	--red-dark: #6a140e;
	--red-light: #a8291f;
	--gold: #e9c98c;
	--gold-dark: #c9a465;
	--parchment: #f4e3b5;
	--parchment-dark: #e6cd92;
	--ink: #3b2412;
	--sand: #d8c08a;
	--green: #4f7a32;
	--error: #b3170d;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
	color: var(--ink);
	line-height: 1.45;
	min-height: 100vh;
	/* desert sky like mavericks.de */
	background:
		radial-gradient(ellipse at 15% 22%, rgba(255,255,255,.55) 0, rgba(255,255,255,0) 30%),
		radial-gradient(ellipse at 85% 30%, rgba(255,255,255,.45) 0, rgba(255,255,255,0) 25%),
		linear-gradient(180deg, #3e5f93 0, #6f8fbf 14%, #b9c6d6 30%, #d9c9a4 38%, #d2b97f 46%, #cdb276 100%);
	background-attachment: fixed;
}

svg { width: 1em; height: 1em; vertical-align: middle; }

.page {
	max-width: 1180px;
	margin: 24px auto;
	background: var(--red);
	padding: 18px;
	box-shadow: 0 10px 40px rgba(40, 10, 0, .45);
	background-image: radial-gradient(rgba(0,0,0,.08) 1px, transparent 1px);
	background-size: 4px 4px;
}

/* ---------- Hero ---------- */

.hero {
	position: relative;
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: 260px;
	padding: 18px 24px 18px 0;
	overflow: hidden;
	background:
		linear-gradient(90deg, rgba(25,10,30,.15), rgba(25,10,30,.55)),
		repeating-linear-gradient(90deg, #6f5a9a 0 60px, #7a66a6 60px 64px, #8673b0 64px 130px, #6b578f 130px 136px),
		#7a66a6;
}

.hero::after {
	/* wooden western facade floor */
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 34px;
	background: repeating-linear-gradient(90deg, #4b2c1a 0 38px, #5c3722 38px 40px);
	opacity: .8;
}

.logo-plate {
	position: relative;
	z-index: 2;
	flex: 0 0 auto;
	width: 330px;
	padding: 22px 18px 34px;
	text-align: center;
	background: var(--red-light);
	background-image:
		radial-gradient(rgba(0,0,0,.18) 1px, transparent 1.5px),
		radial-gradient(rgba(255,255,255,.06) 1px, transparent 1.5px);
	background-size: 5px 5px, 7px 7px;
	box-shadow: 6px 6px 18px rgba(0,0,0,.45);
	color: var(--gold);
	display: flex;
	flex-direction: column;
	line-height: 1;
}

.logo-die { font-family: "Sancreek", Georgia, serif; font-size: 34px; transform: rotate(-6deg); }
.logo-main { font-family: "Rye", Georgia, serif; font-size: 38px; letter-spacing: 1px; margin: 6px 0 8px; text-transform: uppercase; }
.logo-sub { font-family: "Rye", Georgia, serif; font-size: 17px; letter-spacing: 2px; text-transform: uppercase; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); padding: 5px 0; margin: 0 20px; }
.logo-show { font-family: "Sancreek", Georgia, serif; font-size: 30px; margin-top: 4px; }
.logo-ribbon {
	position: absolute;
	left: 50%;
	bottom: -14px;
	transform: translateX(-50%) rotate(-3deg);
	background: var(--gold);
	color: var(--red-dark);
	font-family: "Rye", Georgia, serif;
	font-size: 17px;
	padding: 7px 28px;
	white-space: nowrap;
	clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
}

.hero-caption {
	position: relative;
	z-index: 2;
	max-width: 470px;
	background: rgba(22, 12, 10, .86);
	color: var(--gold);
	padding: 20px 26px;
}

.hero-caption h1 {
	margin: 0 0 8px;
	font-size: 34px;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.hero-caption p { margin: 0; font-weight: 600; font-size: 16px; }

.hero-money {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.hero-money .float { position: absolute; filter: drop-shadow(3px 4px 3px rgba(0,0,0,.4)); }
.hero-money .bag { width: 120px; height: 120px; right: 34px; bottom: 26px; }
.hero-money .coins { width: 70px; height: 70px; right: 160px; bottom: 30px; }
.hero-money .note { width: 90px; height: 56px; }
.hero-money .n1 { right: 150px; top: 24px; transform: rotate(-18deg); animation: flutter 5s ease-in-out infinite; }
.hero-money .n2 { right: 40px; top: 40px; transform: rotate(14deg); animation: flutter 6s ease-in-out infinite reverse; }

@keyframes flutter {
	0%, 100% { translate: 0 0; }
	50% { translate: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.hero-money .note { animation: none; }
}

/* ---------- Tiles ---------- */

.tiles {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-top: 18px;
	padding: 10px;
	background: var(--sand);
}

.tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 8px 10px;
	background: linear-gradient(180deg, #f6e9c6, #e8d29f);
	color: var(--red);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 14px;
	text-align: center;
}

.tile svg { width: 52px; height: 52px; }

.breadcrumb {
	margin: 18px 0 14px;
	padding-top: 10px;
	border-top: 4px solid var(--sand);
	color: var(--gold);
	font-size: 14px;
}

/* ---------- Layout ---------- */

.content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 22px;
	align-items: start;
}

.parchment, .card {
	background:
		radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 45%),
		radial-gradient(ellipse at 80% 90%, rgba(150,100,30,.18), transparent 50%),
		radial-gradient(ellipse at 60% 40%, rgba(180,130,50,.12), transparent 40%),
		var(--parchment);
	box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 0 40px rgba(140,90,20,.25);
}

.parchment { padding: 28px 32px 32px; }

h2, h3 { color: var(--red); margin: 0 0 18px; }
h2 { font-size: 26px; }
h3 { font-size: 19px; }

.h-icon { width: 1.4em; height: 1.4em; margin-right: 4px; vertical-align: -6px; }
.l-icon { width: 1.5em; height: 1.5em; margin-right: 4px; vertical-align: -6px; }

/* ---------- Form ---------- */

fieldset {
	border: 0;
	border-top: 2px dashed rgba(139, 30, 22, .35);
	margin: 0 0 8px;
	padding: 18px 0 10px;
}

legend {
	padding: 0 10px 0 0;
	color: var(--red);
	font-weight: 700;
	font-size: 18px;
}

legend small, label small { font-weight: 400; color: #6b4a2a; }

.template-box {
	border: 2px solid var(--gold-dark);
	background: rgba(255, 248, 225, .6);
	padding: 14px 16px;
	margin-bottom: 18px;
}

.template-box label { display: block; color: var(--red); font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.template-box small { display: block; margin-top: 6px; color: #6b4a2a; }

.grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
}

.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid + .grid { margin-top: 12px; }
.span-2 { grid-column: span 2; }

label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

input, select {
	font: inherit;
	font-weight: 400;
	color: var(--ink);
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #b8955a;
	border-radius: 3px;
	background: #fffaf0;
	box-shadow: inset 0 1px 3px rgba(90, 60, 20, .15);
}

input:focus, select:focus {
	outline: none;
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(139, 30, 22, .2);
}

input.from-template { background: #fbf2d8; }
input.has-error, select.has-error { border-color: var(--error); background: #fff0ee; }

.field-error { color: var(--error); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }

.hint { font-size: 13px; color: #6b4a2a; margin: 10px 0 0; }

.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }

.radio-card {
	flex-direction: row;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	border: 2px solid #d3b57a;
	background: rgba(255, 250, 235, .7);
	cursor: pointer;
	font-weight: 400;
}

.radio-card input { width: auto; margin-top: 4px; accent-color: var(--red); box-shadow: none; }
.radio-card:has(input:checked) { border-color: var(--red); background: #fff7e2; }

.small-business-only { display: none; }
.is-small-business .small-business-only { display: inline; }
.is-small-business .vat-only { opacity: .4; pointer-events: none; }

/* ---------- Lines ---------- */

.lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.line {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 70px 115px 110px 100px 36px;
	gap: 8px;
	align-items: center;
}

.line-head { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--red); }
.line-total { text-align: right; font-weight: 700; white-space: nowrap; }
.line-price, .line-quantity { text-align: right; }

.icon-button {
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: var(--red);
	cursor: pointer;
	border-radius: 50%;
}

.icon-button:hover { background: rgba(139, 30, 22, .12); }
.icon-button svg { width: 20px; height: 20px; }

.totals {
	margin: 18px 0 0 auto;
	max-width: 340px;
	border-top: 2px solid var(--red);
	padding-top: 8px;
}

.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals output { font-weight: 700; }
.total-gross { font-size: 19px; color: var(--red); border-top: 1px solid var(--gold-dark); margin-top: 4px; padding-top: 8px !important; }

/* ---------- Buttons ---------- */

.button-primary, .button-secondary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font: inherit;
	cursor: pointer;
	text-decoration: none;
}

.button-primary {
	width: 100%;
	justify-content: center;
	margin-top: 20px;
	padding: 16px 20px;
	border: 0;
	background: linear-gradient(180deg, var(--red-light), var(--red-dark));
	color: var(--gold);
	font-family: "Rye", Georgia, serif;
	font-size: 21px;
	letter-spacing: .5px;
	box-shadow: 0 4px 0 #4b0d08, 0 6px 14px rgba(0,0,0,.35);
	transition: transform .1s, box-shadow .1s;
}

.button-primary svg { width: 40px; height: 40px; }
.button-primary:hover { filter: brightness(1.1); }
.button-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #4b0d08, 0 2px 6px rgba(0,0,0,.35); }
.button-primary.is-loading { opacity: .7; cursor: wait; }

.button-secondary {
	padding: 8px 14px;
	border: 2px solid var(--red);
	background: transparent;
	color: var(--red);
	font-weight: 700;
	font-size: 14px;
}

.button-secondary:hover { background: var(--red); color: var(--gold); }

/* ---------- Messages ---------- */

.alert { padding: 12px 16px; margin-bottom: 16px; font-weight: 600; }
.alert-error { background: #fbe1dc; border-left: 5px solid var(--error); color: var(--error); }

.success {
	display: flex;
	gap: 18px;
	margin-top: 24px;
	padding: 18px 20px;
	background: #e7f0d8;
	border: 2px solid var(--green);
}

.success[hidden], .alert[hidden] { display: none; }
.success h3 { color: var(--green); margin-bottom: 8px; }
.success p { margin: 0 0 10px; }
.success-icon { width: 72px; height: 72px; flex: 0 0 auto; }

/* ---------- Sidebar ---------- */

.sidebar { display: flex; flex-direction: column; gap: 18px; }
.card { padding: 20px; }
.card address { font-style: normal; }
.card a { color: var(--red); }
.card ul { margin: 0; padding-left: 18px; font-size: 14px; }
.card li { margin-bottom: 8px; }

.footer {
	margin-top: 20px;
	text-align: center;
	color: var(--gold);
	font-size: 13px;
}

.footer svg { width: 34px; height: 22px; margin: 0 8px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
	.content { grid-template-columns: 1fr; }
	.hero { flex-direction: column; align-items: stretch; padding: 18px; }
	.logo-plate { width: auto; max-width: 340px; margin: 0 auto 10px; }
	.hero-caption { max-width: none; }
	.hero-money .bag, .hero-money .coins { display: none; }
}

@media (max-width: 680px) {
	.page { margin: 0; padding: 10px; }
	.parchment { padding: 20px 16px; }
	.tiles { grid-template-columns: repeat(2, 1fr); }
	.grid, .grid-4, .radio-row { grid-template-columns: 1fr; }
	.span-2 { grid-column: auto; }
	.line-head { display: none; }
	.line {
		grid-template-columns: 1fr 1fr 1fr 36px;
		padding: 10px 0;
		border-bottom: 1px dashed var(--gold-dark);
	}
	.line .line-description { grid-column: 1 / -1; }
	.line .line-total { grid-column: 1 / 4; }
	.hero-caption h1 { font-size: 26px; }
	.hero-money { display: none; }
}

/* ---------- Split submit buttons ---------- */

.submit-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-top: 20px;
}

.submit-row .button-primary {
	margin-top: 0;
	font-size: 18px;
	text-align: left;
	justify-content: flex-start;
	padding: 14px 18px;
}

.submit-row .button-primary span { display: flex; flex-direction: column; gap: 3px; }

.submit-row .button-primary small {
	font-family: "Open Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0;
	opacity: .85;
}

.button-pdf {
	background: linear-gradient(180deg, #5d4a33, #3b2a18);
	box-shadow: 0 4px 0 #22170b, 0 6px 14px rgba(0,0,0,.35);
}

.button-pdf:active { box-shadow: 0 1px 0 #22170b, 0 2px 6px rgba(0,0,0,.35); }
.success p[hidden] { display: none; }

@media (max-width: 680px) {
	.submit-row { grid-template-columns: 1fr; }
}
