/* Matchtest – full-screen, one question at a time (Typeform style). */

.doodler-matchtest-page {
	margin: 0;
	overflow: hidden;
	background: #ffffff;
}

.mt {
	--mt-text: #2a333d;
	--mt-muted: #5f6b74;
	--mt-accent: #d3d84b;
	--mt-accent-hover: #c4c93a;
	--mt-accent-text: #2a333d;
	--mt-choice-bg: #f2f3f4;
	--mt-choice-border: #e3e5e7;
	--mt-ease: cubic-bezier(0.22, 1, 0.36, 1);

	position: fixed;
	inset: 0;
	color: var(--mt-text);
	font-family: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.admin-bar .mt {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .mt {
		top: 46px;
	}
}

/* ------------------------------------------------------------ chrome */

.mt-progress {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 5;
	height: 4px;
	background: rgba(42, 51, 61, 0.1);
}

.mt-progress-bar {
	width: 0;
	height: 100%;
	background: var(--mt-text);
	transition: width 0.5s var(--mt-ease);
}

.mt-close {
	position: absolute;
	top: 18px;
	right: 22px;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--mt-muted);
	font-size: 28px;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s, color 0.2s;
}

.mt-close:hover,
.mt-close:focus-visible {
	background: var(--mt-choice-bg);
	color: var(--mt-text);
}

.mt-nav {
	position: absolute;
	right: 32px;
	bottom: 28px;
	z-index: 5;
	display: flex;
	gap: 2px;
	overflow: hidden;
	border-radius: 6px;
}

.mt-nav[hidden] {
	display: none;
}

.mt-nav-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 40px;
	border: 0;
	background: var(--mt-accent);
	color: var(--mt-accent-text);
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
}

.mt-nav-button:hover:not(:disabled) {
	background: var(--mt-accent-hover);
}

.mt-nav-button:disabled {
	opacity: 0.45;
	cursor: default;
}

/* ------------------------------------------------------------ steps + animation */

.mt-stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.mt-step {
	position: absolute;
	inset: 0;
	display: none;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.mt-step.is-active {
	display: flex;
}

.mt-question,
.mt-result {
	align-items: center;
	justify-content: center;
	padding: 72px 24px 96px;
	box-sizing: border-box;
}

@keyframes mt-enter-up {
	from { opacity: 0; transform: translateY(60px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mt-enter-down {
	from { opacity: 0; transform: translateY(-60px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mt-leave-up {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(-60px); }
}

@keyframes mt-leave-down {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(60px); }
}

.mt-step.is-entering-up { animation: mt-enter-up 0.42s var(--mt-ease) both; }
.mt-step.is-entering-down { animation: mt-enter-down 0.42s var(--mt-ease) both; }
.mt-step.is-leaving-up { animation: mt-leave-up 0.36s var(--mt-ease) both; }
.mt-step.is-leaving-down { animation: mt-leave-down 0.36s var(--mt-ease) both; }

/* Content of a question appears slightly after the step */
.mt-step.is-entering-up .mt-q > * {
	animation: mt-enter-up 0.5s var(--mt-ease) both;
}

.mt-step.is-entering-up .mt-q > *:nth-child(2) { animation-delay: 0.04s; }
.mt-step.is-entering-up .mt-q > *:nth-child(3) { animation-delay: 0.08s; }
.mt-step.is-entering-up .mt-q > *:nth-child(4) { animation-delay: 0.12s; }
.mt-step.is-entering-up .mt-q > *:nth-child(5) { animation-delay: 0.16s; }

/* ------------------------------------------------------------ welcome */

.mt-welcome {
	align-items: stretch;
}

.mt-welcome-media {
	flex: 0 0 50%;
	background-position: center;
	background-size: cover;
}

.mt-welcome-body {
	display: flex;
	flex: 1 1 50%;
	align-items: center;
	padding: 48px 6vw;
	box-sizing: border-box;
}

.mt-welcome-inner {
	max-width: 620px;
}

.mt-welcome-title {
	margin: 0 0 16px;
	color: var(--mt-text);
	font-family: inherit;
	font-size: clamp(32px, 4vw, 56px);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -0.5px;
}

.mt-welcome-text p {
	margin: 0 0 18px;
	color: var(--mt-muted);
	font-size: 20px;
	line-height: 1.5;
}

.mt-duration {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	color: var(--mt-muted);
	font-size: 15px;
}

/* ------------------------------------------------------------ question */

.mt-q {
	width: 100%;
	max-width: 720px;
}

.mt-q.is-shaking {
	animation: mt-shake 0.4s;
}

@keyframes mt-shake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-8px); }
	40% { transform: translateX(7px); }
	60% { transform: translateX(-5px); }
	80% { transform: translateX(3px); }
}

.mt-q-title {
	display: flex;
	gap: 14px;
	margin: 0;
	color: var(--mt-text);
	font-family: inherit;
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 400;
	line-height: 1.35;
	outline: none;
}

.mt-q-number {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	margin-top: 0.3em;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 3px;
	background: var(--mt-text);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
}

.mt-required {
	margin-left: 2px;
}

.mt-q-description {
	margin: 10px 0 0 34px;
	color: var(--mt-muted);
	font-size: 18px;
	line-height: 1.5;
}

.mt-counter {
	margin: 22px 0 8px 34px;
	color: var(--mt-muted);
	font-size: 14px;
}

.mt-choices {
	display: inline-flex;
	flex-direction: column;
	gap: 8px;
	min-width: min(100%, 320px);
	max-width: calc(100% - 34px);
	margin: 22px 0 0 34px;
}

.mt-counter:not([hidden]) + .mt-choices {
	margin-top: 0;
}

.mt-choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 10px 44px 10px 12px;
	box-sizing: border-box;
	border: 1px solid var(--mt-choice-border);
	border-radius: 6px;
	background: var(--mt-choice-bg);
	color: var(--mt-text);
	font: inherit;
	font-size: 18px;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.mt-choice:hover {
	background: #e9eaec;
}

.mt-choice:focus-visible {
	outline: 2px solid var(--mt-text);
	outline-offset: 2px;
}

.mt-key {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 1px solid var(--mt-choice-border);
	border-radius: 4px;
	background: #ffffff;
	font-size: 13px;
	font-weight: 700;
	transition: background-color 0.15s, color 0.15s;
}

.mt-check {
	position: absolute;
	right: 14px;
	display: none;
	color: var(--mt-text);
}

.mt-choice.is-selected {
	border: 2px solid var(--mt-text);
	padding: 9px 43px 9px 11px;
	background: #ffffff;
}

.mt-choice.is-selected .mt-key {
	border-color: var(--mt-text);
	background: var(--mt-text);
	color: #ffffff;
}

.mt-choice.is-selected .mt-check {
	display: block;
}

.mt-choice.is-unavailable {
	opacity: 0.55;
}

@keyframes mt-blink {
	0%, 50%, 100% { background: #ffffff; }
	25%, 75% { background: var(--mt-choice-bg); }
}

.mt-choice.is-blinking {
	animation: mt-blink 0.5s;
}

/* ------------------------------------------------------------ fields */

.mt-field {
	margin: 26px 0 0 34px;
}

.mt-label {
	display: block;
	margin-bottom: 4px;
	color: var(--mt-text);
	font-size: 20px;
}

.mt-input {
	width: 100%;
	padding: 8px 0;
	box-sizing: border-box;
	border: 0;
	border-bottom: 1px solid rgba(42, 51, 61, 0.35);
	border-radius: 0;
	background: transparent;
	color: var(--mt-text);
	font: inherit;
	font-size: 26px;
	line-height: 1.3;
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.mt-input::placeholder {
	color: rgba(42, 51, 61, 0.35);
}

.mt-input:focus {
	border-bottom-color: var(--mt-text);
	box-shadow: 0 1px 0 0 var(--mt-text);
	outline: none;
}

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

.mt-country {
	font-size: 18px;
	cursor: pointer;
}

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

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

.mt-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin: 28px 0 0 34px;
}

.mt-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 20px;
	box-sizing: border-box;
	border: 0;
	border-radius: 6px;
	background: var(--mt-accent);
	color: var(--mt-accent-text);
	font: inherit;
	font-size: 20px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 3px 12px -4px rgba(0, 0, 0, 0.2);
	transition: background-color 0.15s, transform 0.15s;
}

.mt-button:hover {
	background: var(--mt-accent-hover);
	color: var(--mt-accent-text);
}

.mt-button:active {
	transform: translateY(1px);
}

.mt-button:focus-visible {
	outline: 2px solid var(--mt-text);
	outline-offset: 3px;
}

.mt-button:disabled {
	cursor: wait;
	opacity: 0.75;
}

.mt-button-large {
	min-height: 52px;
	padding: 10px 28px;
	font-size: 22px;
}

.mt-hint {
	color: var(--mt-muted);
	font-size: 14px;
}

.mt-error {
	flex-basis: 100%;
	margin: 6px 0 0;
	color: #b32d2e;
	font-size: 15px;
}

.mt-error[hidden] {
	display: none;
}

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

.mt-result-inner {
	max-width: 720px;
	text-align: left;
}

.mt-result-badge {
	display: inline-block;
	margin-bottom: 18px;
	padding: 6px 14px;
	border-radius: 20px;
	background: var(--mt-accent);
	color: var(--mt-accent-text);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.mt-result-title {
	margin: 0 0 18px;
	color: var(--mt-text);
	font-family: inherit;
	font-size: clamp(30px, 3.6vw, 48px);
	font-weight: 400;
	line-height: 1.15;
	outline: none;
}

.mt-result-text {
	margin: 0 0 16px;
	color: var(--mt-muted);
	font-size: 20px;
	line-height: 1.5;
}

.mt-result-inner .mt-button {
	margin-top: 16px;
}

/* ------------------------------------------------------------ mobile */

@media (max-width: 781px) {
	.mt-welcome {
		flex-direction: column;
	}

	.mt-welcome-media {
		flex: 0 0 38vh;
	}

	.mt-welcome-body {
		align-items: flex-start;
		padding: 28px 22px 40px;
	}

	.mt-welcome-text p {
		font-size: 17px;
	}

	.mt-question,
	.mt-result {
		align-items: flex-start;
		padding: 64px 18px 96px;
	}

	.mt-q-description,
	.mt-counter,
	.mt-choices,
	.mt-field,
	.mt-actions {
		margin-left: 0;
	}

	.mt-choices {
		display: flex;
		max-width: 100%;
	}

	.mt-choice {
		font-size: 16px;
	}

	.mt-input {
		font-size: 22px;
	}

	.mt-phone {
		grid-template-columns: minmax(0, 1fr);
	}

	.mt-hint {
		display: none;
	}

	.mt-nav {
		right: 16px;
		bottom: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mt-step,
	.mt-step *,
	.mt-progress-bar {
		animation: none !important;
		transition: none !important;
	}
}
