/**
 * Checkbox control — design system (accent fill, compact).
 */

.kernel-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.kernel-checkbox-group--grid-2 {
	display: grid;
	gap: 10px 14px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kernel-checkbox-group--wrap {
	flex-direction: row;
	flex-wrap: wrap;
}

.kernel-checkbox {
	align-items: flex-start;
	cursor: pointer;
	display: flex;
	gap: 10px;
	line-height: 1.55;
	margin: 0;
	position: relative;
}

.kernel-checkbox__input {
	cursor: pointer;
	height: 100%;
	inset: 0;
	margin: 0;
	opacity: 0;
	position: absolute;
	width: 100%;
	z-index: 1;
}

.kernel-checkbox__control {
	background: var(--ds-surface, #fff);
	border: 1px solid var(--ds-border, #e0e4ee);
	border-radius: 4px;
	box-sizing: border-box;
	flex-shrink: 0;
	height: 16px;
	margin-top: 3px;
	pointer-events: none;
	position: relative;
	transition: background 0.15s ease, border-color 0.15s ease;
	width: 16px;
	z-index: 0;
}

.kernel-checkbox__control::after {
	border: solid #fff;
	border-width: 0 2px 2px 0;
	content: '';
	height: 8px;
	left: 50%;
	opacity: 0;
	position: absolute;
	top: 45%;
	transform: translate(-50%, -50%) rotate(45deg) scale(0.5);
	transition: opacity 0.15s ease, transform 0.15s ease;
	width: 4px;
}

.kernel-checkbox__input:focus-visible + .kernel-checkbox__control {
	box-shadow: 0 0 0 3px var(--ds-accent-soft, rgba(4, 16, 70, 0.12));
	outline: none;
}

.kernel-checkbox__input:checked + .kernel-checkbox__control {
	background: var(--ds-accent, #041046);
	border-color: var(--ds-accent, #041046);
}

.kernel-checkbox__input:checked + .kernel-checkbox__control::after {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.kernel-checkbox__input:disabled + .kernel-checkbox__control {
	opacity: 0.55;
}

.kernel-checkbox__input:disabled ~ .kernel-checkbox__label {
	opacity: 0.55;
}

.kernel-checkbox__label {
	color: var(--ds-text, #1a1d26);
	flex: 1;
	font-family: var(--ds-font, inherit);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.55;
	pointer-events: none;
}

.kernel-checkbox--solo {
	display: inline-flex;
	gap: 0;
	height: 16px;
	width: 16px;
}

.kernel-checkbox--solo .kernel-checkbox__input {
	position: absolute;
}

.kernel-checkbox--solo .kernel-checkbox__control {
	margin-top: 0;
}

.kernel-checkbox__label a {
	color: var(--ds-accent, #041046);
}

fieldset.kernel-entity-field.kernel-entity-field--checkboxes {
	border: 0;
	margin: 0 0 1.5rem;
	min-inline-size: 0;
	min-width: 0;
	outline: none;
	padding: 0;
}

fieldset.kernel-entity-field.kernel-entity-field--checkboxes > legend {
	display: block;
	float: none;
	font-weight: 600;
	margin-bottom: 10px;
	max-width: none;
	padding: 0;
	width: auto;
}
