/**
 * YK Lead Quiz Frontend Styles
 *
 * NOTE: This file is in plain CSS for easy editing by non-technical staff.
 * No compilation required - changes take effect after clearing cache.
 *
 * Colours, radii and shadows are variables at the top: change them there.
 * They follow clevair.ch (theme «clevair»): Inter is inherited from the page,
 * buttons use the site's gradient and shadow, fields the site's border.
 *
 * Layout adapts to the width of the quiz itself (container queries), so it
 * works in the half-width header column on desktop and full width on tablet
 * and mobile. Breakpoints otherwise follow Bootstrap (575 / 991px).
 */

.yk-lead-quiz-block {
	--yklq-heading: #344767;
	--yklq-text: #67748e;
	--yklq-accent: #16619a;
	--yklq-accent-light: #21a2fd;
	--yklq-error: #b42318;
	--yklq-field-border: #d2d6da;
	--yklq-option-border: rgba(52, 71, 103, 0.16);
	--yklq-card-border: rgba(52, 71, 103, 0.14);
	--yklq-tint: rgba(22, 97, 154, 0.07);
	--yklq-focus: 0 0 0 3px rgba(33, 162, 253, 0.35);
	--yklq-gradient: linear-gradient(310deg, var(--yklq-accent-light), var(--yklq-accent));
	--yklq-bar: linear-gradient(90deg, var(--yklq-accent), var(--yklq-accent-light));
	--yklq-radius-card: 18px;
	--yklq-radius-option: 12px;
	--yklq-radius-input: 1rem;
	--yklq-shadow-card: 0 18px 44px rgba(52, 71, 103, 0.14);
	--yklq-shadow-btn: 0 4px 7px -1px rgba(0, 0, 0, 0.11), 0 2px 4px -1px rgba(0, 0, 0, 0.07);
	/* Space kept above the quiz when it scrolls into view (e.g. under a sticky header). */
	--yklq-scroll-offset: 100px;

	/* The quiz measures its own width for the layout below; width: 100% keeps
	   it from collapsing inside flex layouts. */
	container-type: inline-size;
	width: 100%;
	scroll-margin-top: var(--yklq-scroll-offset);
	color: var(--yklq-text);
	font-size: 16px;
	line-height: 1.5;
}

.yk-lead-quiz-block *,
.yk-lead-quiz-block *::before,
.yk-lead-quiz-block *::after {
	box-sizing: border-box;
}

/* Shared reset for the quiz's buttons, against the theme's button styles.
   Each component below only sets what differs. */
.yk-lead-quiz-block :is(.yklq-option, .yklq-btn, .yklq-ghost) {
	margin: 0;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.yklq-card {
	background: #ffffff;
	border: 1px solid var(--yklq-card-border);
	border-radius: var(--yklq-radius-card);
	padding: 32px 30px;
	box-shadow: var(--yklq-shadow-card);
}

/* Headings and text
   ========================================================================== */

/* Overrides the theme's h2 (2rem / 1.35rem, margin 1.5rem). */
.yk-lead-quiz-block .yklq-title {
	margin: 0 0 6px;
	color: var(--yklq-heading);
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	overflow-wrap: break-word;
	outline: none;
}

.yk-lead-quiz-block .yklq-title--large {
	margin-bottom: 20px;
	font-size: 26px;
	line-height: 1.25;
}

.yk-lead-quiz-block .yklq-text {
	margin: 0 0 24px;
}

.yk-lead-quiz-block .yklq-hint {
	margin: 0 0 18px;
	font-size: 15px;
}

/* Intro
   ========================================================================== */

.yk-lead-quiz-block .yklq-steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
	font-size: 15px;
}

.yk-lead-quiz-block .yklq-steps li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.yk-lead-quiz-block .yklq-steps li::before {
	content: none;
}

.yklq-step-number {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(22, 97, 154, 0.1);
	color: var(--yklq-accent);
	font-size: 13px;
	font-weight: 700;
}

/* Progress
   ========================================================================== */

.yklq-step-label {
	font-size: 13px;
}

.yklq-progress {
	height: 6px;
	margin: 6px 0 22px;
	overflow: hidden;
	border-radius: 99px;
	background: rgba(52, 71, 103, 0.12);
}

.yklq-progress-bar {
	height: 100%;
	border-radius: 99px;
	background: var(--yklq-bar);
	transition: width 0.25s ease;
}

/* Answer options
   ========================================================================== */

.yklq-options {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin-bottom: 20px;
}

.yk-lead-quiz-block .yklq-option {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: 0;
	min-height: 48px;
	padding: 12px 16px;
	border: 1.5px solid var(--yklq-option-border);
	border-radius: var(--yklq-radius-option);
	background: #ffffff;
	color: var(--yklq-text);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
	text-align: left;
	white-space: normal;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.yk-lead-quiz-block .yklq-option > span:last-child {
	min-width: 0;
	overflow-wrap: break-word;
	hyphens: auto;
}

/* Hover only on devices with a mouse: on touch screens the hover state would
   stick to the option under the finger on the next question. */
@media (hover: hover) {
	.yk-lead-quiz-block .yklq-option:hover {
		border-color: var(--yklq-accent);
	}
}

.yk-lead-quiz-block .yklq-option[aria-pressed="true"] {
	border-color: var(--yklq-accent);
	background: var(--yklq-tint);
	color: var(--yklq-heading);
}

.yklq-option-box {
	flex: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(52, 71, 103, 0.25);
	border-radius: 50%;
}

.yklq-option.is-multi .yklq-option-box {
	border-radius: 5px;
}

.yklq-option[aria-pressed="true"] .yklq-option-box {
	border-color: var(--yklq-accent);
	background: var(--yklq-accent);
	box-shadow: inset 0 0 0 3px #ffffff;
}

/* Free text («Sonstiges …») and contact fields
   ========================================================================== */

.yklq-free {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: -4px 0 22px;
	font-size: 14px;
}

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

.yklq-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-size: 14px;
}

.yk-lead-quiz-block .yklq-free label,
.yk-lead-quiz-block .yklq-field label {
	display: block;
	margin: 0;
	color: var(--yklq-text);
}

/* Matches the theme's fields (border, radius, colour) in a more compact size.
   16px font size: smaller sizes make iOS Safari zoom in when the field gets focus.
   [type] lifts the specificity above the theme's input[type=text]:not(.quicksearch)
   (padding 20px 24px), which loads after this file and would otherwise win. */
.yk-lead-quiz-block .yklq-free input[type],
.yk-lead-quiz-block .yklq-field input[type] {
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--yklq-field-border);
	border-radius: var(--yklq-radius-input);
	background: #ffffff;
	color: var(--yklq-heading);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.yk-lead-quiz-block .yklq-free input::placeholder,
.yk-lead-quiz-block .yklq-field input::placeholder {
	color: #9aa3b5;
	font-weight: 400;
}

.yk-lead-quiz-block .yklq-free input:focus,
.yk-lead-quiz-block .yklq-field input:focus {
	border-color: var(--yklq-accent);
	outline: none;
	box-shadow: var(--yklq-focus);
}

.yklq-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 16px 0 10px;
	font-size: 14px;
}

.yk-lead-quiz-block .yklq-consent input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--yklq-accent);
	cursor: pointer;
}

.yk-lead-quiz-block .yklq-consent label {
	margin: 0;
	cursor: pointer;
}

.yk-lead-quiz-block .yklq-privacy {
	margin: 0 0 8px;
	font-size: 13px;
}

.yk-lead-quiz-block .yklq-privacy a {
	color: var(--yklq-accent);
	font-weight: 600;
}

.yklq-error {
	min-height: 22px;
	color: var(--yklq-error);
	font-size: 14px;
}

.yklq-error:empty {
	min-height: 8px;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.yklq-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Buttons
   ========================================================================== */

.yklq-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.yk-lead-quiz-block .yklq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 12px 28px;
	border: 0;
	border-radius: 50px;
	background: var(--yklq-gradient);
	color: #ffffff;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	box-shadow: var(--yklq-shadow-btn);
	transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

/* Same hover as the theme's .btn-primary. */
@media (hover: hover) {
	.yk-lead-quiz-block .yklq-btn:hover {
		color: #ffffff;
		transform: scale(1.03);
	}
}

.yk-lead-quiz-block .yklq-btn:focus {
	color: #ffffff;
}

.yk-lead-quiz-block .yklq-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

.yk-lead-quiz-block .yklq-ghost {
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--yklq-text);
	font-size: 15px;
	font-weight: 500;
	box-shadow: none;
}

.yk-lead-quiz-block .yklq-ghost:hover {
	background: transparent;
	color: var(--yklq-heading);
}

/* Keyboard focus. The theme removes button outlines with !important, so the
   focus ring is a box-shadow instead. */
.yk-lead-quiz-block .yklq-option:focus-visible,
.yk-lead-quiz-block .yklq-btn:focus-visible,
.yk-lead-quiz-block .yklq-ghost:focus-visible,
.yk-lead-quiz-block .yklq-consent input:focus-visible {
	outline: none;
	box-shadow: var(--yklq-focus);
}

.yk-lead-quiz-block .yklq-btn:focus-visible {
	box-shadow: var(--yklq-focus), var(--yklq-shadow-btn);
}

/* Thanks
   ========================================================================== */

.yklq-done-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 18px;
	border-radius: 50%;
	background: rgba(22, 97, 154, 0.1);
	color: var(--yklq-accent);
}

.yklq-done-icon + .yklq-title--large {
	margin-bottom: 14px;
}

.yk-lead-quiz-block .yklq-thanks-text {
	margin-bottom: 28px;
	overflow-wrap: anywhere;
}

.yklq-urgent {
	padding-top: 22px;
	border-top: 1px solid var(--yklq-card-border);
}

.yklq-urgent-title {
	margin-bottom: 6px;
	color: var(--yklq-heading);
	font-size: 17px;
	font-weight: 600;
}

.yk-lead-quiz-block .yklq-urgent .yklq-hint {
	margin-bottom: 16px;
}

.yk-lead-quiz-block .yklq-restart {
	display: block;
	margin-top: 16px;
}

/* Wider quiz (tablet, or full-width column): two-column layout
   ========================================================================== */

@container (min-width: 620px) {
	.yklq-card {
		padding: 36px 40px;
	}

	/* Answers side by side: shorter screens, less scrolling. */
	.yklq-options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.yklq-option {
		height: 100%;
	}
}

/* Name fields side by side as soon as there is room for them. */
@container (min-width: 440px) {
	.yklq-form-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.yklq-field.is-full {
		grid-column: 1 / -1;
	}
}

/* Tablet: the header columns stack, the quiz becomes the focus of the
   screen. Keep it readable instead of stretching over the whole width. */
@media (max-width: 991px) {
	.yklq-card {
		max-width: 720px;
		margin-left: auto;
		margin-right: auto;
	}
}

/* Narrow quiz (mobile)
   ========================================================================== */

@container (max-width: 439px) {
	.yklq-card {
		padding: 24px 18px;
		border-radius: 14px;
	}

	/* Long German words only need hyphenating on narrow screens. */
	.yk-lead-quiz-block .yklq-title {
		font-size: 20px;
		hyphens: auto;
	}

	.yk-lead-quiz-block .yklq-title--large {
		font-size: 22px;
		margin-bottom: 14px;
	}

	.yk-lead-quiz-block .yklq-text {
		margin-bottom: 20px;
		font-size: 15px;
	}

	.yk-lead-quiz-block .yklq-hint {
		margin-bottom: 14px;
	}

	.yklq-progress {
		margin-bottom: 18px;
	}

	.yklq-options {
		gap: 8px;
	}

	.yk-lead-quiz-block .yklq-option {
		padding: 11px 14px;
	}

	/* Start, call and the main step button span the full width: easy to hit. */
	.yk-lead-quiz-block .yklq-btn {
		padding-left: 20px;
		padding-right: 20px;
	}

	.yk-lead-quiz-block .yklq-card > .yklq-btn,
	.yk-lead-quiz-block .yklq-urgent .yklq-btn {
		width: 100%;
	}

	.yklq-nav .yklq-btn {
		flex: 1 1 auto;
		max-width: 70%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yklq-progress-bar,
	.yk-lead-quiz-block .yklq-btn,
	.yk-lead-quiz-block .yklq-option {
		transition: none;
	}

	.yk-lead-quiz-block .yklq-btn:hover {
		transform: none;
	}
}
