/* Основной контейнер чекбокса */
.checkbox-field {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px; /* Отступ между чекбоксами */
}

/* Обертка label */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: var(--ui-font-size-sm);
    line-height: 1.4;
    color: var(--ui-color-text-secondary);
    width: 100%;
}

/* Скрытие стандартного чекбокса */
.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Кастомный чекбокс */
.checkbox-custom {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid var(--ui-color-palette-gray-50);
    border-radius: 2px;
    margin-right: 8px;
    background-color: white;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

/* Галочка при checked */
.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid var(--ui-color-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* При наведении */
.checkbox-label:hover .checkbox-custom {
    border-color: var(--ui-color-primary);
}

/* Фокус для доступности */
.checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
    outline: 2px solid var(--ui-color-primary);
    outline-offset: 2px;
}

/* Обертка текста — чтобы текст не ломался и не вылезал */
.checkbox-text {
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
    width: calc(100% - 26px); /* Учитываем ширину чекбокса + отступ */
    min-width: 0; /* Важно для flex-элементов */
}

/* Стили для ссылок внутри чекбокса */
.checkbox-link {
    color: var(--ui-color-link-primary-base);
    text-decoration: underline;
    transition: color 0.2s ease;
    font-weight: 500;
}

.checkbox-link:hover {
    color: var(--ui-color-link-primary-base);
    opacity: 0.8;
    text-decoration: underline;
}

/* Дополнительно: если текст слишком длинный и нужно переносить — делаем его красиво */
.checkbox-text {
    max-width: 100%;
}

.checkbox-custom.checkbox-error {
    border-color: var(--ui-color-palette-red-50) !important; /* или #ff5752 */
    box-shadow: 0 0 0 2px rgba(255, 87, 82, 0.2); /* опционально: легкая тень для акцента */
}