/**
 * Slow Work — front-end survey styles.
 *
 * The survey widget renders inside a Shadow DOM (see survey.js), so theme styles
 * cannot leak in and ours cannot leak out. This same file is loaded twice: once
 * inside the shadow root (for the widget) and once in the page (for the shell —
 * .sw-main / custom header & footer). Tokens are therefore defined for every
 * context: :host (shadow), .sw-survey (light-DOM fallback), and the body class.
 * Mobile-first; palette sampled from the slow-work.pl blog.
 */

:host,
.sw-survey,
.slow-work-survey-page {
	--sw-taupe: #8a7c6d;
	--sw-taupe-dark: #6f6255;
	--sw-gold: #c2a556;
	--sw-gold-dark: #a98a3c;
	--sw-cream: #f6f2ea;
	--sw-ink: #443c34;
	--sw-muted: #857c70;
	--sw-line: #e2dccf;
	--sw-white: #fff;
	--sw-healthy: #7f9b6b;
	--sw-attention: #d5ab4e;
	--sw-critical: #c2705a;
	--sw-radius: 12px;
	--sw-shadow: 0 1px 2px rgba(68, 60, 52, .05), 0 8px 24px rgba(68, 60, 52, .06);
	--sw-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--sw-serif: Georgia, "Times New Roman", serif;
}

:host { display: block; }
.slow-work-survey-page { background: var(--sw-white); }

/* ---------- shell (rendered in the page, outside the shadow) ---------- */

.sw-main {
	max-width: 720px;
	margin-inline: auto;
	padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 1.5rem) 4rem;
}

.sw-custom-header,
.sw-custom-footer {
	background: var(--sw-taupe);
	color: var(--sw-white);
	padding: 1.25rem;
	text-align: center;
}
.sw-custom-header :where(h1, h2, h3, p) { margin: 0; }
.sw-custom-header a,
.sw-custom-footer a { color: var(--sw-white); }

/* ---------- scoped reset ---------- */

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

/* Neutralise any inheritable properties that cross the shadow boundary from the
   host page (font, colour, spacing, transforms of text, etc.). */
.sw-survey {
	font-family: var(--sw-sans);
	color: var(--sw-ink);
	line-height: 1.55;
	font-size: 16px;
	font-weight: 400;
	font-style: normal;
	letter-spacing: normal;
	word-spacing: normal;
	text-align: left;
	text-transform: none;
	text-indent: 0;
	-webkit-text-size-adjust: 100%;
}

.sw-survey h1,
.sw-survey h2,
.sw-survey h3 {
	font-family: var(--sw-serif);
	font-weight: 400;
	color: var(--sw-taupe-dark);
	line-height: 1.2;
	margin: 0 0 .5rem;
}

.sw-survey p { margin: 0 0 1rem; }
.sw-survey button { font-family: inherit; }

/* ---------- progress axis ---------- */

.sw-axis {
	margin-bottom: clamp(1.5rem, 5vw, 2.5rem);
	/* Inner padding so the active dot's scaled ring/glow isn't clipped by the
	   horizontal scroll box (overflow-x forces vertical clipping too). */
	padding: 9px 8px 2px;
	overflow-x: auto;
	scrollbar-width: none;
}
.sw-axis::-webkit-scrollbar { display: none; }
.sw-axis ol {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	min-width: min-content;
	list-style: none;
	margin: 0;
	padding: 0;
}
.sw-dot {
	position: relative;
	flex: 1 1 0;
	min-width: 44px;
	max-width: 96px;
	display: flex;
	justify-content: center;
}
/* Connecting line between dots. */
.sw-dot::before {
	content: "";
	position: absolute;
	top: 10px;
	right: 50%;
	width: 100%;
	height: 2px;
	background: var(--sw-line);
	z-index: 0;
}
.sw-dot:first-child::before { display: none; }
.sw-dot.is-visited::before { background: var(--sw-gold); }

.sw-dot-btn {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .4rem;
	background: none;
	border: 0;
	padding: 0 2px;
	margin: 0;
	cursor: pointer;
	color: var(--sw-muted);
	font-size: clamp(.62rem, 2.4vw, .78rem);
	width: 100%;
}
.sw-dot-btn:disabled { cursor: default; }

.sw-dot-mark {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--sw-white);
	border: 2px solid var(--sw-line);
	transition: transform .2s ease, background .2s ease, border-color .2s ease;
	flex-shrink: 0;
}
.sw-dot.is-visited .sw-dot-mark { border-color: var(--sw-gold); background: var(--sw-gold); }
.sw-dot.is-active .sw-dot-mark {
	border-color: var(--sw-gold-dark);
	background: var(--sw-gold-dark);
	box-shadow: 0 0 0 4px rgba(194, 165, 86, .25);
	transform: scale(1.15);
}
.sw-dot-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}
.sw-dot.is-active .sw-dot-label { color: var(--sw-taupe-dark); font-weight: 600; }

/* ---------- screens ---------- */

.sw-survey .sw-screen { display: block; animation: sw-fade .3s ease; }
/* Hard-hide inactive screens: the `hidden` attribute alone is overridden by
   themes that set `display` on `section`/generic elements (author rule beats the
   UA `[hidden]` rule), which would show every screen at once. */
.sw-survey .sw-screen[hidden] { display: none !important; }
@keyframes sw-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sw-wysiwyg :where(h1, h2, h3):first-child { margin-top: 0; }
.sw-wysiwyg img { max-width: 100%; height: auto; border-radius: var(--sw-radius); display: block; }
.sw-wysiwyg :where(iframe, video) { max-width: 100%; border-radius: var(--sw-radius); }
.sw-top-media { margin-bottom: clamp(1.25rem, 4vw, 1.75rem); }

.sw-screen-head {
	margin-bottom: clamp(1.25rem, 4vw, 1.75rem);
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--sw-line);
}
.sw-section-letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: var(--sw-gold);
	color: var(--sw-white);
	font-family: var(--sw-serif);
	font-size: 1.2rem;
	margin-bottom: .6rem;
}
.sw-section-title { font-size: clamp(1.35rem, 5vw, 1.7rem); margin: 0 0 .25rem; }
.sw-section-subtitle { margin: 0; color: var(--sw-muted); font-style: italic; }

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

/* The statement sits ABOVE its answer box, not inside it. */
.sw-question {
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0 0 clamp(1.4rem, 4vw, 1.85rem);
}
.sw-question legend {
	display: block;
	float: none;
	width: 100%;
	padding: 0;
	margin: 0 0 .75rem;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--sw-ink);
}
.sw-question.is-invalid legend { color: var(--sw-critical); }

/* The answer box: 5 even columns that shrink gracefully. */
.sw-options {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: .5rem;
	padding: clamp(.7rem, 2.5vw, 1rem);
	background: var(--sw-cream);
	border: 1px solid var(--sw-line);
	border-radius: var(--sw-radius);
	transition: border-color .2s ease;
}
.sw-question.is-invalid .sw-options { border-color: var(--sw-critical); }

/* Endpoint anchor labels — shown on mobile only, where per-card labels are hidden. */
.sw-scale-anchors { display: none; }

.sw-option {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: .3rem;
	text-align: center;
	padding: .7rem .35rem;
	background: var(--sw-white);
	border: 1px solid var(--sw-line);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
	margin: 0;
	min-width: 0;
}
.sw-option:hover { border-color: var(--sw-gold); }
/* Hide the native radio; the card is the visual control. */
.sw-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}
.sw-option:has(input:checked) {
	border-color: var(--sw-gold-dark);
	background: rgba(194, 165, 86, .14);
	box-shadow: inset 0 0 0 1px var(--sw-gold-dark);
}
.sw-option:has(input:checked) .sw-option-value { color: var(--sw-gold-dark); }
.sw-option:has(input:focus-visible) { outline: 2px solid var(--sw-gold-dark); outline-offset: 2px; }
.sw-option-value { font-size: 1.1rem; font-weight: 700; color: var(--sw-taupe-dark); line-height: 1; }
.sw-option-label { font-size: .68rem; color: var(--sw-muted); line-height: 1.25; }

/* ---------- navigation buttons ---------- */

.sw-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .75rem;
	margin-top: clamp(1.25rem, 4vw, 1.75rem);
	flex-wrap: wrap;
}
.sw-nav .sw-next,
.sw-nav .sw-submit { margin-left: auto; }

.sw-survey .sw-next,
.sw-survey .sw-submit,
.sw-survey .sw-prev {
	-webkit-appearance: none;
	appearance: none;
	font-weight: 600;
	font-size: 1rem;
	padding: .7rem 1.9rem;
	border-radius: 10px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
	min-height: 44px;
}
.sw-survey .sw-next,
.sw-survey .sw-submit {
	background: var(--sw-gold);
	border-color: var(--sw-gold);
	color: var(--sw-white);
}
.sw-survey .sw-next:hover,
.sw-survey .sw-submit:hover { background: var(--sw-gold-dark); border-color: var(--sw-gold-dark); }
.sw-survey .sw-submit:disabled { opacity: .6; cursor: default; }
.sw-survey .sw-prev {
	background: transparent;
	color: var(--sw-muted);
	border-color: var(--sw-line);
}
.sw-survey .sw-prev:hover { background: var(--sw-cream); color: var(--sw-ink); }

.sw-error { color: var(--sw-critical); font-size: .9rem; margin: .75rem 0 0; }

/* ---------- meta / result ---------- */

.sw-meta { text-align: center; }
.sw-result { margin-bottom: 2rem; }
.sw-overall { margin-bottom: 1.25rem; }
.sw-overall-label { display: block; color: var(--sw-muted); font-size: .95rem; }
.sw-overall-score {
	display: block;
	font-family: var(--sw-serif);
	font-size: clamp(2.2rem, 9vw, 2.8rem);
	color: var(--sw-taupe-dark);
	line-height: 1.1;
	margin: .1rem 0 .5rem;
}
.sw-overall-zone {
	display: inline-block;
	padding: .35rem 1.1rem;
	border-radius: 999px;
	font-weight: 600;
	color: var(--sw-white);
	background: var(--sw-taupe);
}
.sw-zone-slow { background: var(--sw-healthy); }
.sw-zone-warning { background: var(--sw-attention); }
.sw-zone-burnout { background: var(--sw-critical); }

.sw-chart {
	display: flex;
	justify-content: center;
	margin: 1rem auto 1.5rem;
	width: 100%;
	max-width: 340px;
}
.sw-radar, .sw-bars { width: 100%; height: auto; overflow: visible; }
.sw-ring { fill: none; stroke-width: 1; }
.sw-ring-healthy { stroke: var(--sw-healthy); opacity: .35; }
.sw-ring-attention { stroke: var(--sw-attention); opacity: .35; }
.sw-ring-critical { stroke: var(--sw-critical); opacity: .35; }
.sw-axis-line { stroke: var(--sw-line); stroke-width: 1; }
.sw-axis-label { fill: var(--sw-taupe-dark); font-size: 13px; font-weight: 600; font-family: var(--sw-serif); }
.sw-radar-area { fill: rgba(194, 165, 86, .35); stroke: var(--sw-gold-dark); stroke-width: 2; stroke-linejoin: round; }
.sw-radar-dot { fill: var(--sw-gold-dark); }
.sw-bar-healthy { fill: var(--sw-healthy); }
.sw-bar-attention { fill: var(--sw-attention); }
.sw-bar-critical { fill: var(--sw-critical); }
.sw-bar-label { fill: var(--sw-taupe-dark); font-size: 13px; font-family: var(--sw-serif); }

/* section score list */
.sw-section-scores { list-style: none; padding: 0; margin: 0 auto; max-width: 460px; }
.sw-section-scores li {
	display: grid;
	grid-template-columns: 1.9rem 1fr auto;
	align-items: center;
	gap: .85rem;
	padding: .65rem .5rem;
	border-bottom: 1px solid var(--sw-line);
	text-align: left;
}
.sw-sc-letter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	color: var(--sw-white);
	font-family: var(--sw-serif);
	font-size: .95rem;
	flex-shrink: 0;
}
.sw-level-healthy .sw-sc-letter { background: var(--sw-healthy); }
.sw-level-attention .sw-sc-letter { background: var(--sw-attention); }
.sw-level-critical .sw-sc-letter { background: var(--sw-critical); }
.sw-sc-header { color: var(--sw-ink); line-height: 1.3; }
.sw-sc-score { font-weight: 700; color: var(--sw-taupe-dark); font-size: 1.1rem; }

/* ---------- capture form ---------- */

.sw-cta { margin: 2rem 0 1.25rem; }
.sw-form { max-width: 520px; margin: 0 auto; text-align: left; }
.sw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sw-form label { display: block; color: var(--sw-ink); font-weight: 600; margin-bottom: 1rem; }
.sw-form input[type=text],
.sw-form input[type=email] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	margin-top: .4rem;
	padding: .7rem .85rem;
	font-size: 1rem;
	font-family: inherit;
	color: var(--sw-ink);
	background: var(--sw-white);
	border: 1px solid var(--sw-line);
	border-radius: 10px;
	line-height: 1.4;
}
.sw-form input:focus {
	outline: none;
	border-color: var(--sw-gold-dark);
	box-shadow: 0 0 0 3px rgba(194, 165, 86, .2);
}

.sw-consent {
	display: flex;
	gap: .65rem;
	align-items: flex-start;
	font-weight: 400 !important;
	font-size: .88rem;
	color: var(--sw-muted);
	margin: .5rem 0 0 !important;
	cursor: pointer;
}
.sw-consent input[type=checkbox] {
	-webkit-appearance: none;
	appearance: none;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	border: 1px solid var(--sw-line);
	border-radius: 5px;
	background: var(--sw-white);
	cursor: pointer;
	position: relative;
	transition: background .15s ease, border-color .15s ease;
}
.sw-consent input[type=checkbox]:checked {
	background: var(--sw-gold);
	border-color: var(--sw-gold-dark);
}
.sw-consent input[type=checkbox]:checked::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid var(--sw-white);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.sw-consent input[type=checkbox]:focus-visible { outline: 2px solid var(--sw-gold-dark); outline-offset: 2px; }
.sw-consent > span { flex: 1 1 auto; }

.sw-meta .sw-form .sw-nav { margin-top: 1.5rem; }
.sw-thankyou { padding: 2rem 0; }

/* ---------- demographics ---------- */

.sw-demo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
	text-align: left;
	margin: 1.25rem 0 0;
}
.sw-form .sw-demo-grid { margin: 1.25rem 0; }
.sw-demo-field {
	display: block;
	color: var(--sw-ink);
	font-weight: 600;
	font-size: .95rem;
}
.sw-demo-field select {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	margin-top: .4rem;
	padding: .65rem 2rem .65rem .85rem;
	font-size: 1rem;
	font-family: inherit;
	font-weight: 400;
	color: var(--sw-ink);
	background-color: var(--sw-white);
	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="none" stroke="%238a7c6d" stroke-width="1.6" d="M1 1l5 5 5-5"/></svg>');
	background-repeat: no-repeat;
	background-position: right .8rem center;
	border: 1px solid var(--sw-line);
	border-radius: 10px;
	line-height: 1.4;
	cursor: pointer;
}
.sw-demo-field select:focus {
	outline: none;
	border-color: var(--sw-gold-dark);
	box-shadow: 0 0 0 3px rgba(194, 165, 86, .2);
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
	.sw-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
	.sw-option { padding: .6rem .2rem; }
	.sw-option-label { display: none; }
	.sw-option-value { font-size: 1.05rem; }
	.sw-options { gap: .35rem; }

	/* Show the endpoint anchors under the number row (replaces per-card labels). */
	.sw-scale-anchors {
		display: flex;
		justify-content: space-between;
		gap: .75rem;
		margin-top: .45rem;
		padding: 0 .15rem;
		font-size: .72rem;
		line-height: 1.25;
		color: var(--sw-muted);
	}
	.sw-scale-anchors .sw-anchor-min { text-align: left; }
	.sw-scale-anchors .sw-anchor-max { text-align: right; }
	.sw-scale-anchors span { max-width: 46%; }
}

@media (max-width: 420px) {
	.sw-survey .sw-next,
	.sw-survey .sw-submit,
	.sw-survey .sw-prev { padding: .7rem 1.25rem; }
	.sw-nav { gap: .5rem; }
}
