/**
 * Behavior Lab — participant front-end styles.
 *
 * Scoped under .bl-app / .bl-results to avoid clashing with the host theme.
 * Uses CSS variables so a theme can override the accent without editing here.
 */

.bl-app {
	--bl-accent: #2271b1;
	--bl-accent-dark: #135e96;
	--bl-bg: #ffffff;
	--bl-border: #d8dde3;
	--bl-text: #1d2327;
	--bl-muted: #646970;
	--bl-radius: 10px;

	max-width: 720px;
	margin: 0 auto;
	color: var(--bl-text);
	font-size: 16px;
	line-height: 1.55;
}

.bl-app *,
.bl-results * {
	box-sizing: border-box;
}

/* Stages / forms */
.bl-form {
	background: var(--bl-bg);
	border: 1px solid var(--bl-border);
	border-radius: var(--bl-radius);
	padding: 28px;
}

.bl-stage-title {
	margin: 0 0 6px;
	font-size: 24px;
}

.bl-stage-help {
	margin: 0 0 20px;
	color: var(--bl-muted);
}

.bl-field {
	margin-bottom: 16px;
}

.bl-field-row {
	display: flex;
	gap: 16px;
}

.bl-field-row .bl-field {
	flex: 1 1 50%;
}

.bl-label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 14px;
}

.bl-req {
	color: #b32d2e;
}

.bl-input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--bl-border);
	border-radius: 8px;
	font-size: 16px;
	background: #fff;
}

.bl-input:focus {
	outline: none;
	border-color: var(--bl-accent);
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.bl-input-code {
	text-transform: uppercase;
	letter-spacing: 2px;
	font-weight: 600;
}

.bl-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 14px;
	color: var(--bl-muted);
	margin: 8px 0 20px;
}

/* Buttons */
.bl-button {
	display: inline-block;
	padding: 12px 22px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.bl-button-primary {
	background: var(--bl-accent);
	color: #fff;
}

.bl-button-primary:hover {
	background: var(--bl-accent-dark);
}

.bl-button-ghost {
	background: transparent;
	color: var(--bl-accent);
	border-color: var(--bl-border);
}

.bl-button[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* Messages */
.bl-message {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: 8px;
	background: #eef6fb;
	border: 1px solid #cfe4f2;
	font-size: 15px;
}

.bl-message.bl-message-error {
	background: #fcf0f1;
	border-color: #f0c4c6;
	color: #8a1f24;
}

/* Quiz stage */
.bl-quiz {
	background: var(--bl-bg);
	border: 1px solid var(--bl-border);
	border-radius: var(--bl-radius);
	padding: 28px;
}

.bl-progress {
	height: 8px;
	background: #eef1f4;
	border-radius: 99px;
	overflow: hidden;
}

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

.bl-progress-label {
	margin: 8px 0 18px;
	font-size: 13px;
	color: var(--bl-muted);
}

.bl-question-section {
	text-transform: uppercase;
	letter-spacing: 0.6px;
	font-size: 12px;
	font-weight: 700;
	color: var(--bl-accent);
	margin: 0 0 6px;
}

.bl-question-text {
	font-size: 20px;
	font-weight: 600;
	margin-bottom: 18px;
}

.bl-answers {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.bl-answer {
	margin-bottom: 10px;
}

.bl-answer-input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.bl-answer-label {
	display: block;
	padding: 14px 16px;
	border: 1px solid var(--bl-border);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bl-answer-label:hover {
	border-color: var(--bl-accent);
}

.bl-answer-input:checked + .bl-answer-label {
	border-color: var(--bl-accent);
	background: rgba(34, 113, 177, 0.08);
	box-shadow: inset 0 0 0 1px var(--bl-accent);
}

.bl-answer-input:focus + .bl-answer-label {
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.bl-quiz-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 22px;
}

.bl-quiz-nav .bl-next {
	margin-left: auto;
}

/* ---------------- Results ---------------- */
.bl-results {
	background: var(--bl-bg, #fff);
	border: 1px solid #d8dde3;
	border-radius: 10px;
	padding: 30px;
}

.bl-results-title {
	margin: 0 0 4px;
	font-size: 26px;
}

.bl-results-greeting {
	margin: 0 0 18px;
	color: #646970;
}

.bl-results-intro {
	margin-bottom: 22px;
}

.bl-message-info {
	background: #eef6fb;
	border: 1px solid #cfe4f2;
	padding: 16px;
	border-radius: 8px;
}

.bl-message-error {
	background: #fcf0f1;
	border: 1px solid #f0c4c6;
	color: #8a1f24;
	padding: 16px;
	border-radius: 8px;
}

/* Type card */
.bl-type-card {
	text-align: center;
	padding: 26px;
	border-radius: 12px;
	background: #f6f8fa;
	border-top: 6px solid var(--bl-type-color, #2271b1);
	margin-bottom: 26px;
}

.bl-type-code {
	font-size: 46px;
	font-weight: 800;
	letter-spacing: 3px;
	line-height: 1;
	color: var(--bl-type-color, #1d2327);
}

.bl-type-name {
	font-size: 20px;
	font-weight: 600;
	margin-top: 6px;
}

.bl-type-temperament {
	display: inline-block;
	margin-top: 10px;
	padding: 3px 12px;
	border-radius: 99px;
	background: var(--bl-type-color, #2271b1);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
}

.bl-section-title {
	font-size: 18px;
	margin: 0 0 14px;
}

/* Pair bars */
.bl-pair {
	display: grid;
	grid-template-columns: 1fr 2fr 1fr;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.bl-pair-side {
	font-size: 14px;
}

.bl-pair-side:last-child {
	text-align: right;
}

.bl-pair-name {
	display: block;
	font-weight: 600;
	color: var(--bl-muted, #646970);
}

.bl-pair-win .bl-pair-name {
	color: var(--bl-text, #1d2327);
}

.bl-pair-pct {
	font-size: 13px;
	color: var(--bl-muted, #646970);
}

.bl-pair-win .bl-pair-pct {
	color: var(--bl-accent, #2271b1);
	font-weight: 700;
}

.bl-pair-bar {
	display: flex;
	height: 14px;
	border-radius: 99px;
	overflow: hidden;
	background: #eef1f4;
}

.bl-pair-fill-a {
	background: var(--bl-accent, #2271b1);
}

.bl-pair-fill-b {
	background: #a7c4dd;
}

/* Plain dimension bars */
.bl-dim {
	margin-bottom: 14px;
}

.bl-dim-head {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 5px;
}

.bl-dim-bar {
	height: 12px;
	background: #eef1f4;
	border-radius: 99px;
	overflow: hidden;
}

.bl-dim-fill {
	height: 100%;
	background: var(--bl-accent, #2271b1);
	border-radius: 99px;
}

.bl-type-description {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e6e9ec;
}

/* ---------------- Winning-dimension tiles (MBTI) ---------------- */
.bl-tiles {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 12px;
	margin: 0 0 26px;
}

.bl-tile {
	border: 1px solid #e2e6ea;
	border-radius: 10px;
	overflow: hidden;
	text-align: center;
	background: #fff;
}

.bl-tile-top {
	background: var( --bl-dim-color, #2271b1 );
	color: #fff;
	padding: 10px 6px;
}

.bl-tile-code {
	display: block;
	font-size: 22px;
	font-weight: 800;
	line-height: 1;
}

.bl-tile-pct {
	font-size: 14px;
	font-weight: 700;
}

.bl-tile-img img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
}

.bl-tile-name {
	padding: 8px 4px;
	font-size: 13px;
	font-weight: 600;
}

/* ---------------- Paired (Optimism) cover ---------------- */
.bl-pair2 {
	display: grid;
	grid-template-columns: 1fr 2fr 1fr;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}

.bl-pair2-side {
	text-align: center;
	font-size: 13px;
}

.bl-pair2-side img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	margin: 0 auto 4px;
}

.bl-pair2-name {
	display: block;
	font-weight: 700;
}

.bl-pair2-pct {
	font-size: 13px;
	color: #50575e;
}

.bl-pair2-bar {
	display: flex;
	height: 16px;
	border-radius: 99px;
	overflow: hidden;
	background: #eef1f4;
}

.bl-pair2-fill {
	height: 100%;
}

/* ---------------- Per-dimension write-up sections ---------------- */
.bl-dim-section {
	margin: 24px 0;
	padding-top: 18px;
	border-top: 1px solid #e6e9ec;
}

.bl-dim-section-title {
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 12px;
}

.bl-dim-section-body {
	font-size: 15px;
	line-height: 1.6;
}

@media ( max-width: 540px ) {
	.bl-tiles {
		grid-template-columns: repeat( 2, 1fr );
	}
	.bl-pair2 {
		grid-template-columns: 1fr;
		gap: 8px;
	}
}

/* ---------------- Group results ---------------- */
.bl-group-results {
	font-size: 15px;
}

.bl-gr-title {
	margin: 0 0 2px;
	font-size: 24px;
}

.bl-gr-sub {
	margin: 0 0 18px;
	color: #646970;
}

.bl-quadrant {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 18px 0 8px;
}

.bl-quadrant-cell {
	background: var(--bl-q-color, #2271b1);
	color: #fff;
	border-radius: 12px;
	padding: 18px;
	text-align: center;
}

.bl-quadrant-key {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 2px;
}

.bl-quadrant-label {
	font-size: 13px;
	opacity: 0.92;
}

.bl-quadrant-count {
	font-size: 30px;
	font-weight: 800;
	line-height: 1.1;
	margin-top: 8px;
}

.bl-quadrant-pct {
	font-size: 13px;
	opacity: 0.92;
}

.bl-gr-section {
	margin: 24px 0 12px;
	font-size: 17px;
}

.bl-gr-dist-row {
	display: grid;
	grid-template-columns: 170px 1fr 36px;
	gap: 10px;
	align-items: center;
	margin-bottom: 8px;
	font-size: 13px;
}

.bl-gr-dist-name {
	color: #8a8f94;
	margin-left: 6px;
}

.bl-gr-dist-bar {
	background: #eef1f4;
	border-radius: 99px;
	height: 14px;
	overflow: hidden;
}

.bl-gr-dist-fill {
	display: block;
	height: 100%;
	background: var(--bl-accent, #2271b1);
	border-radius: 99px;
}

.bl-gr-dist-count {
	text-align: right;
	font-weight: 600;
}

.bl-gr-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 6px;
}

.bl-gr-table th,
.bl-gr-table td {
	text-align: left;
	padding: 9px 10px;
	border-bottom: 1px solid #e6e9ec;
	font-size: 14px;
}

.bl-gr-typename {
	color: #8a8f94;
	margin-left: 6px;
	font-size: 12px;
}

/* Responsive */
@media ( max-width: 540px ) {
	.bl-quadrant {
		grid-template-columns: 1fr;
	}
	.bl-gr-dist-row {
		grid-template-columns: 110px 1fr 30px;
	}
	.bl-field-row {
		flex-direction: column;
		gap: 0;
	}
	.bl-form,
	.bl-quiz,
	.bl-results {
		padding: 20px;
	}
	.bl-type-code {
		font-size: 38px;
	}
}
