/* Self-Guide – Frontend
   Tokens follow the HolzLand Auferoth brand, the accent colour is set per
   scenario via the inline custom property --sg-accent. */

.sg-app {
	--sg-accent: #E2001A;
	--sg-dark: #2B2D31;
	--sg-light: #F8F6F3;
	--sg-beige: #F5EFE6;
	--sg-border: #E3DDD5;
	--sg-radius: 4px;
    background: white;
    border-radius: 10px;
	color: var(--sg-dark);
	width: 100%;
	margin: 0 auto;
	line-height: 1.15;
    padding: 20px;
}

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

/* Progress -------------------------------------------------------- */

.sg-progress { margin-bottom: 1.5rem; }

.sg-progress-track {
	height: 6px;
	background: var(--sg-beige);
	border-radius: 999px;
	overflow: hidden;
}

.sg-progress-fill {
	height: 100%;
	background: var(--sg-accent);
	transition: width .3s ease;
}

.sg-progress-label {
	margin: .5rem 0 0;
	font-size: .82rem;
	color: var(--color-brown);
	letter-spacing: .02em;
}

/* Headings -------------------------------------------------------- */

.sg-step-head { margin-bottom: 1.25rem; }

.sg-step-head h3,
.sg-result-head h3 {
	margin: 0 0 .35rem;
	font-size: 1.55rem;
	line-height: 1.25;
}

.sg-step-sub,
.sg-intro {
	margin: 0 0 .75rem;
	color: var(--color-brown);
}

.sg-field { margin-bottom: 1.75rem; }

.sg-field-title {
	margin: 0 0 .25rem;
	font-size: 1.05rem;
	font-weight: 600;
}

.sg-field-sub {
	margin: 0 0 .75rem;
	font-size: .9rem;
	color: var(--sg-muted);
}

.sg-required { color: var(--sg-accent); }

.sg-note {
	background: var(--sg-beige);
	border-left: 3px solid var(--sg-accent);
	padding: .85rem 1rem;
}

/* Options --------------------------------------------------------- */

.sg-options { display: grid; gap: .65rem; }
.sg-layout-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.sg-layout-list { grid-template-columns: 1fr; }

.sg-option {
	display: flex;
	align-items: center;
	gap: .75rem;
	width: 100%;
	text-align: left;
	padding: .85rem 1rem;
	background: #fff;
	border: 1.5px solid var(--sg-border);
	border-radius: var(--sg-radius);
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.sg-layout-grid .sg-option {
	flex-direction: column;
	align-items: flex-start;
	min-height: 100%;
}

.sg-option:hover { border-color: var(--sg-accent); }

.sg-option:focus-visible {
	outline: 2px solid var(--sg-accent);
	outline-offset: 2px;
}

.sg-option.is-selected {
	border-color: var(--sg-accent);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--sg-accent);
}

.sg-option img {
	width: 100%;
	max-height: 110px;
	object-fit: contain;
	display: block;
}

.sg-layout-list .sg-option img {
	width: 100px;
	height: 100px;
	flex: 0 0 100px;
}

.sg-option-text { display: block; }
.sg-option-label { display: block; font-weight: 600; }

.sg-option-sub {
	display: block;
	color: var(--color-brown);
	font-size: .85rem;
	margin-top: .15rem;
    line-height: 1.2;
}

/* Checklist rows */

.sg-option-check .sg-box {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border: 1.5px solid var(--sg-border);
	border-radius: 4px;
	position: relative;
	background: #fff;
}

.sg-option-check.is-selected .sg-box {
	background: var(--sg-accent);
	border-color: var(--sg-accent);
}

.sg-option-check.is-selected .sg-box::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Sub-questions --------------------------------------------------- */

.sg-subfields {
	margin: .65rem 0 .25rem 1.1rem;
	padding: .85rem 0 .1rem 1rem;
	border-left: 2px solid var(--sg-border);
}

.sg-subfields[hidden] { display: none; }
.sg-subfields .sg-field:last-child { margin-bottom: .5rem; }
.sg-subfields .sg-field-title { font-size: .95rem; }

/* Inputs ---------------------------------------------------------- */

.sg-input {
	width: 100%;
	padding: .7rem .85rem;
	border: 1.5px solid var(--sg-border);
	border-radius: var(--sg-radius);
	font: inherit;
	background: #fff;
	color: inherit;
}

.sg-input:focus {
	border-color: var(--sg-accent);
	outline: none;
}

.sg-input-label,
.sg-consent {
	display: block;
	margin-bottom: .85rem;
	font-size: .92rem;
}

.sg-input-label > span { display: block; margin-bottom: .3rem; font-weight: 600; }

.sg-consent {
	display: flex;
	gap: .55rem;
	align-items: flex-start;
	color: var(--color-brown);
	font-size: .85rem;
}

.sg-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Navigation & buttons -------------------------------------------- */

.sg-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-top: 1.75rem;
	flex-wrap: wrap;
}

.sg-btn {
	display: inline-block;
	padding: .8rem 1.4rem;
	border-radius: var(--sg-radius);
	border: 1.5px solid transparent;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: opacity .15s ease;
}

.sg-btn:hover { opacity: .9; }
.sg-btn[disabled] { opacity: .5; cursor: default; }

.sg-btn-primary { background: var(--sg-accent); color: #fff; }
.sg-btn-dark { background: var(--sg-dark); color: #fff; }

.sg-btn-ghost {
	background: transparent;
	border-color: var(--sg-border);
	color: var(--sg-dark);
}

/* Result ---------------------------------------------------------- */

.sg-result-head { margin-bottom: 1.5rem; }

.sg-result-block,
.sg-summary,
.sg-export {
	margin-bottom: 2rem;
	padding-top: 1.25rem;
}

.sg-result-block h4,
.sg-summary h4 {
	margin: 0 0 1rem;
}

.sg-result-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.sg-result-card {
	border: 1px solid var(--sg-border);
	border-radius: var(--sg-radius);
	padding: 1rem;
	background: #fff;
}

.sg-result-card img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: .65rem;
}

.sg-result-card h4 { margin: 0 0 .35rem;}
.sg-result-card p { margin: 0 0 .6rem; color: var(--color-brown); }

.sg-result-link {
	font-weight: 600;
	color: var(--sg-accent);
	text-decoration: none;
}

.sg-summary-section {padding: 1.25rem 0; 
	border-bottom: 1px dotted var(--color-beige-deep);}
.sg-summary-section h4 { margin: 0 0 .5rem; }

.sg-summary-section ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sg-summary-section li {
	padding: .4rem 0;
	font-size: .93rem;
}

.sg-summary-section li.sg-depth-1 { padding-left: 1.2rem; }
.sg-summary-section li.sg-depth-2 { padding-left: 2.4rem; }

.sg-summary-label {
	display: block;
	font-weight: 600;
	color: var(--color-brown);
	font-size: .82rem;
}

.sg-summary-note { display: block; font-style: italic; }

.sg-export-fields {
	display: grid;
	gap: 0 1rem;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.sg-export-actions {
	display: flex;
	gap: .75rem;
	flex-wrap: wrap;
	margin-top: .5rem;
}

.sg-status { margin-top: 1rem; font-size: .92rem; }
.sg-status.is-success { color: #1F7A3D; }
.sg-status.is-error,
.sg-error-msg { color: var(--sg-accent); font-weight: 600; }

.sg-download { margin-top: .65rem; }

.sg-loading,
.sg-empty {
	color: var(--color-brown);
	padding: 1rem 0;
}

@media (max-width: 600px) {
	.sg-layout-grid { grid-template-columns: 1fr 1fr; }
	.sg-nav { flex-direction: column-reverse; align-items: stretch; }
	.sg-nav .sg-btn { width: auto; text-align: center; }
}

/* Multi-line option subtitles */

.sg-option-sub,
.sg-summary-value,
.sg-summary-note { white-space: pre-line; }

.sg-summary-value-label {
	display: block;
	font-weight: 600;
}

.sg-summary-value-sub {
	display: block;
	font-weight: 400;
	font-size: .9em;
	color: var(--sg-muted);
	white-space: pre-line;
}

.sg-summary-value {
	position: relative;
	display: block;
	margin-top: .25rem;
	padding-left: 1.65em;
	white-space: pre-line;
	font-weight: 500;
}

.sg-summary-value::before {
	content: "\e186";
	font-family: "Phosphor";
	font-weight: 400;
	font-style: normal;
	font-size: 1.15em;
	line-height: 1;
	color: var(--sg-accent);
	position: absolute;
	left: 0;
	top: .1em;
	-webkit-font-smoothing: antialiased;
}

.sg-summary-value + .sg-summary-value { margin-top: .25rem; }

.sg-note { white-space: pre-line; }
.sg-type-note { margin-bottom: 1.25rem; }

/* Rich text blocks (Einleitung / Ergebnistext) */

.sg-rich { color: var(--sg-muted); }
.sg-rich > *:first-child { margin-top: 0; }
.sg-rich > *:last-child { margin-bottom: 0; }
.sg-rich p { margin: 0 0 .65rem; }
.sg-rich ul,
.sg-rich ol { margin: 0 0 .65rem 1.15rem; padding: 0; }
.sg-rich li { margin-bottom: .25rem; }
.sg-rich a { color: var(--sg-accent); }
.sg-rich img { max-width: 100%; height: auto; border-radius: 6px; }
.sg-rich strong { color: var(--sg-dark); }
